Skip to content

Removed InputDecorator accentColor dependency. #77999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2021
Merged

Removed InputDecorator accentColor dependency. #77999

merged 1 commit into from
Mar 13, 2021

Conversation

darrenaustin
Copy link
Contributor

This PR removes the InputDecorator widget's accentColor dependency per #56918.

The previous implementation used ThemeData.accentColor and ThemeData.primaryColor for default border and label text colors. This PR changes them to the theme's colorScheme.primary instead.

Breaking change

This is a breaking change. For apps that need specific colors for these values, you can use the InputDecoratorTheme to configure the exact colors needed.

Added tests to verify the new default value for the border and label colors.

This PR was tested against internal Google apps in cl/359840215.

@darrenaustin darrenaustin added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Mar 12, 2021
@darrenaustin darrenaustin requested a review from HansMuller March 12, 2021 07:28
@google-cla google-cla bot added the cla: yes label Mar 12, 2021
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

testWidgets('InputDecoration default border uses colorScheme', (WidgetTester tester) async {
final ThemeData theme = ThemeData.from(colorScheme: const ColorScheme.light());
final Color enabledColor = theme.colorScheme.onSurface.withOpacity(0.38);
final Color hoverColor = Color.alphaBlend(theme.hoverColor.withOpacity(0.12), enabledColor);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE

@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants