Skip to content

Conversation

darrenaustin
Copy link
Contributor

@darrenaustin darrenaustin commented Dec 1, 2021

Part of: #91605

Updated the FloatingActionButton widget with support for Material Design 3.

FAB

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

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

This also adds a new iconSize parameter to the FloatingActionButtonThemeData that allows apps to configure the size used by the icon inside the FAB.

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. labels Dec 1, 2021
@google-cla google-cla bot added the cla: yes label Dec 1, 2021
@flutter-dashboard flutter-dashboard bot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Jan 7, 2022
@darrenaustin darrenaustin marked this pull request as ready for review January 7, 2022 20:32
@@ -171,6 +171,7 @@ void main() {
testWidgets('Floating Action Button elevation when highlighted - effect', (WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeData.light().copyWith(useMaterial3: true),
Copy link
Member

Choose a reason for hiding this comment

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

I think it'd be easy to miss one of these. Consider creating a material 3 theme in setUp or setUpAll

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.

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

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

@skia-gold
Copy link

Gold has detected about 3 new digest(s) on patchset 4.
View them at https://flutter-gold.skia.org/cl/github/94486

@skia-gold
Copy link

Gold has detected about 3 new digest(s) on patchset 5.
View them at https://flutter-gold.skia.org/cl/github/94486

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

@fluttergithubbot fluttergithubbot merged commit 2ab2ca2 into flutter:master Jan 13, 2022
@darrenaustin darrenaustin deleted the m3_fab branch January 14, 2022 04:21
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jan 18, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jan 18, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jan 18, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 4, 2022
@guidezpl guidezpl changed the title Migrate FloatingActionButton to Material 3 Migrate FloatingActionButton to Material 3 May 24, 2022
@guidezpl guidezpl linked an issue May 26, 2022 that may be closed by this pull request
@bernaferrari
Copy link
Contributor

Maybe you could deprecate this now that _FloatingActionButtonType.small / floatingActionButtonTheme.smallSizeConstraintsare a reality.
image

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate FloatingActionButton to Material 3
7 participants