diff --git a/packages/flutter/lib/src/cupertino/colors.dart b/packages/flutter/lib/src/cupertino/colors.dart index 41a17ad1a4..413a82638c 100644 --- a/packages/flutter/lib/src/cupertino/colors.dart +++ b/packages/flutter/lib/src/cupertino/colors.dart @@ -75,13 +75,16 @@ class CupertinoColors { // Value derived from screenshot from the dark themed Apple Watch app. static const Color darkBackgroundGray = Color(0xFF171717); - /// Used in iOS 11 for unselected selectables such as tab bar items in their + /// Used in iOS 13 for unselected selectables such as tab bar items in their /// inactive state or de-emphasized subtitles and details text. /// /// Not the same gray as disabled buttons etc. /// - /// This is SystemGrayColor in the iOS palette. - static const Color inactiveGray = Color(0xFF8E8E93); + /// This is the disabled color in the iOS palette. + static const Color inactiveGray = CupertinoDynamicColor.withBrightness( + color: Color(0xFF999999), + darkColor: Color(0xFF757575), + ); /// Used for iOS 10 for destructive actions such as the delete actions in /// table view cells and dialogs. diff --git a/packages/flutter/lib/src/cupertino/refresh.dart b/packages/flutter/lib/src/cupertino/refresh.dart index 4f0f5e5380..286b2d3d0a 100644 --- a/packages/flutter/lib/src/cupertino/refresh.dart +++ b/packages/flutter/lib/src/cupertino/refresh.dart @@ -379,9 +379,9 @@ class CupertinoSliverRefreshControl extends StatefulWidget { opacity: opacityCurve.transform( min(pulledExtent / refreshTriggerPullDistance, 1.0) ), - child: const Icon( + child: Icon( CupertinoIcons.down_arrow, - color: CupertinoColors.inactiveGray, + color: CupertinoDynamicColor.resolve(CupertinoColors.inactiveGray, context), size: 36.0, ), ) diff --git a/packages/flutter/test/cupertino/refresh_test.dart b/packages/flutter/test/cupertino/refresh_test.dart index 0241bac674..ff2fda23c7 100644 --- a/packages/flutter/test/cupertino/refresh_test.dart +++ b/packages/flutter/test/cupertino/refresh_test.dart @@ -1403,6 +1403,50 @@ void main() { debugDefaultTargetPlatformOverride = null; }, ); + + testWidgets('buildSimpleRefreshIndicator dark mode', (WidgetTester tester) async { + const CupertinoDynamicColor color = CupertinoColors.inactiveGray; + + await tester.pumpWidget( + MediaQuery( + data: const MediaQueryData(platformBrightness: Brightness.light), + child: Directionality( + textDirection: TextDirection.ltr, + child: Builder( + builder: (BuildContext context) { + return CupertinoSliverRefreshControl.buildSimpleRefreshIndicator( + context, + RefreshIndicatorMode.drag, + 10, 10, 10, + ); + }, + ), + ), + ), + ); + + expect(tester.widget(find.byType(Icon)).color.value, color.color.value); + + await tester.pumpWidget( + MediaQuery( + data: const MediaQueryData(platformBrightness: Brightness.dark), + child: Directionality( + textDirection: TextDirection.ltr, + child: Builder( + builder: (BuildContext context) { + return CupertinoSliverRefreshControl.buildSimpleRefreshIndicator( + context, + RefreshIndicatorMode.drag, + 10, 10, 10, + ); + }, + ), + ), + ), + ); + + expect(tester.widget(find.byType(Icon)).color.value, color.darkColor.value); + }); }; group('UI tests long list', uiTestGroup); diff --git a/packages/flutter/test/widgets/editable_text_cursor_test.dart b/packages/flutter/test/widgets/editable_text_cursor_test.dart index 91dec601ff..e9fd27e4ba 100644 --- a/packages/flutter/test/widgets/editable_text_cursor_test.dart +++ b/packages/flutter/test/widgets/editable_text_cursor_test.dart @@ -699,7 +699,7 @@ void main() { const Rect.fromLTRB(463.3333435058594, -0.916666666666668, 465.3333435058594, 17.083333015441895), const Radius.circular(2.0), ), - color: const Color(0xff8e8e93), + color: const Color(0xff999999), ) ..rrect( rrect: RRect.fromRectAndRadius( @@ -724,7 +724,7 @@ void main() { const Rect.fromLTRB(191.3333282470703, -0.916666666666668, 193.3333282470703, 17.083333015441895), const Radius.circular(2.0), ), - color: const Color(0xff8e8e93), + color: const Color(0xff999999), ) ..rrect( rrect: RRect.fromRectAndRadius(