[imp]: Add NavigationRail themes and update Florid layout logic
This commit is contained in:
@@ -55,7 +55,9 @@ class _FloridAppState extends State<FloridApp> {
|
||||
return Scaffold(
|
||||
backgroundColor: MediaQuery.sizeOf(context).width < Responsive.largeWidth
|
||||
? Theme.of(context).colorScheme.surface
|
||||
: Theme.of(context).colorScheme.surfaceContainer,
|
||||
: context.watch<SettingsProvider>().themeStyle == ThemeStyle.florid
|
||||
? Theme.of(context).colorScheme.surfaceContainer
|
||||
: Theme.of(context).colorScheme.surface,
|
||||
body: Consumer2<AppProvider, SettingsProvider>(
|
||||
builder: (context, appProvider, settings, child) {
|
||||
return FutureBuilder<List<FDroidApp>>(
|
||||
@@ -170,7 +172,8 @@ class _FloridAppState extends State<FloridApp> {
|
||||
child: SafeArea(
|
||||
child: Material(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
elevation: 1,
|
||||
child: IndexedStack(
|
||||
index: _currentIndex,
|
||||
children: _screens,
|
||||
@@ -239,7 +242,8 @@ class _FloridAppState extends State<FloridApp> {
|
||||
bottomNavigationBar: Visibility(
|
||||
visible:
|
||||
Provider.of<SettingsProvider>(context).themeStyle ==
|
||||
ThemeStyle.material,
|
||||
ThemeStyle.material &&
|
||||
MediaQuery.sizeOf(context).width < Responsive.largeWidth,
|
||||
child: Consumer2<AppProvider, SettingsProvider>(
|
||||
builder: (context, appProvider, settings, child) {
|
||||
return FutureBuilder<List<FDroidApp>>(
|
||||
|
||||
@@ -33,6 +33,37 @@ class AppThemes {
|
||||
),
|
||||
filled: true,
|
||||
),
|
||||
navigationRailTheme: NavigationRailThemeData(
|
||||
backgroundColor: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.light,
|
||||
).surface,
|
||||
selectedIconTheme: IconThemeData(
|
||||
color: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.light,
|
||||
).onPrimaryContainer,
|
||||
),
|
||||
labelType: NavigationRailLabelType.all,
|
||||
unselectedIconTheme: IconThemeData(
|
||||
color: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.light,
|
||||
).onSurface,
|
||||
),
|
||||
selectedLabelTextStyle: TextStyle(
|
||||
color: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.light,
|
||||
).onPrimaryContainer,
|
||||
),
|
||||
unselectedLabelTextStyle: TextStyle(
|
||||
color: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.light,
|
||||
).onSurface,
|
||||
),
|
||||
),
|
||||
progressIndicatorTheme: ProgressIndicatorThemeData(year2023: false),
|
||||
);
|
||||
}
|
||||
@@ -66,6 +97,37 @@ class AppThemes {
|
||||
),
|
||||
filled: true,
|
||||
),
|
||||
navigationRailTheme: NavigationRailThemeData(
|
||||
backgroundColor: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.dark,
|
||||
).surface,
|
||||
selectedIconTheme: IconThemeData(
|
||||
color: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.dark,
|
||||
).onPrimaryContainer,
|
||||
),
|
||||
labelType: NavigationRailLabelType.all,
|
||||
unselectedIconTheme: IconThemeData(
|
||||
color: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.dark,
|
||||
).onSurface,
|
||||
),
|
||||
selectedLabelTextStyle: TextStyle(
|
||||
color: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.dark,
|
||||
).onPrimaryContainer,
|
||||
),
|
||||
unselectedLabelTextStyle: TextStyle(
|
||||
color: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.dark,
|
||||
).onSurface,
|
||||
),
|
||||
),
|
||||
progressIndicatorTheme: ProgressIndicatorThemeData(year2023: false),
|
||||
);
|
||||
}
|
||||
@@ -506,6 +568,38 @@ class AppThemes {
|
||||
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
|
||||
elevation: 0,
|
||||
),
|
||||
navigationRailTheme: NavigationRailThemeData(
|
||||
backgroundColor: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.dark,
|
||||
).surfaceContainer,
|
||||
groupAlignment: 0.0,
|
||||
selectedIconTheme: IconThemeData(
|
||||
color: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.dark,
|
||||
).onPrimaryContainer,
|
||||
),
|
||||
labelType: NavigationRailLabelType.selected,
|
||||
unselectedIconTheme: IconThemeData(
|
||||
color: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.dark,
|
||||
).onSurface,
|
||||
),
|
||||
selectedLabelTextStyle: TextStyle(
|
||||
color: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.dark,
|
||||
).onPrimaryContainer,
|
||||
),
|
||||
unselectedLabelTextStyle: TextStyle(
|
||||
color: ColorScheme.fromSeed(
|
||||
seedColor: kAppColor,
|
||||
brightness: Brightness.dark,
|
||||
).onSurface,
|
||||
),
|
||||
),
|
||||
popupMenuTheme: PopupMenuThemeData(
|
||||
elevation: 1,
|
||||
color: ColorScheme.fromSeed(
|
||||
|
||||
Reference in New Issue
Block a user