136 lines
3.8 KiB
Dart
136 lines
3.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'dracula.dart' as color_dracula;
|
|
|
|
// color schemes to pick from can be added here
|
|
// there is a class to create these
|
|
final available = [color_dracula.theme];
|
|
ThemeData getTheme(CustomColors colors) {
|
|
return ThemeData(
|
|
fontFamily: 'Atkinson',
|
|
textTheme: TextTheme(
|
|
bodyLarge: TextStyle(
|
|
color: colors.colorScheme.onSurface,
|
|
fontSize: 24,
|
|
),
|
|
bodyMedium: TextStyle(
|
|
color: colors.colorScheme.onSurface,
|
|
fontSize: 18,
|
|
),
|
|
bodySmall: TextStyle(
|
|
color: colors.colorScheme.secondary,
|
|
fontSize: 14,
|
|
),
|
|
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,
|
|
),
|
|
),
|
|
iconTheme: IconThemeData(
|
|
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,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
textButtonTheme: TextButtonThemeData(
|
|
style: ButtonStyle(
|
|
textStyle: MaterialStateProperty.all(
|
|
const TextStyle(fontSize: 18),
|
|
),
|
|
),
|
|
),
|
|
popupMenuTheme: PopupMenuThemeData(
|
|
color: colors.colorScheme.background,
|
|
textStyle: TextStyle(
|
|
color: colors.colorScheme.onBackground,
|
|
),
|
|
),
|
|
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,
|
|
),
|
|
navigationBarTheme: NavigationBarThemeData(
|
|
labelTextStyle: MaterialStateProperty.all(
|
|
TextStyle(
|
|
color: colors.colorScheme.onSurface,
|
|
fontSize: 14,
|
|
),
|
|
),
|
|
backgroundColor: Colors.transparent,
|
|
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
|
|
indicatorColor: Colors.transparent,
|
|
elevation: 0,
|
|
height: 64,
|
|
),
|
|
scrollbarTheme: ScrollbarThemeData(
|
|
thumbColor: MaterialStateProperty.all(colors.hintColor),
|
|
),
|
|
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(
|
|
color: colors.colorScheme.primary,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
class CustomColors {
|
|
late String name;
|
|
late Color hintColor;
|
|
late ColorScheme colorScheme;
|
|
CustomColors(this.name, this.hintColor, this.colorScheme);
|
|
}
|