design: Style bottom navigation bar in backgroundcolor

pull/465/head
krille-chan 2 years ago
parent b798b6dd39
commit ee12843d65
No known key found for this signature in database

@ -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,
shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
),
), ),
inputDecorationTheme: InputDecorationTheme( filled: true,
border: UnderlineInputBorder( ),
borderSide: BorderSide.none, appBarTheme: AppBarTheme(
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2), systemOverlayStyle: SystemUiOverlayStyle(
), statusBarColor: Colors.transparent,
filled: true, statusBarIconBrightness: brightness.reversed,
), statusBarBrightness: brightness,
appBarTheme: AppBarTheme( systemNavigationBarIconBrightness: brightness.reversed,
systemOverlayStyle: SystemUiOverlayStyle( systemNavigationBarColor: colorScheme.background,
statusBarColor: Colors.transparent,
statusBarIconBrightness: brightness.reversed,
statusBarBrightness: brightness,
),
), ),
textButtonTheme: TextButtonThemeData( ),
style: TextButton.styleFrom( textButtonTheme: TextButtonThemeData(
shape: RoundedRectangleBorder( style: TextButton.styleFrom(
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2), shape: RoundedRectangleBorder(
), borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
),
),
outlinedButtonTheme: OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
),
), ),
), ),
dialogTheme: DialogTheme( ),
outlinedButtonTheme: OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2), borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
), ),
), ),
elevatedButtonTheme: ElevatedButtonThemeData( ),
style: ElevatedButton.styleFrom( dialogTheme: DialogTheme(
padding: const EdgeInsets.all(16), shape: RoundedRectangleBorder(
textStyle: const TextStyle(fontSize: 16), borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
shape: RoundedRectangleBorder( ),
borderRadius: BorderRadius.circular(AppConfig.borderRadius), ),
), 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…
Cancel
Save