SACThemeConfig class

Configuration class for customizing Swiss Army Component theme colors.

Pass custom colors to override defaults. Any null values will use the default colors.

Example:

final config = SACThemeConfig(
  primary: Colors.blue,
  secondary: Colors.amber,
  scaffoldBackgroundLight: Colors.grey[50],
  appBarElevation: 0,
);

MaterialApp(
  theme: SACTheme.light(config),
  darkTheme: SACTheme.dark(config),
);

Constructors

SACThemeConfig({Color? primary, Color? primaryLight, Color? primaryDark, Color? secondary, Color? secondaryLight, Color? secondaryDark, Color? error, Color? errorLight, Color? errorDark, Color? success, Color? successLight, Color? successDark, Color? backgroundLight, Color? surfaceLight, Color? borderLight, Color? textPrimaryLight, Color? textMutedLight, Color? backgroundDark, Color? surfaceDark, Color? borderDark, Color? textPrimaryDark, Color? textMutedDark, Color? lightRed, Color? purple, Color? grey, Color? darkGrey, Color? scaffoldBackgroundLight, Color? scaffoldBackgroundDark, Color? appBarBackgroundLight, Color? appBarBackgroundDark, Color? appBarForegroundLight, Color? appBarForegroundDark, double? appBarElevation, bool? appBarCenterTitle, TextStyle? appBarTitleTextStyle, IconThemeData? appBarIconTheme, Color? bottomNavBackgroundLight, Color? bottomNavBackgroundDark, Color? bottomNavSelectedColor, Color? bottomNavUnselectedColor, double? bottomNavElevation, BottomNavigationBarType? bottomNavType, Color? navigationBarBackgroundLight, Color? navigationBarBackgroundDark, Color? navigationBarIndicatorColor, double? navigationBarHeight, Color? navigationRailBackgroundLight, Color? navigationRailBackgroundDark, Color? navigationRailSelectedColor, Color? navigationRailUnselectedColor, Color? drawerBackgroundLight, Color? drawerBackgroundDark, double? drawerWidth, double? drawerElevation, Color? fabBackgroundLight, Color? fabBackgroundDark, Color? fabForegroundLight, Color? fabForegroundDark, double? fabElevation, ShapeBorder? fabShape, ButtonStyle? elevatedButtonStyle, ButtonStyle? outlinedButtonStyle, ButtonStyle? textButtonStyle, ButtonStyle? filledButtonStyle, ButtonStyle? iconButtonStyle, Color? cardColorLight, Color? cardColorDark, double? cardElevation, ShapeBorder? cardShape, EdgeInsetsGeometry? cardMargin, Color? dialogBackgroundLight, Color? dialogBackgroundDark, double? dialogElevation, ShapeBorder? dialogShape, TextStyle? dialogTitleStyle, TextStyle? dialogContentStyle, Color? bottomSheetBackgroundLight, Color? bottomSheetBackgroundDark, double? bottomSheetElevation, ShapeBorder? bottomSheetShape, Color? bottomSheetDragHandleColor, Color? snackBarBackgroundLight, Color? snackBarBackgroundDark, Color? snackBarActionColor, SnackBarBehavior? snackBarBehavior, Color? inputFillColorLight, Color? inputFillColorDark, Color? inputBorderColor, Color? inputFocusedBorderColor, Color? inputErrorBorderColor, TextStyle? inputLabelStyle, TextStyle? inputHintStyle, double? inputBorderRadius, Color? checkboxFillColor, Color? radioFillColor, Color? switchActiveColor, Color? switchInactiveColor, Color? switchTrackColor, Color? sliderActiveColor, Color? sliderInactiveColor, Color? sliderThumbColor, Color? progressIndicatorColor, Color? progressIndicatorBackgroundColor, double? circularProgressStrokeWidth, Color? tooltipBackgroundColor, TextStyle? tooltipTextStyle, EdgeInsetsGeometry? tooltipPadding, Color? dividerColor, double? dividerThickness, double? dividerIndent, Color? listTileIconColor, TextStyle? listTileTitleStyle, TextStyle? listTileSubtitleStyle, Color? listTileSelectedColor, Color? tabBarIndicatorColor, Color? tabBarLabelColor, Color? tabBarUnselectedLabelColor, double? tabBarIndicatorWeight, Color? dataTableHeadingRowColor, Color? dataTableDataRowColor, double? dataTableDividerThickness, Color? chipBackgroundLight, Color? chipBackgroundDark, TextStyle? chipLabelStyle, Color? chipDeleteIconColor, Color? chipSelectedColor, Color? badgeBackgroundColor, Color? badgeTextColor, Color? searchBarBackgroundLight, Color? searchBarBackgroundDark, double? searchBarElevation, TextStyle? searchBarHintStyle, Color? segmentedButtonSelectedColor, Color? segmentedButtonForegroundColor, Color? popupMenuBackgroundLight, Color? popupMenuBackgroundDark, double? popupMenuElevation, ShapeBorder? popupMenuShape, Color? expansionTileBackgroundColor, Color? expansionTileCollapsedBackgroundColor, Color? expansionTileIconColor, String? fontFamily, TextStyle? displayLarge, TextStyle? displayMedium, TextStyle? displaySmall, TextStyle? headlineLarge, TextStyle? headlineMedium, TextStyle? headlineSmall, TextStyle? titleLarge, TextStyle? titleMedium, TextStyle? titleSmall, TextStyle? bodyLarge, TextStyle? bodyMedium, TextStyle? bodySmall, TextStyle? labelLarge, TextStyle? labelMedium, TextStyle? labelSmall, Color? splashColor, Color? highlightColor, Color? hoverColor, Color? focusColor, Color? disabledColor, Color? shadowColor, VisualDensity? visualDensity, MaterialTapTargetSize? materialTapTargetSize})
const

