DraftModeUIThemeData class
All design tokens consumed by DraftModeFramework UI widgets.
Use the semantic factories such as DraftModeUIThemeData.light, DraftModeUIThemeData.dark, or the explicit platform variants like DraftModeUIThemeData.iosLight and DraftModeUIThemeData.androidLight. The default light and dark factories preserve the current iOS baseline for compatibility with existing hosts.
Can be provided via DraftModeUITheme (InheritedWidget) or registered as a ThemeExtension on a Material ThemeData. The DraftModeUITheme.of helper checks both paths automatically.
- Inheritance
-
- Object
- ThemeExtension<
DraftModeUIThemeData> - DraftModeUIThemeData
Constructors
- DraftModeUIThemeData({DraftModePlatformStyle platformStyle = DraftModePlatformStyle.ios, Brightness brightness = Brightness.light, required ColorRole primaryColor, required ColorRole secondaryColor, required ColorRole tertiaryColor, required Color accentColor, required Color dangerColor, required Color successColor, required Color warningColor, ColorRole buttonGrayColor = const ColorRole(CupertinoColors.systemGrey5, CupertinoColors.label), required Color separatorColor, Color switchAndroidActiveTrackColor = const Color(0xFF54689A), Color switchAndroidActiveThumbColor = const Color(0xFFFFFFFF), Color switchAndroidInactiveTrackColor = const Color(0xFFF0F2F7), Color switchAndroidInactiveThumbColor = const Color(0xFF7A7E87), Color switchAndroidTrackOutlineColor = const Color(0x737A7E87), double fontSizeXLarge = 20, double fontSizePrimary = 17, double fontSizeSecondary = 15, double fontSizeTertiary = 12, FontWeight fontWeightRegular = FontWeight.w400, FontWeight fontWeightMedium = FontWeight.w500, FontWeight fontWeightSemibold = FontWeight.w600, double sectionHeaderFontSize = 12, FontWeight sectionHeaderFontWeight = FontWeight.w500, double sectionHeaderLetterSpacing = 0.4, double spacingXs = 8, double spacingSm = 10, double spacingMd = 14, double spacingLg = 16, double spacingXl = 20, double radiusPrimary = 12, double radiusSecondary = 10, double radiusPill = 20, double iconSizeLarge = 22, double iconSizeMedium = 18, double iconSizeSmall = 16, ({double fontSize, FontWeight fontWeight, double height}) buttonLarge = (height: 50, fontSize: 17, fontWeight: FontWeight.normal), ({double fontSize, FontWeight fontWeight, double height}) buttonMedium = (height: 44, fontSize: 15, fontWeight: FontWeight.normal), ({double fontSize, FontWeight fontWeight, double height}) buttonSmall = (height: 34, fontSize: 13, fontWeight: FontWeight.normal), double rowMinHeight = 44, double rowPaddingHorizontal = 16, double labelWidth = 100, double rowLabelFontSize = 17, FontWeight rowLabelFontWeight = FontWeight.w400, double rowTextFontSize = 17, FontWeight rowTextFontWeight = FontWeight.w400, Color disclosureColor = CupertinoColors.systemGrey2, double disclosureSize = 14, double separatorHeight = 0.5, Color shadowColor = const Color(0x1F000000), double shadowBlurRadius = 12.0, double toastBottomOffset = 36, double toastOpacity = 0.9, double toastMaxWidth = double.infinity, double toastHorizontalInset = 20, double toastRadius = 16, double toastMinHeight = 60, double toastPaddingHorizontal = 16, double toastPaddingVertical = 10, Color toastShadowColor = const Color(0x1F000000), double toastShadowBlurRadius = 12, double badgeMinSize = 18, double badgeRadius = 9, double badgePaddingHorizontal = 6, double badgePaddingVertical = 2, double badgeOffsetTop = -6, double badgeOffsetRight = -8, double spinnerAndroidStrokeWidth = 2.5, double dropDownMenuMinWidth = 180, double dropDownMenuMaxWidth = 260, double dropDownMenuGap = 4, Duration animationDurationFast = const Duration(milliseconds: 150), Duration animationDurationDefault = const Duration(milliseconds: 250), Curve animationCurve = Curves.easeInOut})
- DraftModeUIThemeData.androidDark({double labelWidth = 100})
-
Explicit Android dark variant using Material-oriented palette defaults.
factory
- DraftModeUIThemeData.androidLight({double labelWidth = 100})
-
Explicit Android light variant using Material-oriented palette defaults.
factory
- DraftModeUIThemeData.dark({double labelWidth = 100})
-
Compatibility alias for the original iOS-first dark palette.
factory
- DraftModeUIThemeData.iosDark({double labelWidth = 100})
-
Explicit iOS dark variant using resolved Cupertino dark colours.
factory
- DraftModeUIThemeData.iosLight({double labelWidth = 100})
-
Explicit iOS light variant using the current Cupertino-based baseline.
factory
- DraftModeUIThemeData.light({double labelWidth = 100})
-
Compatibility alias for the original iOS-first light palette.
factory
- DraftModeUIThemeData.platform({required DraftModePlatformStyle style, Brightness brightness = Brightness.light, double labelWidth = 100})
-
Returns a pre-configured token set for the requested platform style.
factory
Properties
- accentColor → Color
-
final
- animationCurve → Curve
-
final
- animationDurationDefault → Duration
-
final
- animationDurationFast → Duration
-
final
- badgeMinSize → double
-
final
- badgeOffsetRight → double
-
final
- badgeOffsetTop → double
-
final
- badgePaddingHorizontal → double
-
final
- badgePaddingVertical → double
-
final
- badgeRadius → double
-
final
- brightness → Brightness
-
The brightness variant for this token set.
final
-
final
-
final
-
final
-
final
- cupertinoTheme → CupertinoThemeData
-
Compatibility getter for older hosts that still ask for a Cupertino theme.
no setter
- dangerColor → Color
-
final
- disclosureColor → Color
-
final
- disclosureSize → double
-
final
- dropDownMenuGap → double
-
final
- dropDownMenuMaxWidth → double
-
final
- dropDownMenuMinWidth → double
-
final
- fontSizePrimary → double
-
final
- fontSizeSecondary → double
-
final
- fontSizeTertiary → double
-
final
- fontSizeXLarge → double
-
final
- fontWeightMedium → FontWeight
-
final
- fontWeightRegular → FontWeight
-
final
- fontWeightSemibold → FontWeight
-
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- iconSizeLarge → double
-
final
- iconSizeMedium → double
-
final
- iconSizeSmall → double
-
final
- isAndroid → bool
-
Whether this token set targets the Android visual style.
no setter
- isIOS → bool
-
Whether this token set targets the iOS visual style.
no setter
- labelWidth → double
-
final
-
final
-
final
-
final
-
final
- platformStyle → DraftModePlatformStyle
-
The framework-owned visual platform style this token set targets.
final
- primaryColor → ColorRole
-
final
- radiusPill → double
-
final
- radiusPrimary → double
-
final
- radiusSecondary → double
-
final
- rowLabelFontSize → double
-
final
- rowLabelFontWeight → FontWeight
-
final
- rowMinHeight → double
-
final
- rowPaddingHorizontal → double
-
final
- rowTextFontSize → double
-
final
- rowTextFontWeight → FontWeight
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondaryColor → ColorRole
-
final
- sectionHeaderFontSize → double
-
final
- sectionHeaderFontWeight → FontWeight
-
final
- sectionHeaderLetterSpacing → double
-
final
- separatorColor → Color
-
final
- separatorHeight → double
-
final
- shadowBlurRadius → double
-
final
- shadowColor → Color
-
final
- spacingLg → double
-
final
- spacingMd → double
-
final
- spacingSm → double
-
final
- spacingXl → double
-
final
- spacingXs → double
-
final
- spinnerAndroidStrokeWidth → double
-
final
- successColor → Color
-
final
- switchAndroidActiveThumbColor → Color
-
final
- switchAndroidActiveTrackColor → Color
-
final
- switchAndroidInactiveThumbColor → Color
-
final
- switchAndroidInactiveTrackColor → Color
-
final
- switchAndroidTrackOutlineColor → Color
-
final
- tertiaryColor → ColorRole
-
final
- toastBottomOffset → double
-
final
- toastHorizontalInset → double
-
final
- toastMaxWidth → double
-
final
- toastMinHeight → double
-
final
- toastOpacity → double
-
final
- toastPaddingHorizontal → double
-
final
- toastPaddingVertical → double
-
final
- toastRadius → double
-
final
- toastShadowBlurRadius → double
-
final
- toastShadowColor → Color
-
final
- type → Object
-
The extension's type.
no setterinherited
- warningColor → Color
-
final
Methods
-
copyWith(
{DraftModePlatformStyle? platformStyle, Brightness? brightness, ColorRole? primaryColor, ColorRole? secondaryColor, ColorRole? tertiaryColor, Color? accentColor, Color? dangerColor, Color? successColor, Color? warningColor, ColorRole? buttonGrayColor, Color? separatorColor, Color? switchAndroidActiveTrackColor, Color? switchAndroidActiveThumbColor, Color? switchAndroidInactiveTrackColor, Color? switchAndroidInactiveThumbColor, Color? switchAndroidTrackOutlineColor, double? fontSizeXLarge, double? fontSizePrimary, double? fontSizeSecondary, double? fontSizeTertiary, FontWeight? fontWeightRegular, FontWeight? fontWeightMedium, FontWeight? fontWeightSemibold, double? sectionHeaderFontSize, FontWeight? sectionHeaderFontWeight, double? sectionHeaderLetterSpacing, double? spacingXs, double? spacingSm, double? spacingMd, double? spacingLg, double? spacingXl, double? radiusPrimary, double? radiusSecondary, double? radiusPill, double? iconSizeLarge, double? iconSizeMedium, double? iconSizeSmall, ({double fontSize, FontWeight fontWeight, double height})? buttonLarge, ({double fontSize, FontWeight fontWeight, double height})? buttonMedium, ({double fontSize, FontWeight fontWeight, double height})? buttonSmall, double? rowMinHeight, double? rowPaddingHorizontal, double? labelWidth, double? rowLabelFontSize, FontWeight? rowLabelFontWeight, double? rowTextFontSize, FontWeight? rowTextFontWeight, Color? disclosureColor, double? disclosureSize, double? separatorHeight, Color? shadowColor, double? shadowBlurRadius, double? toastBottomOffset, double? toastOpacity, double? toastMaxWidth, double? toastHorizontalInset, double? toastRadius, double? toastMinHeight, double? toastPaddingHorizontal, double? toastPaddingVertical, Color? toastShadowColor, double? toastShadowBlurRadius, double? badgeMinSize, double? badgeRadius, double? badgePaddingHorizontal, double? badgePaddingVertical, double? badgeOffsetTop, double? badgeOffsetRight, double? spinnerAndroidStrokeWidth, double? dropDownMenuMinWidth, double? dropDownMenuMaxWidth, double? dropDownMenuGap, Duration? animationDurationFast, Duration? animationDurationDefault, Curve? animationCurve, CupertinoThemeData? cupertinoTheme}) → DraftModeUIThemeData -
Creates a copy of this theme extension with the given fields
replaced by the non-null parameter values.
override
-
lerp(
covariant DraftModeUIThemeData? other, double t) → DraftModeUIThemeData -
Linearly interpolate with another ThemeExtension object.
override
-
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.
override