Skip to content

Conversation

@darrenaustin
Copy link
Contributor

@darrenaustin darrenaustin commented Apr 14, 2022

Part of: #91605

Updated the common buttons: ElevatedButton, OutlinedButton, and TextButton with support for Material Design 3.

AppBarM3_1649919991939_0AppBarM3Dark_1649920013722_0

In order to use the common buttons with the new Material 3 defaults, turn on the useMaterial3 flag in the ThemeData:

  return MaterialApp(
    theme: ThemeData(useMaterial3: true),
    // ...
  );

In addition to the new look, the AppBar and AppBarTheme now support surfaceTintColor and scrolledUnderElevation properties to support the new elevation visuals needed for Material 3.

By default in Material 3, the app bar will no longer have a drop shadow, but instead will show changes in elevation by applying a surface tint overlay with and opacity based on the elevation on top of the background color. In addition the default elevation is 0 when there is nothing under the app bar. This changes to 3 when something is scrolled beneath the app bar. Example of this behaviour:

AppBarScrollUnder

Fixes: #92093

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Apr 14, 2022
Copy link
Member

@guidezpl guidezpl left a comment

Choose a reason for hiding this comment

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

LGTM! Though, there's no mention of the four types of app bar, is that something to add in a the future PR containing the examples?

@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #101884 at sha 8d8da46b55a41a97703b6245788b931c716f47ea

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Apr 15, 2022
@darrenaustin darrenaustin requested a review from Piinks April 26, 2022 23:27
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

@darrenaustin darrenaustin merged commit 14a9b4a into flutter:master Apr 27, 2022
@darrenaustin darrenaustin deleted the m3_app_bar branch April 27, 2022 19:04
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Apr 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Apr 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Apr 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Apr 28, 2022
egramond pushed a commit to egramond/flutter that referenced this pull request May 5, 2022
muditatandon pushed a commit to muditatandon/flutter that referenced this pull request May 5, 2022
muditatandon added a commit that referenced this pull request May 5, 2022
…103101)

* Add the new hash

* [flutter.js] Wait for reg.update, then activate sw (if not active yet). (#101464)

* Avoid scheduling a forced frame when there is no child to the renderView (#102556)

* Migrate AppBar to Material 3 (#101884)

* Keeping the super parameters

* Fixing semi-colon issue

Co-authored-by: David Iglesias <ditman@gmail.com>
Co-authored-by: Dan Field <dnfield@google.com>
Co-authored-by: Darren Austin <darrenaustin@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update AppBar to support Material 3

3 participants