Properties

appBarBackgroundDark Color?
final
appBarBackgroundLight Color?
final
appBarCenterTitle bool?
final
appBarElevation double?
final
appBarForegroundDark Color?
final
appBarForegroundLight Color?
final
appBarIconTheme IconThemeData?
final
appBarTitleTextStyle TextStyle?
final
backgroundDark Color?
final
backgroundLight Color?
final
badgeBackgroundColor Color?
final
badgeTextColor Color?
final
bodyLarge TextStyle?
final
bodyMedium TextStyle?
final
bodySmall TextStyle?
final
borderDark Color?
final
borderLight Color?
final
bottomNavBackgroundDark Color?
final
bottomNavBackgroundLight Color?
final
bottomNavElevation double?
final
bottomNavSelectedColor Color?
final
bottomNavType BottomNavigationBarType?
final
bottomNavUnselectedColor Color?
final
bottomSheetBackgroundDark Color?
final
bottomSheetBackgroundLight Color?
final
bottomSheetDragHandleColor Color?
final
bottomSheetElevation double?
final
bottomSheetShape ShapeBorder?
final
cardColorDark Color?
final
cardColorLight Color?
final
cardElevation double?
final
cardMargin EdgeInsetsGeometry?
final
cardShape ShapeBorder?
final
checkboxFillColor Color?
final
chipBackgroundDark Color?
final
chipBackgroundLight Color?
final
chipDeleteIconColor Color?
final
chipLabelStyle TextStyle?
final
chipSelectedColor Color?
final
circularProgressStrokeWidth double?
final
darkGrey Color?
final
dataTableDataRowColor Color?
final
dataTableDividerThickness double?
final
dataTableHeadingRowColor Color?
final
dialogBackgroundDark Color?
final
dialogBackgroundLight Color?
final
dialogContentStyle TextStyle?
final
dialogElevation double?
final
dialogShape ShapeBorder?
final
dialogTitleStyle TextStyle?
final
disabledColor Color?
final
displayLarge TextStyle?
final
displayMedium TextStyle?
final
displaySmall TextStyle?
final
dividerColor Color?
final
dividerIndent double?
final
dividerThickness double?
final
drawerBackgroundDark Color?
final
drawerBackgroundLight Color?
final
drawerElevation double?
final
drawerWidth double?
final
elevatedButtonStyle ButtonStyle?
final
error Color?
Error color (used for validation, alerts)
final
errorDark Color?
Error color for dark mode (overrides error when set)
final
errorLight Color?
Error color for light mode (overrides error when set)
final
expansionTileBackgroundColor Color?
final
expansionTileCollapsedBackgroundColor Color?
final
expansionTileIconColor Color?
final
fabBackgroundDark Color?
final
fabBackgroundLight Color?
final
fabElevation double?
final
fabForegroundDark Color?
final
fabForegroundLight Color?
final
fabShape ShapeBorder?
final
filledButtonStyle ButtonStyle?
final
focusColor Color?
final
fontFamily String?
final
grey Color?
final
hashCode int
The hash code for this object.
no setterinherited
headlineLarge TextStyle?
final
headlineMedium TextStyle?
final
headlineSmall TextStyle?
final
highlightColor Color?
final
hoverColor Color?
final
iconButtonStyle ButtonStyle?
final
inputBorderColor Color?
final
inputBorderRadius double?
final
inputErrorBorderColor Color?
final
inputFillColorDark Color?
final
inputFillColorLight Color?
final
inputFocusedBorderColor Color?
final
inputHintStyle TextStyle?
final
inputLabelStyle TextStyle?
final
labelLarge TextStyle?
final
labelMedium TextStyle?
final
labelSmall TextStyle?
final
lightRed Color?
final
listTileIconColor Color?
final
listTileSelectedColor Color?
final
listTileSubtitleStyle TextStyle?
final
listTileTitleStyle TextStyle?
final
materialTapTargetSize MaterialTapTargetSize?
final
final
final
final
final
final
final
final
final
outlinedButtonStyle ButtonStyle?
final
popupMenuBackgroundDark Color?
final
popupMenuBackgroundLight Color?
final
popupMenuElevation double?
final
popupMenuShape ShapeBorder?
final
primary Color?
Primary brand color
final
primaryDark Color?
Primary color for dark mode (overrides primary when set)
final
primaryLight Color?
Primary color for light mode (overrides primary when set)
final
progressIndicatorBackgroundColor Color?
final
progressIndicatorColor Color?
final
purple Color?
final
radioFillColor Color?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaffoldBackgroundDark Color?
final
scaffoldBackgroundLight Color?
final
searchBarBackgroundDark Color?
final
searchBarBackgroundLight Color?
final
searchBarElevation double?
final
searchBarHintStyle TextStyle?
final
secondary Color?
Secondary brand color
final
secondaryDark Color?
Secondary color for dark mode (overrides secondary when set)
final
secondaryLight Color?
Secondary color for light mode (overrides secondary when set)
final
segmentedButtonForegroundColor Color?
final
segmentedButtonSelectedColor Color?
final
shadowColor Color?
final
sliderActiveColor Color?
final
sliderInactiveColor Color?
final
sliderThumbColor Color?
final
snackBarActionColor Color?
final
snackBarBackgroundDark Color?
final
snackBarBackgroundLight Color?
final
snackBarBehavior SnackBarBehavior?
final
splashColor Color?
final
success Color?
Success/green color
final
successDark Color?
Success color for dark mode (overrides success when set)
final
successLight Color?
Success color for light mode (overrides success when set)
final
surfaceDark Color?
final
surfaceLight Color?
final
switchActiveColor Color?
final
switchInactiveColor Color?
final
switchTrackColor Color?
final
tabBarIndicatorColor Color?
final
tabBarIndicatorWeight double?
final
tabBarLabelColor Color?
final
tabBarUnselectedLabelColor Color?
final
textButtonStyle ButtonStyle?
final
textMutedDark Color?
final
textMutedLight Color?
final
textPrimaryDark Color?
final
textPrimaryLight Color?
final
titleLarge TextStyle?
final
titleMedium TextStyle?
final
titleSmall TextStyle?
final
tooltipBackgroundColor Color?
final
tooltipPadding EdgeInsetsGeometry?
final
tooltipTextStyle TextStyle?
final
visualDensity VisualDensity?
final

