Skip to content

Conversation

@darrenaustin
Copy link
Contributor

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.

@darrenaustin darrenaustin added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jul 26, 2019
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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

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

Copy link
Contributor

@rami-a rami-a left a comment

Choose a reason for hiding this comment

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

LGTM with one minor comment!

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

Choose a reason for hiding this comment

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

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
@darrenaustin darrenaustin deleted the snack_bar_dark_mode branch January 28, 2020 23:22
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

Snack Bars should have a light theme when the overall app has a dark theme

4 participants