Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Migrate common buttons to Material 3 #100794

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 11 commits into from
Apr 9, 2022
Merged

Migrate common buttons to Material 3 #100794

merged 11 commits into from
Apr 9, 2022

Conversation

darrenaustin
Copy link
Contributor

@darrenaustin darrenaustin commented Mar 25, 2022

Part of: #91605

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

M3 Buttons

M3 Buttons Dark

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),
    // ...
  );

Also, if you use ElevatedButton.styleFrom please read the documentation about color role changes in M3 that you may need to account for.

Fixes: #99022
Fixes: #99884

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 a: text input Entering text in a text field or keyboard related problems 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 Mar 25, 2022
@darrenaustin darrenaustin requested review from HansMuller and guidezpl and removed request for HansMuller March 25, 2022 20:12
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.

This is looking good. Just has one basic question...

@flutter-dashboard flutter-dashboard bot added d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos documentation labels Mar 28, 2022
Copy link
Contributor

@clocksmith clocksmith left a comment

Choose a reason for hiding this comment

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

Add test for conditional splashFactory?

something like: https://github.com/flutter/flutter/pull/101046/files

@darrenaustin
Copy link
Contributor Author

Add test for conditional splashFactory?

something like: https://github.com/flutter/flutter/pull/101046/files

Yeah, I need to add a bunch of tests here. Will do so after I figure out a cleaner solution for the styleFrom issues.

Copy link

@dimstr dimstr left a comment

Choose a reason for hiding this comment

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

That's very beautiful.

@darrenaustin darrenaustin requested a review from HansMuller April 7, 2022 00:51
@darrenaustin darrenaustin requested a review from clocksmith April 7, 2022 00:51
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 c14ca6d into flutter:master Apr 9, 2022
@darrenaustin darrenaustin deleted the m3_buttons branch April 9, 2022 00:03
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Apr 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 9, 2022
@itsjustkevin itsjustkevin added cp: review Cherry-picks in the review queue cp: approved Approved cherry-pick request labels Apr 15, 2022
CaseyHillers pushed a commit to CaseyHillers/flutter that referenced this pull request Apr 20, 2022
CaseyHillers pushed a commit that referenced this pull request Apr 20, 2022
…102193)

* Ensure that the engine frame callbacks are installed if the first scheduled frame is a forced frame (#101544)

See #98419

* Migrate common buttons to Material 3 (#100794)

* Always finish the timeline event logged by Element.inflateWidget (#101794)

* 'Create candidate branch version flutter-2.13-candidate.0 for beta'

* 'Update Engine revision to 24a02fa5ee681840cdc842c22f4cb4bdd5ec3115 for beta release 2.13.0-0.2.pre'

* Update release-candidate-branch.version

Co-authored-by: Jason Simmons <[email protected]>
Co-authored-by: Darren Austin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems c: contributor-productivity Team-specific productivity, code health, technical debt. cp: approved Approved cherry-pick request cp: review Cherry-picks in the review queue d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos 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.

New buttons should use InkSparkle for splashFactory when useMaterial3 is true Update common buttons to support Material 3
6 participants