From a8c16a7059eb7d02ff832acc215211941190d987 Mon Sep 17 00:00:00 2001 From: Taha Tesser Date: Sat, 30 Apr 2022 00:09:07 +0300 Subject: [PATCH] Update FAB M3 token template class to new naming scheme and fix a typo in `card.dart` (#102654) --- dev/tools/gen_defaults/lib/fab_template.dart | 4 ++-- packages/flutter/lib/src/material/card.dart | 4 ++-- .../flutter/lib/src/material/floating_action_button.dart | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dev/tools/gen_defaults/lib/fab_template.dart b/dev/tools/gen_defaults/lib/fab_template.dart index 91bd458e76..2433c3335a 100644 --- a/dev/tools/gen_defaults/lib/fab_template.dart +++ b/dev/tools/gen_defaults/lib/fab_template.dart @@ -13,8 +13,8 @@ class FABTemplate extends TokenTemplate { @override String generate() => ''' // Generated version ${tokens["version"]} -class _M3Defaults extends FloatingActionButtonThemeData { - _M3Defaults(this.context, this.type, this.hasChild) +class _TokenDefaultsM3 extends FloatingActionButtonThemeData { + _TokenDefaultsM3(this.context, this.type, this.hasChild) : super( elevation: ${elevation("md.comp.fab.primary.container")}, focusElevation: ${elevation("md.comp.fab.primary.focus.container")}, diff --git a/packages/flutter/lib/src/material/card.dart b/packages/flutter/lib/src/material/card.dart index ae4cea828c..38fad2d5c1 100644 --- a/packages/flutter/lib/src/material/card.dart +++ b/packages/flutter/lib/src/material/card.dart @@ -90,8 +90,8 @@ class Card extends StatelessWidget { /// The color used as an overlay on [color] to indicate elevation. /// - /// If this is null, no overlay will be applied. Otherwise the this - /// color will be composited on top of [color] with an opacity related + /// If this is null, no overlay will be applied. Otherwise this color + /// will be composited on top of [color] with an opacity related /// to [elevation] and used to paint the background of the card. /// /// The default is null. diff --git a/packages/flutter/lib/src/material/floating_action_button.dart b/packages/flutter/lib/src/material/floating_action_button.dart index 021e7c5809..1c0a6683a3 100644 --- a/packages/flutter/lib/src/material/floating_action_button.dart +++ b/packages/flutter/lib/src/material/floating_action_button.dart @@ -509,7 +509,7 @@ class FloatingActionButton extends StatelessWidget { final ThemeData theme = Theme.of(context); final FloatingActionButtonThemeData floatingActionButtonTheme = theme.floatingActionButtonTheme; final FloatingActionButtonThemeData defaults = theme.useMaterial3 - ? _M3Defaults(context, _floatingActionButtonType, child != null) + ? _TokenDefaultsM3(context, _floatingActionButtonType, child != null) : _M2Defaults(context, _floatingActionButtonType, child != null); final Color foregroundColor = this.foregroundColor @@ -783,8 +783,8 @@ class _M2Defaults extends FloatingActionButtonThemeData { // database by the script dev/tools/gen_defaults/bin/gen_defaults.dart. // Generated version v0_92 -class _M3Defaults extends FloatingActionButtonThemeData { - _M3Defaults(this.context, this.type, this.hasChild) +class _TokenDefaultsM3 extends FloatingActionButtonThemeData { + _TokenDefaultsM3(this.context, this.type, this.hasChild) : super( elevation: 6.0, focusElevation: 6.0,