StacTheme class

A Stac model representing Flutter's ThemeData.

Defines the complete theme for the application, including colors, typography, iconography, and component themes for all Material widgets.

{@tool snippet} Dart Example:

StacTheme(
  brightness: StacBrightness.light,
  colorScheme: StacColorScheme(
    brightness: StacBrightness.light,
    primary: '#2196F3',
    onPrimary: '#FFFFFF',
  ),
  textTheme: StacTextTheme(...),
  appBarTheme: StacAppBarTheme(...),
  useMaterial3: true,
)

{@end-tool}

{@tool snippet} JSON Example:

{
  "brightness": "light",
  "useMaterial3": true,
  "colorScheme": {
    "brightness": "light",
    "primary": "#2196F3",
    "onPrimary": "#FFFFFF"
  },
  "textTheme": {...},
  "appBarTheme": {...},
  "buttonTheme": {...}
}

{@end-tool}

Implemented types
Annotations
  • @JsonSerializable.new()

Constructors

StacTheme({bool? applyElevationOverlayColor, StacInputDecorationTheme? inputDecorationTheme, StacMaterialTapTargetSize? materialTapTargetSize, StacScrollbarThemeData? scrollbarTheme, bool? useMaterial3, StacColorScheme? colorScheme, StacBrightness? brightness, String? colorSchemeSeed, String? canvasColor, String? cardColor, String? disabledColor, String? dividerColor, String? focusColor, String? highlightColor, String? hintColor, String? hoverColor, String? primaryColor, String? primaryColorDark, String? primaryColorLight, StacMaterialColor? primarySwatch, String? scaffoldBackgroundColor, String? secondaryHeaderColor, String? shadowColor, String? splashColor, String? unselectedWidgetColor, String? fontFamily, List<String>? fontFamilyFallback, String? package, StacIconThemeData? iconTheme, StacIconThemeData? primaryIconTheme, StacTextTheme? primaryTextTheme, StacTextTheme? textTheme, StacAppBarTheme? appBarTheme, StacMaterialBannerThemeData? bannerTheme, StacBottomAppBarThemeData? bottomAppBarTheme, StacBottomNavBarThemeData? bottomNavigationBarTheme, StacBottomSheetThemeData? bottomSheetTheme, StacButtonThemeData? buttonTheme, StacCardThemeData? cardTheme, StacCheckboxThemeData? checkboxTheme, StacChipThemeData? chipTheme, StacDatePickerThemeData? datePickerTheme, StacDialogThemeData? dialogTheme, StacDividerThemeData? dividerTheme, StacDrawerThemeData? drawerTheme, StacButtonStyle? elevatedButtonTheme, StacButtonStyle? filledButtonTheme, StacFloatingActionButtonThemeData? floatingActionButtonTheme, StacButtonStyle? iconButtonTheme, StacListTileThemeData? listTileTheme, StacButtonStyle? menuButtonTheme, StacNavigationBarThemeData? navigationBarTheme, StacNavigationDrawerThemeData? navigationDrawerTheme, StacButtonStyle? outlinedButtonTheme, StacButtonStyle? segmentedButtonTheme, StacSnackBarThemeData? snackBarTheme, StacTabBarThemeData? tabBarTheme, StacButtonStyle? textButtonTheme})
Creates a StacTheme with the given properties.
const
StacTheme.fromJson(Map<String, dynamic> json)
Creates a StacTheme from JSON.
factory

Properties

