Unverified Commit d31ce31a authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Update enabled color for outlined text fields. (#33083)

Resets the enabled color for outline text field default borders to "On Surface 38%" instead of "On Surface 12%" to match spec. Also fixes the hover overlay to be "On Surface 12%" to match spec.
parent cd814eb3
...@@ -1830,11 +1830,12 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat ...@@ -1830,11 +1830,12 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
if (decoration.filled) { if (decoration.filled) {
return themeData.hintColor; return themeData.hintColor;
} }
final Color enabledColor = themeData.colorScheme.onSurface.withOpacity(0.38);
if (isHovering) { if (isHovering) {
final Color hoverColor = decoration.hoverColor ?? themeData.inputDecorationTheme?.hoverColor ?? themeData.hoverColor; final Color hoverColor = decoration.hoverColor ?? themeData.inputDecorationTheme?.hoverColor ?? themeData.hoverColor;
return Color.alphaBlend(hoverColor.withOpacity(0.16), themeData.colorScheme.onSurface.withOpacity(0.12)); return Color.alphaBlend(hoverColor.withOpacity(0.12), enabledColor);
} }
return themeData.colorScheme.onSurface.withOpacity(0.12); return enabledColor;
} }
Color _getFillColor(ThemeData themeData) { Color _getFillColor(ThemeData themeData) {
......
...@@ -2048,7 +2048,7 @@ void main() { ...@@ -2048,7 +2048,7 @@ void main() {
const Color fillColor = Color(0x0A000000); const Color fillColor = Color(0x0A000000);
const Color hoverColor = Color(0xFF00FF00); const Color hoverColor = Color(0xFF00FF00);
const Color disabledColor = Color(0x05000000); const Color disabledColor = Color(0x05000000);
const Color enabledBorderColor = Color(0x1f000000); const Color enabledBorderColor = Color(0x61000000);
Future<void> pumpDecorator({bool hovering, bool enabled = true, bool filled = true}) async { Future<void> pumpDecorator({bool hovering, bool enabled = true, bool filled = true}) async {
return await tester.pumpWidget( return await tester.pumpWidget(
...@@ -2092,7 +2092,7 @@ void main() { ...@@ -2092,7 +2092,7 @@ void main() {
expect(getContainerColor(tester), equals(disabledColor)); expect(getContainerColor(tester), equals(disabledColor));
// Test outline text field. // Test outline text field.
const Color blendedHoverColor = Color(0x43009c00); const Color blendedHoverColor = Color(0x74004400);
await pumpDecorator(hovering: false, filled: false); await pumpDecorator(hovering: false, filled: false);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(getBorderColor(tester), equals(enabledBorderColor)); expect(getBorderColor(tester), equals(enabledBorderColor));
...@@ -2123,7 +2123,7 @@ void main() { ...@@ -2123,7 +2123,7 @@ void main() {
testWidgets('InputDecorator draws and animates focusColor', (WidgetTester tester) async { testWidgets('InputDecorator draws and animates focusColor', (WidgetTester tester) async {
const Color focusColor = Color(0xFF0000FF); const Color focusColor = Color(0xFF0000FF);
const Color disabledColor = Color(0x05000000); const Color disabledColor = Color(0x05000000);
const Color enabledBorderColor = Color(0x1f000000); const Color enabledBorderColor = Color(0x61000000);
Future<void> pumpDecorator({bool focused, bool enabled = true, bool filled = true}) async { Future<void> pumpDecorator({bool focused, bool enabled = true, bool filled = true}) async {
return await tester.pumpWidget( return await tester.pumpWidget(
......
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