Unverified Commit 2ef7cd64 authored by Will Larche's avatar Will Larche Committed by GitHub

[Icons] Updating default icon theme values. (#20840)

Closes #3188
parent 70eefd1e
...@@ -74,7 +74,7 @@ void main() { ...@@ -74,7 +74,7 @@ void main() {
// check the colour of the icon - light mode // check the colour of the icon - light mode
checkIconColor(tester, 'Stock List', Colors.purple); // theme primary color checkIconColor(tester, 'Stock List', Colors.purple); // theme primary color
checkIconColor(tester, 'Account Balance', Colors.black26); // disabled checkIconColor(tester, 'Account Balance', Colors.black38); // disabled
checkIconColor(tester, 'About', Colors.black45); // enabled checkIconColor(tester, 'About', Colors.black45); // enabled
// switch to dark mode // switch to dark mode
......
...@@ -411,11 +411,11 @@ class MaterialButton extends StatelessWidget { ...@@ -411,11 +411,11 @@ class MaterialButton extends StatelessWidget {
case ButtonTextTheme.normal: case ButtonTextTheme.normal:
return enabled return enabled
? (themeIsDark ? Colors.white : Colors.black87) ? (themeIsDark ? Colors.white : Colors.black87)
: (themeIsDark ? Colors.white30 : Colors.black26); : theme.disabledColor;
case ButtonTextTheme.accent: case ButtonTextTheme.accent:
return enabled return enabled
? theme.accentColor ? theme.accentColor
: (themeIsDark ? Colors.white30 : Colors.black26); : theme.disabledColor;
case ButtonTextTheme.primary: case ButtonTextTheme.primary:
return enabled return enabled
? (fillIsDark ? Colors.white : Colors.black) ? (fillIsDark ? Colors.white : Colors.black)
......
...@@ -167,7 +167,7 @@ class ThemeData extends Diagnosticable { ...@@ -167,7 +167,7 @@ class ThemeData extends Diagnosticable {
splashFactory ??= InkSplash.splashFactory; splashFactory ??= InkSplash.splashFactory;
selectedRowColor ??= Colors.grey[100]; selectedRowColor ??= Colors.grey[100];
unselectedWidgetColor ??= isDark ? Colors.white70 : Colors.black54; unselectedWidgetColor ??= isDark ? Colors.white70 : Colors.black54;
disabledColor ??= isDark ? Colors.white30 : Colors.black26; disabledColor ??= isDark ? Colors.white30 : Colors.black38;
buttonColor ??= isDark ? primarySwatch[600] : Colors.grey[300]; buttonColor ??= isDark ? primarySwatch[600] : Colors.grey[300];
buttonTheme ??= const ButtonThemeData(); buttonTheme ??= const ButtonThemeData();
// Spec doesn't specify a dark theme secondaryHeaderColor, this is a guess. // Spec doesn't specify a dark theme secondaryHeaderColor, this is a guess.
...@@ -182,9 +182,9 @@ class ThemeData extends Diagnosticable { ...@@ -182,9 +182,9 @@ class ThemeData extends Diagnosticable {
hintColor ??= isDark ? const Color(0x80FFFFFF) : const Color(0x8A000000); hintColor ??= isDark ? const Color(0x80FFFFFF) : const Color(0x8A000000);
errorColor ??= Colors.red[700]; errorColor ??= Colors.red[700];
inputDecorationTheme ??= const InputDecorationTheme(); inputDecorationTheme ??= const InputDecorationTheme();
iconTheme ??= isDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black);
primaryIconTheme ??= primaryIsDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black); primaryIconTheme ??= primaryIsDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black);
accentIconTheme ??= accentIsDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black); accentIconTheme ??= accentIsDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black);
iconTheme ??= isDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black87);
platform ??= defaultTargetPlatform; platform ??= defaultTargetPlatform;
final Typography typography = new Typography(platform: platform); final Typography typography = new Typography(platform: platform);
final TextTheme defaultTextTheme = isDark ? typography.white : typography.black; final TextTheme defaultTextTheme = isDark ? typography.white : typography.black;
......
...@@ -310,7 +310,27 @@ void main() { ...@@ -310,7 +310,27 @@ void main() {
); );
}); });
testWidgets('Disabled MaterialButton has same semantic size as enabled and exposes disabled semantics', (WidgetTester tester) async { testWidgets('Disabled MaterialButton has correct default text color', (WidgetTester tester) async {
const String testText = 'Disabled';
const Widget buttonWidget = Directionality(
textDirection: TextDirection.ltr,
child: Material(
child: Center(
child: MaterialButton(
onPressed: null,
child: Text(testText), // button is disabled
),
),
),
);
await tester.pumpWidget(buttonWidget);
final RichText text = tester.widget<RichText>(find.byType(RichText));
expect(text.text.style.color, Colors.black38);
});
testWidgets('Disabled MaterialButton has same semantic size as enabled and exposes disabled semantics', (WidgetTester tester) async {
final SemanticsTester semantics = new SemanticsTester(tester); final SemanticsTester semantics = new SemanticsTester(tester);
final Rect expectedButtonSize = new Rect.fromLTRB(0.0, 0.0, 116.0, 48.0); final Rect expectedButtonSize = new Rect.fromLTRB(0.0, 0.0, 116.0, 48.0);
......
...@@ -37,7 +37,7 @@ void main() { ...@@ -37,7 +37,7 @@ void main() {
); );
final IconTheme iconTheme = tester.firstWidget(find.byType(IconTheme).last); final IconTheme iconTheme = tester.firstWidget(find.byType(IconTheme).last);
expect(iconTheme.data.color, equals(Colors.black26)); expect(iconTheme.data.color, equals(Colors.black38));
}); });
testWidgets('ExpandIcon test isExpanded does not trigger callback', (WidgetTester tester) async { testWidgets('ExpandIcon test isExpanded does not trigger callback', (WidgetTester tester) async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment