Changed some formatting issues
This commit is contained in:
@@ -2,40 +2,37 @@ import 'package:flutter/material.dart';
|
|||||||
import 'theme_type.dart';
|
import 'theme_type.dart';
|
||||||
|
|
||||||
class AppThemes {
|
class AppThemes {
|
||||||
static ThemeData getLightTheme(ThemeType type) {
|
static ThemeData getLightTheme(ThemeType type) {
|
||||||
// Define a seed color based on the theme type
|
final Color seedColor;
|
||||||
final Color seedColor;
|
switch (type) {
|
||||||
switch (type) {
|
case ThemeType.green:
|
||||||
case ThemeType.green:
|
seedColor = Colors.green;
|
||||||
seedColor = Colors.green;
|
break;
|
||||||
break;
|
case ThemeType.orange:
|
||||||
case ThemeType.orange:
|
seedColor = Colors.orange;
|
||||||
seedColor = Colors.orange;
|
break;
|
||||||
break;
|
case ThemeType.blue:
|
||||||
case ThemeType.blue:
|
seedColor = Colors.blue;
|
||||||
seedColor = Colors.blue;
|
break;
|
||||||
break;
|
case ThemeType.violet:
|
||||||
case ThemeType.violet:
|
seedColor = Colors.deepPurple;
|
||||||
default:
|
break;
|
||||||
seedColor = Colors.deepPurple;
|
}
|
||||||
break;
|
|
||||||
|
final colorScheme = ColorScheme.fromSeed(
|
||||||
|
seedColor: seedColor,
|
||||||
|
brightness: Brightness.light, // Explicitly set for a light theme
|
||||||
|
);
|
||||||
|
|
||||||
|
return ThemeData.from(
|
||||||
|
colorScheme: colorScheme,
|
||||||
|
useMaterial3: true, // Recommended for modern Flutter apps
|
||||||
|
).copyWith(
|
||||||
|
scaffoldBackgroundColor: Colors.white,
|
||||||
|
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||||
|
backgroundColor: colorScheme.surface,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a ColorScheme from the seed color
|
|
||||||
final colorScheme = ColorScheme.fromSeed(
|
|
||||||
seedColor: seedColor,
|
|
||||||
brightness: Brightness.light, // Explicitly set for a light theme
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create the ThemeData from the ColorScheme
|
|
||||||
return ThemeData.from(
|
|
||||||
colorScheme: colorScheme,
|
|
||||||
useMaterial3: true, // Recommended for modern Flutter apps
|
|
||||||
).copyWith(
|
|
||||||
scaffoldBackgroundColor: Colors.white,
|
|
||||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
|
||||||
backgroundColor: colorScheme.surface,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user