diff --git a/packages/flutter/lib/src/cupertino/theme.dart b/packages/flutter/lib/src/cupertino/theme.dart index 75d68d8489e..36315e297ca 100644 --- a/packages/flutter/lib/src/cupertino/theme.dart +++ b/packages/flutter/lib/src/cupertino/theme.dart @@ -22,7 +22,7 @@ export 'package:flutter/foundation.dart' show Brightness; const _CupertinoThemeDefaults _kDefaultTheme = _CupertinoThemeDefaults( null, CupertinoColors.systemBlue, - CupertinoColors.systemBackground, + CupertinoColors.white, CupertinoDynamicColor.withBrightness( color: Color(0xF0F9F9F9), darkColor: Color(0xF01D1D1D), diff --git a/packages/flutter/test/cupertino/button_test.dart b/packages/flutter/test/cupertino/button_test.dart index 44ea39aba5b..6589055a12b 100644 --- a/packages/flutter/test/cupertino/button_test.dart +++ b/packages/flutter/test/cupertino/button_test.dart @@ -454,7 +454,7 @@ void main() { ), ), ); - expect(textStyle.color, isSameColorAs(CupertinoColors.black)); + expect(textStyle.color, isSameColorAs(CupertinoColors.white)); decoration = tester.widget( find.descendant( of: find.byType(CupertinoButton), diff --git a/packages/flutter/test/cupertino/segmented_control_test.dart b/packages/flutter/test/cupertino/segmented_control_test.dart index e669b63d9ff..bcf7d1a4db1 100644 --- a/packages/flutter/test/cupertino/segmented_control_test.dart +++ b/packages/flutter/test/cupertino/segmented_control_test.dart @@ -337,7 +337,7 @@ void main() { DefaultTextStyle textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1').first); IconThemeData iconTheme = IconTheme.of(tester.element(find.byIcon(const IconData(1)))); - expect(textStyle.style.color, isSameColorAs(CupertinoColors.black)); + expect(textStyle.style.color, isSameColorAs(CupertinoColors.white)); expect(iconTheme.color, isSameColorAs(CupertinoColors.systemBlue.darkColor)); await tester.tap(find.byIcon(const IconData(1))); @@ -348,7 +348,7 @@ void main() { iconTheme = IconTheme.of(tester.element(find.byIcon(const IconData(1)))); expect(textStyle.style.color, isSameColorAs(CupertinoColors.systemBlue.darkColor)); - expect(iconTheme.color, isSameColorAs(CupertinoColors.black)); + expect(iconTheme.color, isSameColorAs(CupertinoColors.white)); }, ); diff --git a/packages/flutter/test/cupertino/theme_test.dart b/packages/flutter/test/cupertino/theme_test.dart index 148462a9788..bc68425cad0 100644 --- a/packages/flutter/test/cupertino/theme_test.dart +++ b/packages/flutter/test/cupertino/theme_test.dart @@ -225,12 +225,16 @@ void main() { }); late Brightness currentBrightness; - void colorMatches(Color? componentColor, CupertinoDynamicColor expectedDynamicColor) { - switch (currentBrightness) { - case Brightness.light: - expect(componentColor, isSameColorAs(expectedDynamicColor.color)); - case Brightness.dark: - expect(componentColor, isSameColorAs(expectedDynamicColor.darkColor)); + void colorMatches(Color? componentColor, Color expectedDynamicColor) { + if (expectedDynamicColor is CupertinoDynamicColor) { + switch (currentBrightness) { + case Brightness.light: + expect(componentColor, isSameColorAs(expectedDynamicColor.color)); + case Brightness.dark: + expect(componentColor, isSameColorAs(expectedDynamicColor.darkColor)); + } + } else { + expect(componentColor, isSameColorAs(expectedDynamicColor)); } } @@ -254,7 +258,7 @@ void main() { final CupertinoThemeData theme = await testTheme(tester, data); - colorMatches(theme.primaryContrastingColor, CupertinoColors.systemBackground); + colorMatches(theme.primaryContrastingColor, CupertinoColors.white); colorMatches(theme.barBackgroundColor, barBackgroundColor); colorMatches(theme.scaffoldBackgroundColor, CupertinoColors.systemBackground); colorMatches(theme.textTheme.textStyle.color, CupertinoColors.label);