fixes bugs and re add checkboxes theme

This commit is contained in:
ashrafzarkanisala
2024-08-29 12:55:37 +03:00
parent 5f8957c9c1
commit 95b1e2c932
15 changed files with 133 additions and 45 deletions

View File

@ -15,7 +15,8 @@ Future<void> main() async {
initialSetup();
String checkToken = await AuthBloc.getTokenAndValidate();
GoRouter router = GoRouter(
initialLocation: checkToken == 'Success' ? RoutesConst.home : RoutesConst.auth,
initialLocation:
checkToken == 'Success' ? RoutesConst.home : RoutesConst.auth,
routes: AppRoutes.getRoutes(),
);
runApp(MyApp(
@ -54,7 +55,9 @@ class MyApp extends StatelessWidget {
fontFamily: 'Aftika',
textTheme: const TextTheme(
bodySmall: TextStyle(
fontSize: 13, color: ColorsManager.whiteColors, fontWeight: FontWeight.bold),
fontSize: 13,
color: ColorsManager.whiteColors,
fontWeight: FontWeight.bold),
bodyMedium: TextStyle(color: Colors.black87, fontSize: 14),
bodyLarge: TextStyle(fontSize: 16, color: Colors.white),
headlineSmall: TextStyle(color: Colors.black87, fontSize: 18),
@ -65,7 +68,40 @@ class MyApp extends StatelessWidget {
fontWeight: FontWeight.bold,
),
),
colorScheme: ColorScheme.fromSeed(
seedColor: ColorsManager.blueColor,
primary: ColorsManager.blueColor,
onSurface: Colors.grey.shade400,
),
switchTheme: SwitchThemeData(
thumbColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return ColorsManager.blueColor;
}
return ColorsManager.whiteColors;
}),
trackColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return ColorsManager.blueColor.withOpacity(0.5);
}
return ColorsManager.whiteColors;
}),
),
checkboxTheme: CheckboxThemeData(
fillColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return ColorsManager.blueColor;
}
return Colors.grey.shade200;
}),
checkColor: WidgetStateProperty.all(Colors.white),
side: const BorderSide(color: ColorsManager.whiteColors),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4),
),
),
),
routeInformationProvider: router.routeInformationProvider,
routerDelegate: router.routerDelegate,
routeInformationParser: router.routeInformationParser,