loris/lib/themes/themes.dart

93 lines
2.6 KiB
Dart

import 'package:flutter/material.dart';
import 'dracula.dart' as color_dracula;
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.onSurface,
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,
),
),
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: const ScrollbarThemeData(),
);
}
class CustomColors {
late String name;
late Color hintColor;
late ColorScheme colorScheme;
CustomColors(this.name, this.hintColor, this.colorScheme);
}