loris/lib/themes/themes.dart

144 lines
4.2 KiB
Dart
Raw Normal View History

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-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-07-02 22:03:10 +00:00
final available = [color_dracula.theme];
ThemeData getTheme(CustomColors colors) {
return ThemeData(
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,
),
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,
),
),
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)),
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-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);
}