pub struct ThemeData {
pub colors: ColorScheme,
pub animation: AnimationConfig,
pub typography: Typography,
pub spacing: Spacing,
pub radius: BorderRadius,
pub is_dark: bool,
pub app_bar: AppBarStyle,
pub ext: HashMap<TypeId, Arc<dyn Any + Send + Sync>>,
}Expand description
All design tokens bundled together as a single snapshot.
ThemeData is Clone so it can be cheaply shared via the global atom.
Fields§
§colors: ColorScheme§animation: AnimationConfigGlobal animation policy — see AnimationConfig.
typography: Typography§spacing: Spacing§radius: BorderRadius§is_dark: booltrue for dark themes; false for light themes.
app_bar: AppBarStylePlatform-adaptive AppBar defaults (D105). The first of what will become several per-widget Style fields — see Phase 23.
ext: HashMap<TypeId, Arc<dyn Any + Send + Sync>>Type-keyed extension map (D105 Phase 23 Step 4): lets a custom widget
stash and read its own theme-style struct without editing this type.
Populate via ThemeData::with_ext, read via ThemeData::ext.
Implementations§
Source§impl ThemeData
impl ThemeData
Sourcepub fn animations(self, enabled: bool) -> Self
pub fn animations(self, enabled: bool) -> Self
Enable or disable global animation (theme-level).
Sourcepub fn animation_ms(self, ms: f32) -> Self
pub fn animation_ms(self, ms: f32) -> Self
Set the global animation duration in milliseconds.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ThemeData
impl !UnwindSafe for ThemeData
impl Freeze for ThemeData
impl Send for ThemeData
impl Sync for ThemeData
impl Unpin for ThemeData
impl UnsafeUnpin for ThemeData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more