fix: Material you improvements (#60)

This commit is contained in:
Aunali321 2022-09-06 18:07:23 +01:00 committed by Alberto Ponces
parent 27ef74b561
commit 10fbbe845e
3 changed files with 49 additions and 3 deletions

View File

@ -7,6 +7,13 @@ var lightCustomTheme = ThemeData(
seedColor: Colors.blue,
brightness: Brightness.light,
),
navigationBarTheme: NavigationBarThemeData(
labelTextStyle: MaterialStateProperty.all(
const TextStyle(
fontWeight: FontWeight.w500,
),
),
),
textTheme: GoogleFonts.robotoTextTheme(ThemeData.light().textTheme),
);
@ -18,6 +25,13 @@ var darkCustomTheme = ThemeData(
primary: const Color(0xff7792BA),
surface: const Color(0xff0A0D11),
),
navigationBarTheme: NavigationBarThemeData(
labelTextStyle: MaterialStateProperty.all(
const TextStyle(
fontWeight: FontWeight.w500,
),
),
),
canvasColor: const Color(0xff0A0D11),
scaffoldBackgroundColor: const Color(0xff0A0D11),
toggleableActiveColor: const Color(0xff7792BA),

View File

@ -24,12 +24,39 @@ class DynamicThemeBuilder extends StatelessWidget {
builder: (lightColorScheme, darkColorScheme) {
ThemeData lightDynamicTheme = ThemeData(
useMaterial3: true,
canvasColor: lightColorScheme?.background,
navigationBarTheme: NavigationBarThemeData(
backgroundColor: lightColorScheme?.background,
indicatorColor: lightColorScheme?.primary.withAlpha(150),
labelTextStyle: MaterialStateProperty.all(
const TextStyle(
fontWeight: FontWeight.w500,
),
),
),
scaffoldBackgroundColor: lightColorScheme?.background,
colorScheme: lightColorScheme?.harmonized(),
toggleableActiveColor: lightColorScheme?.primary,
textTheme: GoogleFonts.robotoTextTheme(ThemeData.light().textTheme),
);
ThemeData darkDynamicTheme = ThemeData(
useMaterial3: true,
canvasColor: darkColorScheme?.background,
navigationBarTheme: NavigationBarThemeData(
backgroundColor: darkColorScheme?.background,
indicatorColor: darkColorScheme?.primary.withOpacity(0.4),
labelTextStyle: MaterialStateProperty.all(
const TextStyle(
fontWeight: FontWeight.w500,
),
),
iconTheme: MaterialStateProperty.all(
const IconThemeData(
color: Colors.white,
),
),
),
scaffoldBackgroundColor: darkColorScheme?.background,
colorScheme: darkColorScheme?.harmonized(),
toggleableActiveColor: darkColorScheme?.primary,
textTheme: GoogleFonts.robotoTextTheme(ThemeData.dark().textTheme),
@ -42,7 +69,7 @@ class DynamicThemeBuilder extends StatelessWidget {
2: lightDynamicTheme,
3: darkDynamicTheme,
},
fallbackTheme: lightCustomTheme,
fallbackTheme: darkCustomTheme,
),
builder: (context, theme) => MaterialApp(
debugShowCheckedModeBanner: false,

View File

@ -52,13 +52,18 @@ class OptionsFilePicker extends StatelessWidget {
ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.secondary,
Theme.of(context).colorScheme.primary,
),
),
onPressed: () {
// pick files
},
child: const Text('Select File'),
child: Text(
'Select File',
style: TextStyle(
color: Theme.of(context).textTheme.bodyText1?.color,
),
),
),
],
),