design: Style bottom navigation bar in backgroundcolor
This commit is contained in:
parent
b798b6dd39
commit
ee12843d65
2 changed files with 66 additions and 54 deletions
|
|
@ -60,71 +60,78 @@ abstract class FluffyThemes {
|
||||||
static const Duration animationDuration = Duration(milliseconds: 250);
|
static const Duration animationDuration = Duration(milliseconds: 250);
|
||||||
static const Curve animationCurve = Curves.easeInOut;
|
static const Curve animationCurve = Curves.easeInOut;
|
||||||
|
|
||||||
static ThemeData buildTheme(Brightness brightness, [Color? seed]) =>
|
static ThemeData buildTheme(Brightness brightness, [Color? seed]) {
|
||||||
ThemeData(
|
final colorScheme = ColorScheme.fromSeed(
|
||||||
visualDensity: VisualDensity.standard,
|
brightness: brightness,
|
||||||
useMaterial3: true,
|
seedColor: seed ?? AppConfig.colorSchemeSeed ?? AppConfig.primaryColor,
|
||||||
brightness: brightness,
|
);
|
||||||
colorSchemeSeed: seed ?? AppConfig.colorSchemeSeed,
|
return ThemeData(
|
||||||
textTheme: PlatformInfos.isDesktop || PlatformInfos.isWeb
|
visualDensity: VisualDensity.standard,
|
||||||
? brightness == Brightness.light
|
useMaterial3: true,
|
||||||
? Typography.material2018().black.merge(fallbackTextTheme)
|
brightness: brightness,
|
||||||
: Typography.material2018().white.merge(fallbackTextTheme)
|
colorScheme: colorScheme,
|
||||||
: null,
|
textTheme: PlatformInfos.isDesktop || PlatformInfos.isWeb
|
||||||
snackBarTheme: const SnackBarThemeData(
|
? brightness == Brightness.light
|
||||||
behavior: SnackBarBehavior.floating,
|
? Typography.material2018().black.merge(fallbackTextTheme)
|
||||||
|
: Typography.material2018().white.merge(fallbackTextTheme)
|
||||||
|
: null,
|
||||||
|
snackBarTheme: const SnackBarThemeData(
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
),
|
||||||
|
dividerColor: brightness == Brightness.light
|
||||||
|
? Colors.blueGrey.shade50
|
||||||
|
: Colors.blueGrey.shade900,
|
||||||
|
popupMenuTheme: PopupMenuThemeData(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||||
),
|
),
|
||||||
dividerColor: brightness == Brightness.light
|
),
|
||||||
? Colors.blueGrey.shade50
|
inputDecorationTheme: InputDecorationTheme(
|
||||||
: Colors.blueGrey.shade900,
|
border: UnderlineInputBorder(
|
||||||
popupMenuTheme: PopupMenuThemeData(
|
borderSide: BorderSide.none,
|
||||||
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
||||||
|
),
|
||||||
|
filled: true,
|
||||||
|
),
|
||||||
|
appBarTheme: AppBarTheme(
|
||||||
|
systemOverlayStyle: SystemUiOverlayStyle(
|
||||||
|
statusBarColor: Colors.transparent,
|
||||||
|
statusBarIconBrightness: brightness.reversed,
|
||||||
|
statusBarBrightness: brightness,
|
||||||
|
systemNavigationBarIconBrightness: brightness.reversed,
|
||||||
|
systemNavigationBarColor: colorScheme.background,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
textButtonTheme: TextButtonThemeData(
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
outlinedButtonTheme: OutlinedButtonThemeData(
|
||||||
|
style: OutlinedButton.styleFrom(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
dialogTheme: DialogTheme(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
textStyle: const TextStyle(fontSize: 16),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
inputDecorationTheme: InputDecorationTheme(
|
),
|
||||||
border: UnderlineInputBorder(
|
);
|
||||||
borderSide: BorderSide.none,
|
}
|
||||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
|
||||||
),
|
|
||||||
filled: true,
|
|
||||||
),
|
|
||||||
appBarTheme: AppBarTheme(
|
|
||||||
systemOverlayStyle: SystemUiOverlayStyle(
|
|
||||||
statusBarColor: Colors.transparent,
|
|
||||||
statusBarIconBrightness: brightness.reversed,
|
|
||||||
statusBarBrightness: brightness,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
textButtonTheme: TextButtonThemeData(
|
|
||||||
style: TextButton.styleFrom(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
|
||||||
style: OutlinedButton.styleFrom(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
dialogTheme: DialogTheme(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
textStyle: const TextStyle(fontSize: 16),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension on Brightness {
|
extension on Brightness {
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,12 @@ class ChatListView extends StatelessWidget {
|
||||||
body: ChatListViewBody(controller),
|
body: ChatListViewBody(controller),
|
||||||
bottomNavigationBar: controller.displayNavigationBar
|
bottomNavigationBar: controller.displayNavigationBar
|
||||||
? NavigationBar(
|
? NavigationBar(
|
||||||
|
elevation: 4,
|
||||||
height: 64,
|
height: 64,
|
||||||
|
shadowColor:
|
||||||
|
Theme.of(context).colorScheme.onBackground,
|
||||||
|
surfaceTintColor:
|
||||||
|
Theme.of(context).colorScheme.background,
|
||||||
selectedIndex: controller.selectedIndex,
|
selectedIndex: controller.selectedIndex,
|
||||||
onDestinationSelected:
|
onDestinationSelected:
|
||||||
controller.onDestinationSelected,
|
controller.onDestinationSelected,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue