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, 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? 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
AppBarwidgets.final - applyElevationOverlayColor → bool?
-
Whether to apply elevation overlay color.
final
-
The theme for
MaterialBannerwidgets.final - bottomAppBarTheme → StacBottomAppBarThemeData?
-
The theme for
BottomAppBarwidgets.final -
The theme for
BottomNavigationBarwidgets.final - bottomSheetTheme → StacBottomSheetThemeData?
-
The theme for
BottomSheetwidgets.final - brightness → StacBrightness?
-
The brightness of the theme (light or dark).
final
-
The theme for Material buttons.
final
- canvasColor → String?
-
The default color of
Materialwhen it is used within this theme.final - cardColor → String?
-
The default color of
Cardwidgets.final - cardTheme → StacCardThemeData?
-
The theme for
Cardwidgets.final - checkboxTheme → StacCheckboxThemeData?
-
The theme for
Checkboxwidgets.final - chipTheme → StacChipThemeData?
-
The theme for
Chipwidgets.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
Dialogwidgets.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
Dividerwidgets.final - drawerTheme → StacDrawerThemeData?
-
The theme for
Drawerwidgets.final - elevatedButtonTheme → StacButtonStyle?
-
The theme for
ElevatedButtonwidgets.final - filledButtonTheme → StacButtonStyle?
-
The theme for
FilledButtonwidgets.final - floatingActionButtonTheme → StacFloatingActionButtonThemeData?
-
The theme for
FloatingActionButtonwidgets.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
IconButtonwidgets.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
ListTilewidgets.final - materialTapTargetSize → StacMaterialTapTargetSize?
-
The minimum size of tap targets.
final
-
The theme for
MenuButtonwidgets.final -
The theme for
NavigationBarwidgets.final -
The theme for
NavigationDrawerwidgets.final - outlinedButtonTheme → StacButtonStyle?
-
The theme for
OutlinedButtonwidgets.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
Scaffoldbackground.final - scrollbarTheme → StacScrollbarThemeData?
-
The theme for scrollbars.
final
- secondaryHeaderColor → String?
-
The color of the header in a
DataTable.final - segmentedButtonTheme → StacButtonStyle?
-
The theme for
SegmentedButtonwidgets.final - shadowColor → String?
-
The default shadow color for
Materialwidgets.final - snackBarTheme → StacSnackBarThemeData?
-
The theme for
SnackBarwidgets.final - splashColor → String?
-
The splash color for widgets.
final
- tabBarTheme → StacTabBarThemeData?
-
The theme for
TabBarwidgets.final - textButtonTheme → StacButtonStyle?
-
The theme for
TextButtonwidgets.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