Skip to content
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

Update SnackBar to the latest Material specs. #37038

Merged
merged 1 commit into from Jul 31, 2019

Conversation

@darrenaustin
Copy link
Contributor

commented Jul 26, 2019

Description

Bringing the SnackBar up to spec:

  • Fixed dark theme SnackBars to use a light theme.
  • Update the SnackBar to configure itself with ColorScheme colors

Light theme:

Light theme

Dark theme:

Dark theme

Related Issues

Fixes #31418

Tests

Added new tests to check the background color in both light and dark themes.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • No, this is not a breaking change.
backgroundColor: isThemeDark
? colorScheme.onSurface
: Color.alphaBlend(colorScheme.onSurface.withOpacity(0.80), colorScheme.surface),
accentColor: isThemeDark ? colorScheme.primaryVariant : colorScheme.secondary,

This comment has been minimized.

Copy link
@HansMuller

HansMuller Jul 26, 2019

Contributor

Shouldn't this inverseTheme's colorScheme have a similar secondary color? Shouldn't it have a new color scheme?

This comment has been minimized.

Copy link
@HansMuller

HansMuller Jul 26, 2019

Contributor

Maybe open an issue about the need for a proper inverse color scheme here.

Copy link
Contributor

left a comment

LGTM

@darrenaustin darrenaustin force-pushed the darrenaustin:snack_bar_dark_mode branch from 88e5abd to 4fc6a8c Jul 29, 2019
@rami-a
rami-a approved these changes Jul 30, 2019
Copy link
Contributor

left a comment

LGTM with one minor comment!

final ThemeData inverseTheme = ThemeData(
brightness: brightness,
backgroundColor: themeBackgroundColor,
colorScheme: ColorScheme(

This comment has been minimized.

Copy link
@rami-a

rami-a Jul 30, 2019

Contributor

I think you could maybe use copyWith here to make this a bit more concise since you only want to change the secondary color and the brightness.

@darrenaustin darrenaustin merged commit f0957ab into flutter:master Jul 31, 2019
74 of 75 checks passed
74 of 75 checks passed
tool_coverage-linux Task Summary
Details
WIP Ready for review
Details
add2app-macos Task Summary
Details
add2app-macos
Details
analyze Task Summary
Details
analyze
Details
build_tests-linux Task Summary
Details
build_tests-linux
Details
build_tests-macos Task Summary
Details
build_tests-macos
Details
build_tests-windows Task Summary
Details
build_tests-windows
Details
cla/google All necessary CLAs are signed
customer_testing-linux Task Summary
Details
customer_testing-linux
Details
customer_testing-macos Task Summary
Details
customer_testing-macos
Details
customer_testing-windows Task Summary
Details
customer_testing-windows
Details
deploy_gallery Task Summary
Details
deploy_gallery
Details
deploy_gallery-macos Task Summary
Details
deploy_gallery-macos
Details
docs Task Summary
Details
docs
Details
flutter-build
Details
integration_tests-linux Task Summary
Details
integration_tests-linux
Details
integration_tests-macos Task Summary
Details
integration_tests-macos
Details
integration_tests-windows Task Summary
Details
integration_tests-windows
Details
integration_tests_gradle1-linux Task Summary
Details
integration_tests_gradle1-linux
Details
integration_tests_gradle2-linux Task Summary
Details
integration_tests_gradle2-linux
Details
release_smoke_tests Task Summary
Details
release_smoke_tests
Details
tests_extras-linux Task Summary
Details
tests_extras-linux
Details
tests_extras-macos Task Summary
Details
tests_extras-macos
Details
tests_extras-windows Task Summary
Details
tests_extras-windows
Details
tests_framework_other-linux Task Summary
Details
tests_framework_other-linux
Details
tests_framework_other-macos Task Summary
Details
tests_framework_other-macos
Details
tests_framework_other-windows Task Summary
Details
tests_framework_other-windows
Details
tests_widgets-linux Task Summary
Details
tests_widgets-linux
Details
tests_widgets-macos Task Summary
Details
tests_widgets-macos
Details
tests_widgets-windows Task Summary
Details
tests_widgets-windows
Details
tool_coverage-linux
Details
tool_tests-linux Task Summary
Details
tool_tests-linux
Details
tool_tests-macos Task Summary
Details
tool_tests-macos
Details
tool_tests-windows Task Summary
Details
tool_tests-windows
Details
tool_tests_create-linux Task Summary
Details
tool_tests_create-linux
Details
tool_tests_create-macos Task Summary
Details
tool_tests_create-macos
Details
tool_tests_create-windows Task Summary
Details
tool_tests_create-windows
Details
tool_tests_integration-linux Task Summary
Details
tool_tests_integration-linux
Details
tool_tests_integration-macos Task Summary
Details
tool_tests_integration-macos
Details
tool_tests_integration-windows Task Summary
Details
tool_tests_integration-windows
Details
@HansMuller HansMuller referenced this pull request Sep 6, 2019
15 of 15 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.