Methods

copyWith({Color? primary, Color? primaryLight, Color? primaryDark, Color? secondary, Color? secondaryLight, Color? secondaryDark, Color? error, Color? errorLight, Color? errorDark, Color? success, Color? successLight, Color? successDark, Color? backgroundLight, Color? surfaceLight, Color? borderLight, Color? textPrimaryLight, Color? textMutedLight, Color? backgroundDark, Color? surfaceDark, Color? borderDark, Color? textPrimaryDark, Color? textMutedDark, Color? lightRed, Color? purple, Color? grey, Color? darkGrey, Color? scaffoldBackgroundLight, Color? scaffoldBackgroundDark, Color? appBarBackgroundLight, Color? appBarBackgroundDark, Color? appBarForegroundLight, Color? appBarForegroundDark, double? appBarElevation, bool? appBarCenterTitle, TextStyle? appBarTitleTextStyle, IconThemeData? appBarIconTheme, Color? bottomNavBackgroundLight, Color? bottomNavBackgroundDark, Color? bottomNavSelectedColor, Color? bottomNavUnselectedColor, double? bottomNavElevation, BottomNavigationBarType? bottomNavType, Color? navigationBarBackgroundLight, Color? navigationBarBackgroundDark, Color? navigationBarIndicatorColor, double? navigationBarHeight, Color? navigationRailBackgroundLight, Color? navigationRailBackgroundDark, Color? navigationRailSelectedColor, Color? navigationRailUnselectedColor, Color? drawerBackgroundLight, Color? drawerBackgroundDark, double? drawerWidth, double? drawerElevation, Color? fabBackgroundLight, Color? fabBackgroundDark, Color? fabForegroundLight, Color? fabForegroundDark, double? fabElevation, ShapeBorder? fabShape, ButtonStyle? elevatedButtonStyle, ButtonStyle? outlinedButtonStyle, ButtonStyle? textButtonStyle, ButtonStyle? filledButtonStyle, ButtonStyle? iconButtonStyle, Color? cardColorLight, Color? cardColorDark, double? cardElevation, ShapeBorder? cardShape, EdgeInsetsGeometry? cardMargin, Color? dialogBackgroundLight, Color? dialogBackgroundDark, double? dialogElevation, ShapeBorder? dialogShape, TextStyle? dialogTitleStyle, TextStyle? dialogContentStyle, Color? bottomSheetBackgroundLight, Color? bottomSheetBackgroundDark, double? bottomSheetElevation, ShapeBorder? bottomSheetShape, Color? bottomSheetDragHandleColor, Color? snackBarBackgroundLight, Color? snackBarBackgroundDark, Color? snackBarActionColor, SnackBarBehavior? snackBarBehavior, Color? inputFillColorLight, Color? inputFillColorDark, Color? inputBorderColor, Color? inputFocusedBorderColor, Color? inputErrorBorderColor, TextStyle? inputLabelStyle, TextStyle? inputHintStyle, double? inputBorderRadius, Color? checkboxFillColor, Color? radioFillColor, Color? switchActiveColor, Color? switchInactiveColor, Color? switchTrackColor, Color? sliderActiveColor, Color? sliderInactiveColor, Color? sliderThumbColor, Color? progressIndicatorColor, Color? progressIndicatorBackgroundColor, double? circularProgressStrokeWidth, Color? tooltipBackgroundColor, TextStyle? tooltipTextStyle, EdgeInsetsGeometry? tooltipPadding, Color? dividerColor, double? dividerThickness, double? dividerIndent, Color? listTileIconColor, TextStyle? listTileTitleStyle, TextStyle? listTileSubtitleStyle, Color? listTileSelectedColor, Color? tabBarIndicatorColor, Color? tabBarLabelColor, Color? tabBarUnselectedLabelColor, double? tabBarIndicatorWeight, Color? dataTableHeadingRowColor, Color? dataTableDataRowColor, double? dataTableDividerThickness, Color? chipBackgroundLight, Color? chipBackgroundDark, TextStyle? chipLabelStyle, Color? chipDeleteIconColor, Color? chipSelectedColor, Color? badgeBackgroundColor, Color? badgeTextColor, Color? searchBarBackgroundLight, Color? searchBarBackgroundDark, double? searchBarElevation, TextStyle? searchBarHintStyle, Color? segmentedButtonSelectedColor, Color? segmentedButtonForegroundColor, Color? popupMenuBackgroundLight, Color? popupMenuBackgroundDark, double? popupMenuElevation, ShapeBorder? popupMenuShape, Color? expansionTileBackgroundColor, Color? expansionTileCollapsedBackgroundColor, Color? expansionTileIconColor, String? fontFamily, TextStyle? displayLarge, TextStyle? displayMedium, TextStyle? displaySmall, TextStyle? headlineLarge, TextStyle? headlineMedium, TextStyle? headlineSmall, TextStyle? titleLarge, TextStyle? titleMedium, TextStyle? titleSmall, TextStyle? bodyLarge, TextStyle? bodyMedium, TextStyle? bodySmall, TextStyle? labelLarge, TextStyle? labelMedium, TextStyle? labelSmall, Color? splashColor, Color? highlightColor, Color? hoverColor, Color? focusColor, Color? disabledColor, Color? shadowColor, VisualDensity? visualDensity, MaterialTapTargetSize? materialTapTargetSize}) SACThemeConfig
Returns a new config overriding selected fields.
merge(SACThemeConfig? other) SACThemeConfig
Merges this config with another, giving priority to the other config's non-null values
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited