Skip to content

Conversation

@darrenaustin
Copy link
Contributor

Followup to #100794.

This adds support for the filled and filled tonal Material Design 3 buttons:

Screen Shot 2022-07-10 at 5 33 28 PM

To create a filled button use the new FilledButton and to create a tonal variant, use FilledButton.tonal:

  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true),
      home: Scaffold(
        appBar: AppBar(title: const Text('FilledButton Sample')),
        body: Center(
          child:  Column(
            children: <Widget>[
              FilledButton(
                onPressed: () {},
                child: const Text('Filled'),
              ),
              FilledButton.tonal(
                onPressed: () {},
                child: Text('Filled tonal'),
              ),
            ]
          ),
          // ...

Fixes: #104357

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 d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos documentation 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 Jul 11, 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.

  _    ___ _____ __  __ 
 | |  / __|_   _|  \/  |
 | |_| (_ | | | | |\/| |
 |____\___| |_| |_|  |_|
                        

Looks great! Minor comments about documentation and token usage

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 however there are many comments from @guidezpl that merit response/changes.

@rydmike
Copy link
Contributor

rydmike commented Aug 12, 2022

This will also close #104357, hope it lands in master soon so it can make it to next stable release.

@rydmike rydmike mentioned this pull request Aug 12, 2022
70 tasks
@darrenaustin
Copy link
Contributor Author

This will also close #104357, hope it lands in master soon so it can make it to next stable release.

Sorry this has taken a while. There is an internal Google naming conflict that we need to resolve before we can land this (as well as I was out for a couple weeks vacation). Hopefully this should land in the next couple of days.

@rydmike
Copy link
Contributor

rydmike commented Aug 24, 2022

No worries @darrenaustin, I suspect this one won't make it to next stable. It looked so ready that I just thought it would be a pity to wait for it another 3-4 months for the next release after the assumed imminent one. However, there are so many other feature gaps and issues with M3 opt-in in Beta 3.3.0-x and even master, that I can't recommend opting in on M3 for Flutter projects yet anyway. This one was rather small from that point of view, since you can compose/configure this style already when needed.

@darrenaustin darrenaustin merged commit 5454bab into flutter:master Aug 25, 2022
@darrenaustin darrenaustin deleted the m3_button_variant branch August 25, 2022 20:16
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 26, 2022
CaseyHillers added a commit that referenced this pull request Aug 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 29, 2022
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. 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.

[Proposal] Add filled buttons as per material 3 guidelines

7 participants