Skip to content

Commit

Permalink
Improve FAB style (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feichtmeier committed Feb 10, 2023
1 parent be7eb1b commit 93d062f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/src/themes/common_themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,15 @@ ProgressIndicatorThemeData _createProgressIndicatorTheme(
);
}

FloatingActionButtonThemeData _getFloatingActionButtonThemeData(
ColorScheme colorScheme,
) =>
FloatingActionButtonThemeData(
backgroundColor: colorScheme.inverseSurface,
foregroundColor: colorScheme.onInverseSurface,
shape: const CircleBorder(),
);

/// Helper function to create a new Yaru light theme
ThemeData createYaruLightTheme({
required Color primaryColor,
Expand Down Expand Up @@ -433,10 +442,7 @@ ThemeData createYaruLightTheme({
checkboxTheme: _getCheckBoxThemeData(colorScheme, Brightness.light),
radioTheme: _getRadioThemeData(colorScheme, Brightness.light),
appBarTheme: _createLightAppBar(colorScheme),
floatingActionButtonTheme: FloatingActionButtonThemeData(
backgroundColor: elevatedButtonColor ?? primaryColor,
foregroundColor: contrastColor(elevatedButtonColor ?? primaryColor),
),
floatingActionButtonTheme: _getFloatingActionButtonThemeData(colorScheme),
bottomNavigationBarTheme: BottomNavigationBarThemeData(
selectedItemColor: colorScheme.primary,
unselectedItemColor: colorScheme.onSurface.withOpacity(0.8),
Expand Down Expand Up @@ -549,10 +555,7 @@ ThemeData createYaruDarkTheme({
radioTheme: _getRadioThemeData(colorScheme, Brightness.dark),
primaryColorDark: primaryColor,
appBarTheme: _createDarkAppBarTheme(colorScheme),
floatingActionButtonTheme: FloatingActionButtonThemeData(
backgroundColor: elevatedButtonColor ?? primaryColor,
foregroundColor: contrastColor(elevatedButtonColor ?? primaryColor),
),
floatingActionButtonTheme: _getFloatingActionButtonThemeData(colorScheme),
bottomNavigationBarTheme: BottomNavigationBarThemeData(
selectedItemColor: colorScheme.primary,
unselectedItemColor: Colors.white.withOpacity(0.8),
Expand Down

0 comments on commit 93d062f

Please sign in to comment.