appBarTheme StacAppBarTheme?
The theme for AppBar widgets.
final
applyElevationOverlayColor bool?
Whether to apply elevation overlay color.
final
bannerTheme StacMaterialBannerThemeData?
The theme for MaterialBanner widgets.
final
bottomAppBarTheme StacBottomAppBarThemeData?
The theme for BottomAppBar widgets.
final
bottomNavigationBarTheme StacBottomNavBarThemeData?
The theme for BottomNavigationBar widgets.
final
bottomSheetTheme StacBottomSheetThemeData?
The theme for BottomSheet widgets.
final
brightness StacBrightness?
The brightness of the theme (light or dark).
final
buttonTheme StacButtonThemeData?
The theme for Material buttons.
final
canvasColor String?
The default color of Material when it is used within this theme.
final
cardColor String?
The default color of Card widgets.
final
cardTheme StacCardThemeData?
The theme for Card widgets.
final
checkboxTheme StacCheckboxThemeData?
The theme for Checkbox widgets.
final
chipTheme StacChipThemeData?
The theme for Chip widgets.
final
colorScheme StacColorScheme?
The color scheme for the theme.
final
colorSchemeSeed String?
A seed color used to generate the color scheme.
final
datePickerTheme StacDatePickerThemeData?
The theme for date picker dialogs.
final
dialogTheme StacDialogThemeData?
The theme for Dialog widgets.
final
disabledColor String?
The color to use for disabled widgets.
final
dividerColor String?
The color to use for dividers.
final
dividerTheme StacDividerThemeData?
The theme for Divider widgets.
final
drawerTheme StacDrawerThemeData?
The theme for Drawer widgets.
final
elevatedButtonTheme StacButtonStyle?
The theme for ElevatedButton widgets.
final
filledButtonTheme StacButtonStyle?
The theme for FilledButton widgets.
final
floatingActionButtonTheme StacFloatingActionButtonThemeData?
The theme for FloatingActionButton widgets.
final
focusColor String?
The color to use for input fields that have the input focus.
final
fontFamily String?
The default font family for text in the theme.
final
fontFamilyFallback List<String>?
The fallback font families to use when fontFamily is not available.
final
hashCode int
The hash code for this object.
no setterinherited
highlightColor String?
The highlight color for widgets.
final
hintColor String?
The color to use for hint text or placeholder text.
final
hoverColor String?
The color to use for widgets when they are being hovered over.
final
iconButtonTheme StacButtonStyle?
The theme for IconButton widgets.
final
iconTheme StacIconThemeData?
The default theme for icons.
final
inputDecorationTheme StacInputDecorationTheme?
The theme for input decorations (text fields, etc.).
final
listTileTheme StacListTileThemeData?
The theme for ListTile widgets.
final
materialTapTargetSize StacMaterialTapTargetSize?
The minimum size of tap targets.
final
The theme for MenuButton widgets.
final
The theme for NavigationBar widgets.
final
The theme for NavigationDrawer widgets.
final
outlinedButtonTheme StacButtonStyle?
The theme for OutlinedButton widgets.
final
package String?
The package name for the font family.
final
primaryColor String?
The primary color of the theme.
final
primaryColorDark String?
A darker version of the primary color.
final
primaryColorLight String?
A lighter version of the primary color.
final
primaryIconTheme StacIconThemeData?
The theme for primary icons.
final
primarySwatch StacMaterialColor?
A swatch of primary colors with different shades.
final
primaryTextTheme StacTextTheme?
The text theme for primary text.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaffoldBackgroundColor String?
The default color of the Scaffold background.
final
scrollbarTheme StacScrollbarThemeData?
The theme for scrollbars.
final
secondaryHeaderColor String?
The color of the header in a DataTable.
final
segmentedButtonTheme StacButtonStyle?
The theme for SegmentedButton widgets.
final
shadowColor String?
The default shadow color for Material widgets.
final
snackBarTheme StacSnackBarThemeData?
The theme for SnackBar widgets.
final
splashColor String?
The splash color for widgets.
final
tabBarTheme StacTabBarThemeData?
The theme for TabBar widgets.
final
textButtonTheme StacButtonStyle?
The theme for TextButton widgets.
final
textTheme StacTextTheme?
The default text theme for the application.
final
unselectedWidgetColor String?
The color to use for unselected widgets.
final
useMaterial3 bool?
Whether to use Material 3 design.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this theme to JSON.
override
toString() String
A string representation of this object.
inherited

Operators

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