import 'package:flutter/material.dart'; import 'dracula.dart' as color_dracula; import 'tess.dart' as color_tess; import 'adwaita.dart' as color_adwaita; import 'gruvbox.dart' as color_gruvbox; import 'fourth_website.dart' as color_fourth; import 'second.dart' as color_second; import 'first.dart' as color_first; // color schemes to pick from can be added here // there is a class to create these final available = [ color_dracula.theme, color_adwaita.themeDark, color_adwaita.themeLight, color_tess.theme, color_gruvbox.themeDark, color_gruvbox.themeLight, color_first.theme, color_second.theme, color_fourth.theme, ]; ThemeData getTheme(CustomColors colors) { return ThemeData( floatingActionButtonTheme: FloatingActionButtonThemeData( hoverColor: colors.colorScheme.onSurface, elevation: 0, enableFeedback: false, hoverElevation: 24, ), 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: 18, ), 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( size: 24, color: colors.colorScheme.onSurface, ), elevatedButtonTheme: ElevatedButtonThemeData( style: ButtonStyle( foregroundColor: MaterialStateProperty.resolveWith((states) { if (states.contains(MaterialState.disabled)) { return colors.colorScheme.surface; } return null; }), backgroundColor: MaterialStateProperty.resolveWith((states) { if (states.contains(MaterialState.disabled)) return colors.hintColor; return null; }), textStyle: MaterialStateProperty.resolveWith((states) => const TextStyle( fontSize: 18, fontFamily: "atkinson", fontWeight: FontWeight.w700)), ), ), 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( borderRadius: const BorderRadius.all(Radius.circular(8)), color: colors.colorScheme.primary, ), ), canvasColor: colors.colorScheme.surface, dialogBackgroundColor: colors.colorScheme.surface, selectedRowColor: colors.colorScheme.background, textSelectionTheme: TextSelectionThemeData(selectionColor: colors.hintColor), primaryIconTheme: const IconThemeData(size: 24), hoverColor: colors.hoverColor, shadowColor: colors.colorScheme.surface, focusColor: colors.hoverColor, indicatorColor: colors.hintColor, disabledColor: colors.hintColor, unselectedWidgetColor: colors.hintColor, toggleableActiveColor: colors.colorScheme.primary, splashColor: colors.colorScheme.onSurface, highlightColor: colors.hintColor, inputDecorationTheme: InputDecorationTheme( helperStyle: TextStyle( color: colors.hintColor, ), hintStyle: TextStyle( color: colors.hintColor, ), fillColor: colors.colorScheme.background, enabledBorder: UnderlineInputBorder( borderSide: BorderSide( color: colors.hintColor, width: 2, ), ), ), progressIndicatorTheme: ProgressIndicatorThemeData( color: colors.colorScheme.primary, refreshBackgroundColor: colors.hintColor, linearTrackColor: colors.hintColor, circularTrackColor: colors.hintColor, ), ); } class CustomColors { late String name; late Color hintColor; // must be set for twilight themes late Color hoverColor; late ColorScheme colorScheme; CustomColors(this.name, this.hintColor, this.colorScheme, this.hoverColor); }