2022-07-02 17:32:44 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-07-02 22:03:10 +00:00
|
|
|
import 'dracula.dart' as color_dracula;
|
2022-09-02 21:19:25 +00:00
|
|
|
import 'tess.dart' as color_tess;
|
|
|
|
import 'adwaita.dart' as color_adwaita;
|
2022-09-02 21:47:22 +00:00
|
|
|
import 'gruvbox.dart' as color_gruvbox;
|
2022-09-05 17:01:04 +00:00
|
|
|
import 'fourth_website.dart' as color_fourth;
|
2022-07-02 17:32:44 +00:00
|
|
|
|
2022-08-12 19:30:58 +00:00
|
|
|
// color schemes to pick from can be added here
|
|
|
|
// there is a class to create these
|
2022-09-02 21:19:25 +00:00
|
|
|
final available = [
|
|
|
|
color_dracula.theme,
|
|
|
|
color_adwaita.themeDark,
|
|
|
|
color_adwaita.themeLight,
|
|
|
|
color_tess.theme,
|
2022-09-02 21:47:22 +00:00
|
|
|
color_gruvbox.themeDark,
|
|
|
|
color_gruvbox.themeLight,
|
2022-09-05 17:01:04 +00:00
|
|
|
color_fourth.theme,
|
2022-09-02 21:19:25 +00:00
|
|
|
];
|
|
|
|
|
2022-07-02 22:03:10 +00:00
|
|
|
ThemeData getTheme(CustomColors colors) {
|
|
|
|
return ThemeData(
|
2022-08-29 21:16:13 +00:00
|
|
|
floatingActionButtonTheme: const FloatingActionButtonThemeData(
|
|
|
|
elevation: 0,
|
|
|
|
enableFeedback: false,
|
|
|
|
hoverElevation: 24,
|
|
|
|
),
|
2022-08-12 18:26:38 +00:00
|
|
|
fontFamily: 'Atkinson',
|
|
|
|
textTheme: TextTheme(
|
|
|
|
bodyLarge: TextStyle(
|
|
|
|
color: colors.colorScheme.onSurface,
|
|
|
|
fontSize: 24,
|
|
|
|
),
|
|
|
|
bodyMedium: TextStyle(
|
|
|
|
color: colors.colorScheme.onSurface,
|
|
|
|
fontSize: 18,
|
|
|
|
),
|
|
|
|
bodySmall: TextStyle(
|
2022-08-12 19:30:58 +00:00
|
|
|
color: colors.colorScheme.secondary,
|
2022-08-26 22:29:36 +00:00
|
|
|
fontSize: 18,
|
2022-08-12 18:26:38 +00:00
|
|
|
),
|
|
|
|
displayLarge: TextStyle(
|
|
|
|
color: colors.colorScheme.onSurface,
|
|
|
|
fontSize: 42,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
),
|
|
|
|
displayMedium: TextStyle(
|
|
|
|
color: colors.colorScheme.onSurface,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
fontSize: 36,
|
|
|
|
),
|
|
|
|
displaySmall: TextStyle(
|
|
|
|
color: colors.colorScheme.onSurface,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
fontSize: 24,
|
|
|
|
),
|
|
|
|
headlineLarge: TextStyle(
|
|
|
|
color: colors.colorScheme.onSurface,
|
|
|
|
fontSize: 42,
|
|
|
|
),
|
|
|
|
headlineMedium: TextStyle(
|
|
|
|
color: colors.colorScheme.onSurface,
|
|
|
|
fontSize: 36,
|
|
|
|
),
|
|
|
|
headlineSmall: TextStyle(
|
|
|
|
color: colors.colorScheme.onSurface,
|
|
|
|
fontSize: 24,
|
|
|
|
),
|
|
|
|
),
|
2022-08-12 19:30:58 +00:00
|
|
|
iconTheme: IconThemeData(
|
2022-08-27 22:29:17 +00:00
|
|
|
size: 24,
|
2022-08-12 19:30:58 +00:00
|
|
|
color: colors.colorScheme.onSurface,
|
|
|
|
),
|
2022-09-05 19:40:56 +00:00
|
|
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
|
|
style: ButtonStyle(
|
|
|
|
textStyle: MaterialStateProperty.all(
|
|
|
|
const TextStyle(fontSize: 18),
|
|
|
|
),
|
|
|
|
)),
|
2022-08-12 19:30:58 +00:00
|
|
|
outlinedButtonTheme: OutlinedButtonThemeData(
|
|
|
|
style: ButtonStyle(
|
|
|
|
backgroundColor: MaterialStateProperty.all(
|
|
|
|
colors.colorScheme.primary,
|
|
|
|
),
|
|
|
|
foregroundColor: MaterialStateProperty.all(
|
|
|
|
colors.colorScheme.onPrimary,
|
|
|
|
),
|
|
|
|
textStyle: MaterialStateProperty.all(
|
|
|
|
const TextStyle(
|
|
|
|
fontSize: 18,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
2022-08-12 18:26:38 +00:00
|
|
|
textButtonTheme: TextButtonThemeData(
|
|
|
|
style: ButtonStyle(
|
|
|
|
textStyle: MaterialStateProperty.all(
|
|
|
|
const TextStyle(fontSize: 18),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
popupMenuTheme: PopupMenuThemeData(
|
|
|
|
color: colors.colorScheme.background,
|
|
|
|
textStyle: TextStyle(
|
|
|
|
color: colors.colorScheme.onBackground,
|
|
|
|
),
|
|
|
|
),
|
2022-07-02 22:03:10 +00:00
|
|
|
scaffoldBackgroundColor: colors.colorScheme.background,
|
|
|
|
bottomAppBarColor: colors.colorScheme.background,
|
|
|
|
hintColor: colors.hintColor,
|
|
|
|
colorScheme: colors.colorScheme,
|
|
|
|
errorColor: colors.colorScheme.error,
|
|
|
|
bottomAppBarTheme: BottomAppBarTheme(
|
|
|
|
color: colors.colorScheme.surface,
|
|
|
|
shape: const CircularNotchedRectangle(),
|
|
|
|
elevation: 0,
|
|
|
|
),
|
2022-08-12 18:26:38 +00:00
|
|
|
navigationBarTheme: NavigationBarThemeData(
|
2022-08-12 19:30:58 +00:00
|
|
|
labelTextStyle: MaterialStateProperty.all(
|
|
|
|
TextStyle(
|
|
|
|
color: colors.colorScheme.onSurface,
|
|
|
|
fontSize: 14,
|
|
|
|
),
|
|
|
|
),
|
2022-07-02 22:03:10 +00:00
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
|
|
|
|
indicatorColor: Colors.transparent,
|
|
|
|
elevation: 0,
|
|
|
|
height: 64,
|
|
|
|
),
|
2022-08-12 19:30:58 +00:00
|
|
|
scrollbarTheme: ScrollbarThemeData(
|
|
|
|
thumbColor: MaterialStateProperty.all(colors.hintColor),
|
|
|
|
),
|
2022-08-12 22:28:00 +00:00
|
|
|
sliderTheme: SliderThemeData(
|
|
|
|
valueIndicatorColor: colors.colorScheme.primary,
|
|
|
|
valueIndicatorTextStyle: TextStyle(
|
|
|
|
color: colors.colorScheme.onPrimary,
|
|
|
|
fontSize: 18,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
),
|
|
|
|
),
|
2022-08-14 08:59:47 +00:00
|
|
|
tooltipTheme: TooltipThemeData(
|
|
|
|
textStyle: TextStyle(
|
|
|
|
color: colors.colorScheme.onPrimary,
|
|
|
|
fontSize: 18,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
),
|
|
|
|
decoration: BoxDecoration(
|
2022-08-26 22:29:36 +00:00
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
2022-08-14 08:59:47 +00:00
|
|
|
color: colors.colorScheme.primary,
|
|
|
|
),
|
|
|
|
),
|
2022-08-15 13:08:37 +00:00
|
|
|
canvasColor: colors.colorScheme.surface,
|
|
|
|
dialogBackgroundColor: colors.colorScheme.surface,
|
|
|
|
selectedRowColor: colors.colorScheme.background,
|
|
|
|
textSelectionTheme:
|
|
|
|
TextSelectionThemeData(selectionColor: colors.hintColor),
|
2022-08-27 22:29:17 +00:00
|
|
|
primaryIconTheme: const IconThemeData(size: 24),
|
2022-08-29 21:16:13 +00:00
|
|
|
hoverColor: colors.colorScheme.background,
|
|
|
|
shadowColor: colors.colorScheme.surface,
|
|
|
|
focusColor: colors.hintColor,
|
|
|
|
indicatorColor: colors.hintColor,
|
|
|
|
disabledColor: colors.hintColor,
|
|
|
|
unselectedWidgetColor: colors.hintColor,
|
|
|
|
toggleableActiveColor: colors.colorScheme.primary,
|
|
|
|
splashColor: colors.colorScheme.onSurface,
|
|
|
|
highlightColor: colors.hintColor,
|
|
|
|
inputDecorationTheme: InputDecorationTheme(
|
2022-09-02 21:19:25 +00:00
|
|
|
helperStyle: TextStyle(
|
|
|
|
color: colors.hintColor,
|
|
|
|
),
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: colors.hintColor,
|
|
|
|
),
|
2022-08-29 21:16:13 +00:00
|
|
|
fillColor: colors.colorScheme.background,
|
|
|
|
enabledBorder: UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide(
|
|
|
|
color: colors.hintColor,
|
|
|
|
width: 2,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
2022-09-05 17:01:04 +00:00
|
|
|
progressIndicatorTheme: ProgressIndicatorThemeData(
|
|
|
|
color: colors.colorScheme.primary,
|
|
|
|
refreshBackgroundColor: colors.hintColor,
|
|
|
|
linearTrackColor: colors.hintColor,
|
|
|
|
circularTrackColor: colors.hintColor,
|
|
|
|
),
|
2022-07-02 22:03:10 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
class CustomColors {
|
|
|
|
late String name;
|
|
|
|
late Color hintColor;
|
|
|
|
late ColorScheme colorScheme;
|
|
|
|
CustomColors(this.name, this.hintColor, this.colorScheme);
|
|
|
|
}
|