Skip to content

Conversation

@darrenaustin
Copy link
Contributor

@darrenaustin darrenaustin commented Jul 17, 2019

Description

Changed the Flutter Gallery's 'Dark Theme' toggle button into a drop down menu that uses the new ThemeMode settings to control which them is selected:

GalleryThemeMode

If this is set to 'System Default' the Gallery will use either its light or dark theme based on the underlying platform's dark/light mode setting. If it is set to 'Light' then it will always use the light theme regardless of system settings, and if it is 'Dark' then it will always use the dark theme. It will default to 'System Default'.

See MaterialApp.themeMode documentation for more details.

Related Issues

PR that introduced ThemeMode: #35499

Tests

I updated the smoke test and unit tests for the options page to match the new layout.

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.

use the system's dark/light mode setting by default.
@darrenaustin darrenaustin added the customer: gallery Relating to flutter/gallery repository. Please transfer non-framework issues there. label Jul 17, 2019
@darrenaustin darrenaustin requested a review from HansMuller July 17, 2019 22:08
@fluttergithubbot fluttergithubbot added d: examples Sample code and demos c: contributor-productivity Team-specific productivity, code health, technical debt. labels Jul 17, 2019
@darrenaustin darrenaustin changed the title Added ThemeMode support to the Flutter Gallery WIP Added ThemeMode support to the Flutter Gallery Jul 18, 2019
Updated the tests to the changes to the options page.
@darrenaustin darrenaustin changed the title WIP Added ThemeMode support to the Flutter Gallery Added ThemeMode support to the Flutter Gallery Jul 18, 2019
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

'kLightGalleryTheme',
'ThemeData.light()',
// TODO(hansmuller): add 'kDarkGalleryTheme', 'ThemeData.dark()', see 22044
// TODO(hansmuller): add 'kDarkGalleryTheme', 'ThemeData.dark()', see #22044
Copy link
Contributor

Choose a reason for hiding this comment

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

This issue (#22044) has been fixed; maybe add the dark theme?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did give the dark theme a go here, but there were still some tests that failed and I didn't have the chance to dive into them.

@darrenaustin darrenaustin merged commit b5fff3b into flutter:master Jul 22, 2019
@darrenaustin darrenaustin deleted the gallery_theme_mode branch July 22, 2019 18:07
johnsonmh pushed a commit to johnsonmh/flutter that referenced this pull request Jul 30, 2019
Made the Flutter Gallery use the new ThemeMode property so that it can
use the system's dark/light mode setting by default.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. customer: gallery Relating to flutter/gallery repository. Please transfer non-framework issues there. d: examples Sample code and demos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants