darkTheme top-level property
Implementation
final ThemeData darkTheme = ThemeData(
brightness: Brightness.dark,
primaryColor: AppColors.darkPrimary,
primaryColorDark: AppColors.darkPrimaryColorDark,
scaffoldBackgroundColor: AppColors.darkScaffoldBackgroundColor,
canvasColor: AppColors.darkSurface,
datePickerTheme: const DatePickerThemeData(
backgroundColor: AppColors.darkSurface,
/* // todayBorder: const BorderSide(color: Colors.blue, width: 1),
todayBorder: WidgetStateBorderSide.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return BorderSide.none; // No border when today is selected
}
return const BorderSide(color: AppColors.blue, width: 1); // Show border when another day is selected
}),
todayBackgroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.selected)) {
return AppColors.blue; // Selected today background color
}
return Colors.transparent; // Default for today
}),
todayForegroundColor: const MaterialStatePropertyAll(Colors.blue),
dayBackgroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.selected)) {
return AppColors.blue;
}
return Colors.transparent;
})*/
),
chipTheme: const ChipThemeData(
shape: RoundedRectangleBorder(
side: BorderSide(
color: Colors.transparent,
width: 0,
),
borderRadius: BorderRadius.all(RadiusUtils.extraLargeRadius),
),
backgroundColor: AppColors.blue,
deleteIconColor: Colors.white),
drawerTheme: const DrawerThemeData(
surfaceTintColor: AppColors.darkDrawerBackgroundColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
),
backgroundColor: AppColors.darkDrawerBackgroundColor,
),
tabBarTheme: TabBarThemeData(
indicatorColor: AppColors.blue,
unselectedLabelStyle: TextStyles.tabStyle(textColor: Colors.grey),
labelStyle: TextStyles.tabStyle(textColor: Colors.white),
),
appBarTheme: AppBarTheme(
color: AppColors.darkAppBarBackground,
elevation: 2.0,
shadowColor: Colors.black,
iconTheme: const IconThemeData(color: AppColors.darkIconThemeColor),
titleTextStyle: TextStyle(
color: AppColors.darkTitleTextColor, fontSize: FontSizes.extraLarge),
),
hoverColor: Colors.white12,
popupMenuTheme: PopupMenuThemeData(
textStyle: TextStyle(
fontSize: FontSizes.medium, // Example font size
),
color: Colors.black),
textTheme: TextTheme(
bodyLarge: const TextStyle(color: Colors.white),
bodyMedium: const TextStyle(color: Colors.white70),
titleLarge: const TextStyle(color: Colors.white),
labelLarge: TextStyle(fontSize: FontSizes.large),
labelMedium: TextStyle(fontSize: FontSizes.medium),
labelSmall: TextStyle(fontSize: FontSizes.normal),
),
buttonTheme: const ButtonThemeData(
buttonColor: AppColors.darkButtonColor,
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
textStyle: const TextStyle(color: Colors.black),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), // <-- Radius
),
)),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: AppColors.darkButtonColor,
textStyle: const TextStyle(color: Colors.white),
),
),
progressIndicatorTheme:
const ProgressIndicatorThemeData(color: AppColors.darkButtonColor),
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: AppColors.darkPrimary,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
),
),
),
cardTheme: CardThemeData(
color: AppColors.darkCardColor,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
),
textSelectionTheme: const TextSelectionThemeData(cursorColor: Colors.white),
inputDecorationTheme: InputDecorationTheme(
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: const BorderSide(color: Colors.grey)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: const BorderSide(color: Colors.grey))),
checkboxTheme: CheckboxThemeData(
side: WidgetStateBorderSide.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return const BorderSide(width: 0, color: Colors.transparent);
}
return const BorderSide(width: 1, color: Colors.white);
}),
checkColor: WidgetStateProperty.all(Colors.white),
overlayColor: WidgetStateProperty.all(Colors.transparent),
fillColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return Colors.grey;
}
if (states.contains(WidgetState.selected)) {
return Colors.blue;
}
return Colors.transparent;
})),
radioTheme: RadioThemeData(fillColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return Colors.blue;
}
return Colors.grey;
})),
);