Skip to content

Commit

Permalink
Correct FAB color behavior when useMaterail3 is true
Browse files Browse the repository at this point in the history
  • Loading branch information
rydmike committed Jul 6, 2022
1 parent 8ce3b29 commit ca89a3d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ All notable changes to the **FlexColorScheme** package are documented here.

**FIX**

* **TODO** Style fix: Default color of Floating Action Button, when opting in on opinionated
component themes, changed to match M3 default color `primaryContainer`.
* **Style fix**: Default color of Floating Action Button, when opting in on `ThemeData.useMaterail3`
use M3 default color `primaryContainer`, otherwise use `secondary` as default.

* **TODO** Style fix: Default color of highlight color on `NavigationBar` and `NavigationRail`,
when opting in on opinionated component themes, changed to match M3 default color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ class FabToggleChipPopupSettings extends StatelessWidget {
const SizedBox(height: 8),
ColorSchemePopupMenu(
title: const Text('FloatingActionButton color'),
labelForDefault: 'default (secondary)',
labelForDefault: controller.useMaterial3
? 'default (primaryContainer)'
: 'default (secondary)',
index: controller.fabSchemeColor?.index ?? -1,
onChanged: controller.useSubThemes && controller.useFlexColorScheme
? (int index) {
Expand Down
10 changes: 4 additions & 6 deletions lib/src/flex_sub_themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1283,9 +1283,10 @@ class FlexSubThemes {
///
/// All colors in the color scheme are not good choices, but some work well.
///
/// If not defined, or if passed in [colorScheme] is null, then
/// [theme.colorScheme.secondary] will be used via FAB widget's default
/// un-themed color behavior.
/// If not defined, or if passed in `colorScheme` is null, then if
/// `ThemeData.useMaterial3` is false `theme.colorScheme.secondary` will be
/// used, but if `ThemeData.useMaterial3` is true, then
/// `theme.colorScheme.primaryContainer` will be used.
///
/// The foreground color automatically uses the selected background
/// color's contrast color pair in the passed in [colorScheme] property.
Expand Down Expand Up @@ -1905,7 +1906,6 @@ class FlexSubThemes {
/// the effective default styles for undefined inputs become:
///
/// ```
/// ```
/// FCS defaults Flutter defaults
/// useFlutterDefaults false true
/// - background background surface, + onSurface overlay elev 3.
Expand All @@ -1922,8 +1922,6 @@ class FlexSubThemes {
/// [navigationBarMutedUnselectedIcon] and
/// [navigationBarMutedUnselectedLabel] are true respectively, this
/// also applies to undefined color inputs.
///
/// ```
final bool useFlutterDefaults = false,
}) {
// Determine if we can even use default icon styles, only when all are null,
Expand Down

0 comments on commit ca89a3d

Please sign in to comment.