Skip to main content

ThemeData

Struct ThemeData 

Source
pub struct ThemeData {
Show 82 fields pub apply_elevation_overlay_color: bool, pub cupertino_override_theme: Option<NoDefaultCupertinoThemeData>, pub extensions: IndexMap<TypeId, ThemeExtensionRef>, pub adaptation_map: IndexMap<TypeId, AdaptationRef>, pub input_decoration_theme: InputDecorationThemeData, pub material_tap_target_size: MaterialTapTargetSize, pub page_transitions_theme: PageTransitionsTheme, pub platform: TargetPlatform, pub scrollbar_theme: ScrollbarThemeData, pub splash_factory: InteractiveInkFeatureFactoryRef, pub use_material3: bool, pub visual_density: VisualDensity, pub canvas_color: Color, pub card_color: Color, pub color_scheme: ColorScheme, pub disabled_color: Color, pub divider_color: Color, pub focus_color: Color, pub highlight_color: Color, pub hint_color: Color, pub hover_color: Color, pub primary_color: Color, pub primary_color_dark: Color, pub primary_color_light: Color, pub scaffold_background_color: Color, pub secondary_header_color: Color, pub shadow_color: Color, pub splash_color: Color, pub unselected_widget_color: Color, pub icon_theme: IconThemeData, pub primary_icon_theme: IconThemeData, pub primary_text_theme: TextTheme, pub text_theme: TextTheme, pub typography: Typography, pub action_icon_theme: Option<ActionIconThemeData>, pub app_bar_theme: AppBarThemeData, pub badge_theme: BadgeThemeData, pub banner_theme: MaterialBannerThemeData, pub bottom_navigation_bar_theme: BottomNavigationBarThemeData, pub bottom_sheet_theme: BottomSheetThemeData, pub button_theme: ButtonThemeData, pub card_theme: CardThemeData, pub carousel_view_theme: CarouselViewThemeData, pub checkbox_theme: CheckboxThemeData, pub chip_theme: ChipThemeData, pub data_table_theme: DataTableThemeData, pub date_picker_theme: DatePickerThemeData, pub dialog_theme: DialogThemeData, pub divider_theme: DividerThemeData, pub drawer_theme: DrawerThemeData, pub dropdown_menu_theme: DropdownMenuThemeData, pub elevated_button_theme: ElevatedButtonThemeData, pub expansion_tile_theme: ExpansionTileThemeData, pub filled_button_theme: FilledButtonThemeData, pub floating_action_button_theme: FloatingActionButtonThemeData, pub icon_button_theme: IconButtonThemeData, pub list_tile_theme: ListTileThemeData, pub menu_bar_theme: MenuBarThemeData, pub menu_button_theme: MenuButtonThemeData, pub menu_theme: MenuThemeData, pub navigation_bar_theme: NavigationBarThemeData, pub navigation_drawer_theme: NavigationDrawerThemeData, pub navigation_rail_theme: NavigationRailThemeData, pub outlined_button_theme: OutlinedButtonThemeData, pub popup_menu_theme: PopupMenuThemeData, pub progress_indicator_theme: ProgressIndicatorThemeData, pub radio_theme: RadioThemeData, pub search_bar_theme: SearchBarThemeData, pub search_view_theme: SearchViewThemeData, pub segmented_button_theme: SegmentedButtonThemeData, pub slider_theme: SliderThemeData, pub snack_bar_theme: SnackBarThemeData, pub switch_theme: SwitchThemeData, pub tab_bar_theme: TabBarThemeData, pub text_button_theme: TextButtonThemeData, pub text_selection_theme: TextSelectionThemeData, pub time_picker_theme: TimePickerThemeData, pub toggle_buttons_theme: ToggleButtonsThemeData, pub tooltip_theme: TooltipThemeData, pub button_bar_theme: ButtonBarThemeData, pub dialog_background_color: Color, pub indicator_color: Color,
}
Expand description

Defines the configuration of the overall visual Theme for a MaterialApp or a widget subtree within the app.

The MaterialApp theme property can be used to configure the appearance of the entire app. Widget subtrees within an app can override the app’s theme by including a Theme widget at the top of the subtree.

Widgets whose appearance should align with the overall theme can obtain the current theme’s configuration with Theme::of. Material components typically depend exclusively on the color_scheme and text_theme. These properties are guaranteed to have non-null values.

The static Theme::of method finds the ThemeData value specified for the nearest BuildContext ancestor. This lookup is inexpensive, essentially just a single HashMap access. It can sometimes be a little confusing because Theme::of can not see a Theme widget that is defined in the current build method’s context. To overcome that, create a new custom widget for the subtree that appears below the new Theme, or insert a widget that creates a new BuildContext, like Builder.

See https://material.io/design/color/ for more discussion on how to pick the right colors.

Dart’s factory constructor is ThemeData::builder; ThemeData.raw, which takes every value exactly, is the struct literal.

Fields§

§apply_elevation_overlay_color: bool

Apply a semi-transparent overlay color on Material surfaces to indicate elevation for dark themes.

If use_material3 is true, then this flag is ignored as there is a new Material.surfaceTintColor used to create an overlay for Material 3. This flag is meant only for the Material 2 elevation overlay for dark themes.

Material drop shadows can be difficult to see in a dark theme, so the elevation of a surface should be portrayed with an “overlay” in addition to the shadow. As the elevation of the component increases, the overlay increases in opacity. apply_elevation_overlay_color turns the application of this overlay on or off for dark themes.

If true and brightness is Brightness::Dark, a semi-transparent version of ColorScheme.on_surface will be applied on top of Material widgets that have a ColorScheme.surface color. The level of transparency is based on Material.elevation as per the Material Dark theme specification.

If false the surface color will be used unmodified.

Defaults to false in order to maintain backwards compatibility with apps that were built before the Material Dark theme specification was published. New apps should set this to true for any themes where brightness is Brightness::Dark.

See also:

  • Material.elevation, which effects the level of transparency of the overlay color.
  • ElevationOverlay.applyOverlay, which is used by Material to apply the overlay color to its surface color.
  • https://material.io/design/color/dark-theme.html, which specifies how the overlay should be applied.
§cupertino_override_theme: Option<NoDefaultCupertinoThemeData>

Components of the CupertinoThemeData to override from the Material ThemeData adaptation.

By default, cupertino_override_theme is null and Cupertino widgets descendant to the Material Theme will adhere to a CupertinoTheme derived from the Material ThemeData. e.g. ThemeData’s ColorScheme will also inform the CupertinoThemeData’s primary_color etc.

This cascading effect for individual attributes of the CupertinoThemeData can be overridden using attributes of this cupertino_override_theme.

§extensions: IndexMap<TypeId, ThemeExtensionRef>

Arbitrary additions to this theme.

To define extensions, pass one or more ThemeExtensions to ThemeDataBuilder::extensions or ThemeDataCopyWith::extensions.

To obtain an extension, use extension.

See also:

  • extension, a convenience function for obtaining a specific extension.
§adaptation_map: IndexMap<TypeId, AdaptationRef>

A map which contains the adaptations for the theme. The entry’s key is the type of the adaptation; the value is the adaptation itself.

To obtain an adaptation, use get_adaptation.

§input_decoration_theme: InputDecorationThemeData

The default InputDecoration values for InputDecorator, TextField, and TextFormField are based on this theme.

See InputDecoration::apply_defaults.

§material_tap_target_size: MaterialTapTargetSize

Configures the hit test size of certain Material widgets.

Defaults to a platform-appropriate size: MaterialTapTargetSize::Padded on mobile platforms, MaterialTapTargetSize::ShrinkWrap on desktop platforms.

§page_transitions_theme: PageTransitionsTheme

Default MaterialPageRoute transitions per TargetPlatform.

MaterialPageRoute::build_transitions delegates to a platform specific PageTransitionsBuilder. If a matching builder is not found, a builder whose platform is null is used.

§platform: TargetPlatform

The platform the material widgets should adapt to target.

Defaults to the current platform, as exposed by defaultTargetPlatform (app.platform().target_platform()). This should be used in order to style UI elements according to platform conventions.

Widgets from the material library should use this getter (via Theme::of) to determine the current platform for the purpose of emulating the platform behavior (e.g. scrolling or haptic effects). Widgets and render objects at lower layers that try to emulate the underlying platform can depend on defaultTargetPlatform directly, or may require that the target platform be provided as an argument.

Determines the defaults for typography and material_tap_target_size.

§scrollbar_theme: ScrollbarThemeData

A theme for customizing the colors, thickness, and shape of Scrollbars.

§splash_factory: InteractiveInkFeatureFactoryRef

Defines the appearance of ink splashes produces by InkWell and InkResponse.

See also:

§use_material3: bool

A temporary flag that can be used to opt-out of Material 3 features.

This flag is true by default. If false, then components will continue to use the colors, typography and other features of Material 2.

In the long run this flag will be deprecated and eventually only Material 3 will be supported. We recommend that applications migrate to Material 3 as soon as that’s practical. Until that migration is complete, this flag can be set to false.

§Defaults

If a ThemeData is constructed with use_material3 set to true, then some properties will get updated defaults. However, the ThemeData::copy_with method with use_material3 set to true will not change any of these properties in the resulting ThemeData.

PropertyMaterial 3 defaultMaterial 2 default
color_schemeM3 baseline light color schemeM2 baseline light color scheme
typographyTypography::material2021Typography::material2014
splash_factoryInkSparkle* or InkRippleInkSplash

* if the target platform is Android and the app is not running on the web, otherwise it will fallback to InkRipple.

If brightness is Brightness::Dark then the default color scheme will be either the M3 baseline dark color scheme or the M2 baseline dark color scheme depending on use_material3.

See also:

§visual_density: VisualDensity

The density value for specifying the compactness of various UI components.

Density, in the context of a UI, is the vertical and horizontal “compactness” of the elements in the UI. It is unitless, since it means different things to different UI elements. For buttons, it affects the spacing around the centered label of the button. For lists, it affects the distance between baselines of entries in the list.

Typically, density values are integral, but any value in range may be used. The range includes values from VisualDensity::MINIMUM_DENSITY (which is -4), to VisualDensity::MAXIMUM_DENSITY (which is 4), inclusive, where negative values indicate a denser, more compact, UI, and positive values indicate a less dense, more expanded, UI. If a component doesn’t support the value given, it will clamp to the nearest supported value.

The default for visual densities is zero for both vertical and horizontal densities, which corresponds to the default visual density of components in the Material Design specification.

As a rule of thumb, a change of 1 or -1 in density corresponds to 4 logical pixels. However, this is not a strict relationship since components interpret the density values appropriately for their needs.

A larger value translates to a spacing increase (less dense), and a smaller value translates to a spacing decrease (more dense).

In Material Design 3, the visual_density does not override the default visual for the following components which are set to VisualDensity::STANDARD for all platforms:

  • IconButton - To override the default value of IconButton.visualDensity, use ThemeData.iconButtonTheme instead.
  • Checkbox - To override the default value of Checkbox.visualDensity, use ThemeData.checkboxTheme instead.
§canvas_color: Color

The default color of MaterialType.canvas Material.

§card_color: Color

The color of Material when it is used as a Card.

§color_scheme: ColorScheme

A set of 45 colors based on the Material spec that can be used to configure the color properties of most components.

This property was added much later than the theme’s set of highly specific colors, like card_color, canvas_color etc. New components can be defined exclusively in terms of color_scheme. Existing components will gradually migrate to it, to the extent that is possible without significant backwards compatibility breaks.

§disabled_color: Color

The color used for widgets that are inoperative, regardless of their state. For example, a disabled checkbox (which may be checked or unchecked).

§divider_color: Color

The color of Dividers and PopupMenuDividers, also used between ListTiles, between rows in DataTables, and so forth.

To create an appropriate BorderSide that uses this color, consider Divider.createBorderSide.

§focus_color: Color

The focus color used indicate that a component has the input focus.

§highlight_color: Color

The highlight color used during ink splash animations or to indicate an item in a menu is selected.

§hint_color: Color

The color to use for hint text or placeholder text, e.g. in TextField fields.

§hover_color: Color

The hover color used to indicate when a pointer is hovering over a component.

§primary_color: Color

The background color for major parts of the app (toolbars, tab bars, etc)

The theme’s color_scheme property contains ColorScheme.primary, as well as a color that contrasts well with the primary color called ColorScheme.on_primary. It might be simpler to just configure an app’s visuals in terms of the theme’s color_scheme.

§primary_color_dark: Color

A darker version of the primary_color.

§primary_color_light: Color

A lighter version of the primary_color.

§scaffold_background_color: Color

The default color of the Material that underlies the Scaffold. The background color for a typical material app or a page within the app.

§secondary_header_color: Color

The color of the header of a PaginatedDataTable when there are selected rows.

§shadow_color: Color

The color that the Material widget uses to draw elevation shadows.

Defaults to fully opaque black.

Shadows can be difficult to see in a dark theme, so the elevation of a surface should be rendered with an “overlay” in addition to the shadow. As the elevation of the component increases, the overlay increases in opacity. The apply_elevation_overlay_color property turns the elevation overlay on or off for dark themes.

§splash_color: Color

The color of ink splashes.

See also:

  • splashFactory, which defines the appearance of the splash.
§unselected_widget_color: Color

The color used for widgets in their inactive (but enabled) state. For example, an unchecked checkbox. See also disabled_color.

§icon_theme: IconThemeData

An icon theme that contrasts with the card and canvas colors.

§primary_icon_theme: IconThemeData

An icon theme that contrasts with the primary color.

§primary_text_theme: TextTheme

A text theme that contrasts with the primary color.

§text_theme: TextTheme

Text with a color that contrasts with the card and canvas colors.

§typography: Typography

The color and geometry TextTheme values used to configure text_theme.

Defaults to a platform-appropriate typography.

§action_icon_theme: Option<ActionIconThemeData>

A theme for customizing icons of BackButton, CloseButton, DrawerButton, and EndDrawerButton.

§app_bar_theme: AppBarThemeData

A theme for customizing the color, elevation, brightness, iconTheme and textTheme of AppBars.

§badge_theme: BadgeThemeData

A theme for customizing the color, shape, and size of a Badge.

§banner_theme: MaterialBannerThemeData

A theme for customizing the color and text style of a MaterialBanner.

§bottom_navigation_bar_theme: BottomNavigationBarThemeData

A theme for customizing the appearance and layout of BottomNavigationBar widgets.

§bottom_sheet_theme: BottomSheetThemeData

A theme for customizing the color, elevation, and shape of a bottom sheet.

§button_theme: ButtonThemeData

Defines the default configuration of button widgets, like DropdownButton and ButtonBar.

§card_theme: CardThemeData

A theme for customizing the color, elevation, and shape of a Card.

This is the value returned from CardTheme::of.

§carousel_view_theme: CarouselViewThemeData

A theme for customizing the visual properties of CarouselView.

§checkbox_theme: CheckboxThemeData

A theme for customizing the appearance and layout of Checkbox widgets.

§chip_theme: ChipThemeData

A theme for customizing the appearance and layout of Chip widgets.

This is the value returned from ChipTheme::of.

§data_table_theme: DataTableThemeData

A theme for customizing the appearance and layout of DataTable widgets.

This is the value returned from DataTableTheme::of.

§date_picker_theme: DatePickerThemeData

A theme for customizing the appearance and layout of DatePickerDialog widgets.

This is the value returned from DatePickerTheme::of.

§dialog_theme: DialogThemeData

A theme for customizing the shape of a dialog.

§divider_theme: DividerThemeData

A theme for customizing the appearance of Dividers, VerticalDividers, dividers between ListTiles, and dividers between rows in DataTables.

§drawer_theme: DrawerThemeData

A theme for customizing the appearance and layout of Drawer widgets.

§dropdown_menu_theme: DropdownMenuThemeData

A theme for customizing the appearance and layout of DropdownMenu widgets.

§elevated_button_theme: ElevatedButtonThemeData

A theme for customizing the appearance and internal layout of ElevatedButtons.

§expansion_tile_theme: ExpansionTileThemeData

A theme for customizing the visual properties of ExpansionTiles.

§filled_button_theme: FilledButtonThemeData

A theme for customizing the appearance and internal layout of FilledButtons.

§floating_action_button_theme: FloatingActionButtonThemeData

A theme for customizing the shape, elevation, and color of a FloatingActionButton.

§icon_button_theme: IconButtonThemeData

A theme for customizing the appearance and internal layout of IconButtons.

§list_tile_theme: ListTileThemeData

A theme for customizing the appearance of ListTile widgets.

§menu_bar_theme: MenuBarThemeData

A theme for customizing the color, shape, elevation, and other MenuStyle aspects of the menu bar created by the MenuBar widget.

§menu_button_theme: MenuButtonThemeData

A theme for customizing the color, shape, elevation, and text style of cascading menu buttons created by SubmenuButton or MenuItemButton.

§menu_theme: MenuThemeData

A theme for customizing the color, shape, elevation, and other MenuStyle attributes of menus created by the SubmenuButton widget.

§navigation_bar_theme: NavigationBarThemeData

A theme for customizing the background color, text style, and icon themes of a NavigationBar.

§navigation_drawer_theme: NavigationDrawerThemeData

A theme for customizing the background color, text style, and icon themes of a NavigationDrawer.

§navigation_rail_theme: NavigationRailThemeData

A theme for customizing the background color, elevation, text style, and icon themes of a NavigationRail.

§outlined_button_theme: OutlinedButtonThemeData

A theme for customizing the appearance and internal layout of OutlinedButtons.

§popup_menu_theme: PopupMenuThemeData

A theme for customizing the color, shape, elevation, and text style of popup menus.

§progress_indicator_theme: ProgressIndicatorThemeData

A theme for customizing the appearance and layout of ProgressIndicator widgets.

§radio_theme: RadioThemeData

A theme for customizing the appearance and layout of Radio widgets.

§search_bar_theme: SearchBarThemeData

A theme for customizing the appearance and layout of SearchBar widgets.

§search_view_theme: SearchViewThemeData

A theme for customizing the appearance and layout of search views created by SearchAnchor widgets.

§segmented_button_theme: SegmentedButtonThemeData

A theme for customizing the appearance and layout of SegmentedButton widgets.

§slider_theme: SliderThemeData

The colors and shapes used to render Slider.

This is the value returned from SliderTheme::of.

§snack_bar_theme: SnackBarThemeData

A theme for customizing colors, shape, elevation, and behavior of a SnackBar.

§switch_theme: SwitchThemeData

A theme for customizing the appearance and layout of Switch widgets.

§tab_bar_theme: TabBarThemeData

A theme for customizing the size, shape, and color of the tab bar indicator.

§text_button_theme: TextButtonThemeData

A theme for customizing the appearance and internal layout of TextButtons.

§text_selection_theme: TextSelectionThemeData

A theme for customizing the appearance for text selection in TextField and SelectableText widgets.

§time_picker_theme: TimePickerThemeData

A theme for customizing the appearance and layout of time pickers (showTimePicker).

§toggle_buttons_theme: ToggleButtonsThemeData

Defines the default configuration of ToggleButtons widgets.

§tooltip_theme: TooltipThemeData

A theme for customizing the appearance and layout of Tooltip widgets.

§button_bar_theme: ButtonBarThemeData
👎Deprecated:

Use OverflowBar instead. This feature was deprecated after v3.21.0-10.0.pre.

A theme for customizing the appearance and layout of ButtonBar widgets.

§dialog_background_color: Color
👎Deprecated:

Use DialogThemeData.backgroundColor instead. This feature was deprecated after v3.27.0-0.1.pre.

The background color of Dialog elements.

§indicator_color: Color
👎Deprecated:

Use TabBarThemeData.indicatorColor instead. This feature was deprecated after v3.28.0-1.0.pre.

The color of the selected tab indicator in a tab bar.

Implementations§

Source§

impl ThemeData

Source

pub fn builder() -> ThemeDataBuilder

Create a ThemeData that’s used to configure a Theme.

The color_scheme and text_theme are used by the Material components to compute default values for visual properties. The API documentation for each component widget explains exactly how the defaults are computed.

When providing a ColorScheme, apps can either provide one directly with the color_scheme parameter, or have one generated for them. A provided color_scheme is used directly and is not affected by brightness, color_scheme_seed, or contrast_level.

If a color_scheme_seed is provided, ColorScheme::from_seed generates the color scheme from color_scheme_seed, brightness, and contrast_level. In this case, contrast_level can be any value between -1.0 and 1.0 inclusive. All of the color scheme’s contrasting colors will meet accessibility guidelines for readability. (See ColorScheme::from_seed for more details.)

If color_scheme_seed is null, use brightness and contrast_level to select a token-backed Material 3 baseline color scheme. Use ContrastLevel::STANDARD, ContrastLevel::MEDIUM, or ContrastLevel::HIGH to choose between the standard, medium, and high contrast baselines. Other custom contrast_level values, such as 0.6, require a color_scheme_seed.

If the app wants to customize a generated color scheme, it can use ColorScheme::from_seed directly and then ColorScheme::copy_with on the result to override any colors that need to be replaced. The result of this can be used as the color_scheme directly.

For historical reasons, instead of using a color_scheme_seed or color_scheme, you can provide either a primary_color or primary_swatch to construct the color_scheme, but the results will not be as complete as when using generation from a seed color.

If color_scheme_seed is non-null then color_scheme, primary_color and primary_swatch must all be null.

The text_theme TextStyle colors are black if the color scheme’s brightness is Brightness::Light, and white for Brightness::Dark.

See also:

Source

pub fn new(app: &App) -> ThemeData

Dart’s ThemeData(): builder with no arguments.

Source

pub fn from(color_scheme: ColorScheme) -> ThemeDataFromBuilder

Create a ThemeData based on the colors in the given color_scheme and text styles of the optional text_theme.

If color_scheme.brightness is Brightness::Dark then apply_elevation_overlay_color will be set to true to support the Material dark theme method for indicating elevation by applying a semi-transparent on_surface color on top of the surface color.

This is the recommended method to theme your application. As we move forward we will be converting all the widget implementations to only use colors or colors derived from those in ColorScheme.

See https://material.io/design/color/ for more discussion on how to pick the right colors.

Source

pub fn light(app: &App, use_material3: Option<bool>) -> ThemeData

A default light theme.

This theme does not contain text geometry. Instead, it is expected that this theme is localized using text geometry using ThemeData::localize.

Source

pub fn dark(app: &App, use_material3: Option<bool>) -> ThemeData

A default dark theme.

This theme does not contain text geometry. Instead, it is expected that this theme is localized using text geometry using ThemeData::localize.

Source

pub fn fallback(app: &App, use_material3: Option<bool>) -> ThemeData

The default color theme. Same as ThemeData::light.

This is used by Theme::of when no theme has been specified.

This theme does not contain text geometry. Instead, it is expected that this theme is localized using text geometry using ThemeData::localize.

Most applications would use Theme::of, which provides correct localized text geometry.

Source

pub fn get_adaptation<T: 'static>(&self) -> Option<&dyn Adaptation<T>>

Used to obtain a particular Adaptation from adaptation_map.

To get an adaptation, use Theme::of(app, context).get_adaptation::<MyAdaptation>().

Source

pub fn brightness(&self) -> Brightness

The overall theme brightness.

The default TextStyle color for the text_theme is black if the theme is constructed with Brightness::Light and white if the theme is constructed with Brightness::Dark.

Source

pub fn extension<T: ThemeExtension>(&self) -> Option<&T>

Used to obtain a particular ThemeExtension from extensions.

Obtain with Theme::of(app, context).extension::<MyThemeExtension>().

Source

pub fn copy_with(&self) -> ThemeDataCopyWith

Creates a copy of this theme but with the given fields replaced with the new values.

The brightness value is applied to the color_scheme.

Dart’s named arguments are the setters of the returned ThemeDataCopyWith, then ThemeDataCopyWith::build.

Source

pub fn localize( app: &mut App, base_theme: &Rc<ThemeData>, local_text_geometry: &Rc<TextTheme>, ) -> Rc<ThemeData>

Returns a new theme built by merging the text geometry provided by the local_text_geometry theme with the base_theme.

For those text styles in the base_theme whose TextStyle::inherit is set to true, the returned theme’s text styles inherit the geometric properties of local_text_geometry. The resulting text styles’ inherit is set to those provided by local_text_geometry.

Source

pub fn estimate_brightness_for_color(color: Color) -> Brightness

Determines whether the given Color is Brightness::Light or Brightness::Dark.

This compares the luminosity of the given color to a threshold value that matches the Material Design specification.

Source

pub fn lerp(a: &ThemeData, b: &ThemeData, t: f64) -> ThemeData

Linearly interpolate between two themes.

{@macro dart.ui.shadow.lerp}

Trait Implementations§

Source§

impl Clone for ThemeData

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ThemeData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Diagnosticable for ThemeData

Source§

fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)

Add additional properties associated with the node.
Source§

fn type_name(&self) -> &'static str

Dart’s Object.runtimeType as diagnostics print it: the last segment of the Rust type path, without generic arguments.
Source§

fn identity_hash(&self) -> u64

Dart’s Object.hashCode as diagnostics print it: the object’s address.
Source§

fn to_string_short(&self) -> String

A brief description of this object, usually just the type and the hash.
Source§

fn to_diagnostics_node(&self) -> DiagnosticableNode

Returns a debug representation of the object used by debugging tools and by DiagnosticsNode::to_string_deep.
Source§

fn to_diagnostics_node_with( &self, name: Option<String>, style: Option<DiagnosticsTreeStyle>, ) -> DiagnosticableNode

Dart toDiagnosticsNode(name:, style:).
Source§

fn to_string(&self) -> String

Dart’s toString: a single-line description with properties and no children. Read more
Source§

fn to_string_at(&self, min_level: DiagnosticLevel) -> String

Dart’s toString(minLevel:).
Source§

impl Display for ThemeData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ThemeData

Source§

fn eq(&self, other: &ThemeData) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl TweenValue for ThemeData

Source§

fn same(&self, other: &ThemeData) -> bool

Dart’s == between a widget’s target value and a tween endpoint.

Auto Trait Implementations§

§

impl !RefUnwindSafe for ThemeData

§

impl !Send for ThemeData

§

impl !Sync for ThemeData

§

impl !UnwindSafe for ThemeData

§

impl Forget for ThemeData

§

impl Freeze for ThemeData
where &'static dyn ColorExtension: Freeze, *const RcInner<dyn ColorExtension> is !null: Freeze, PhantomData<RcInner<dyn ColorExtension>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<String>: Freeze, *const RcInner<Paint> is !null: Freeze, PhantomData<RcInner<Paint>>: Freeze, PhantomData<Shadow>: Freeze, PhantomData<FontFeature>: Freeze, PhantomData<FontVariation>: Freeze, PhantomData<usize>: Freeze, PhantomData<Bucket<TypeId, Rc<dyn ThemeExtension>>>: Freeze, PhantomData<Bucket<TypeId, AdaptationRef>>: Freeze, *const RcInner<dyn TextStyleExtension> is !null: Freeze, PhantomData<RcInner<dyn TextStyleExtension>>: Freeze, *const RcInner<dyn BorderSideExtension> is !null: Freeze, PhantomData<RcInner<dyn BorderSideExtension>>: Freeze, *const RcInner<dyn InputBorder> is !null: Freeze, PhantomData<RcInner<dyn InputBorder>>: Freeze, *const RcInner<IndexMap<TargetPlatform, PageTransitionsBuilderRef>> is !null: Freeze, PhantomData<RcInner<IndexMap<TargetPlatform, PageTransitionsBuilderRef>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<bool>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<bool>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<f64>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<f64>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<Color>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<Color>>>>: Freeze, *const RcInner<dyn InteractiveInkFeatureFactory> is !null: Freeze, PhantomData<RcInner<dyn InteractiveInkFeatureFactory>>: Freeze, *const RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData> is !null: Freeze, PhantomData<RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData>>: Freeze, *const RcInner<TextTheme> is !null: Freeze, PhantomData<RcInner<TextTheme>>: Freeze, *const RcInner<dyn Fn(&mut App, AnyElement) -> Rc<dyn Widget>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, AnyElement) -> Rc<dyn Widget>>>: Freeze, *const RcInner<dyn ShapeBorder> is !null: Freeze, PhantomData<RcInner<dyn ShapeBorder>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>>>: Freeze, *const RcInner<dyn OutlinedBorder> is !null: Freeze, PhantomData<RcInner<dyn OutlinedBorder>>: Freeze, *const RcInner<dyn Decoration> is !null: Freeze, PhantomData<RcInner<dyn Decoration>>: Freeze, *const RcInner<dyn Fn(&mut App, AnyElement, bool, bool) -> Rc<dyn Widget>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, bool, bool) -> Rc<dyn Widget>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<OutlinedBorderRef>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<OutlinedBorderRef>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<TextStyle>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<TextStyle>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<Size>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<Size>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<BorderSide>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<BorderSide>>>>: Freeze, *const RcInner<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>>>: Freeze, *const (): Freeze, *const RcInner<dyn Curve> is !null: Freeze, PhantomData<RcInner<dyn Curve>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<Rc<dyn Widget>>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<dyn Widget>>>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<IconThemeData>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<IconThemeData>>>>: Freeze, NonZero<u32>: Freeze, PhantomData<fn() -> AnimationController>: Freeze, *const RcInner<Keep> is !null: Freeze, PhantomData<RcInner<Keep>>: Freeze, *const RcInner<dyn Widget> is !null: Freeze, PhantomData<RcInner<dyn Widget>>: Freeze, *const RcInner<dyn SliderComponentShape> is !null: Freeze, PhantomData<RcInner<dyn SliderComponentShape>>: Freeze, *const RcInner<dyn SliderTickMarkShape> is !null: Freeze, PhantomData<RcInner<dyn SliderTickMarkShape>>: Freeze, *const RcInner<dyn SliderTrackShape> is !null: Freeze, PhantomData<RcInner<dyn SliderTrackShape>>: Freeze, *const RcInner<dyn RangeSliderTickMarkShape> is !null: Freeze, PhantomData<RcInner<dyn RangeSliderTickMarkShape>>: Freeze, *const RcInner<dyn RangeSliderThumbShape> is !null: Freeze, PhantomData<RcInner<dyn RangeSliderThumbShape>>: Freeze, *const RcInner<dyn RangeSliderTrackShape> is !null: Freeze, PhantomData<RcInner<dyn RangeSliderTrackShape>>: Freeze, *const RcInner<dyn RangeSliderValueIndicatorShape> is !null: Freeze, PhantomData<RcInner<dyn RangeSliderValueIndicatorShape>>: Freeze, *const RcInner<dyn Fn(TextDirection, RangeValues, f64, Size, Size, f64) -> Option<Thumb>> is !null: Freeze, PhantomData<RcInner<dyn Fn(TextDirection, RangeValues, f64, Size, Size, f64) -> Option<Thumb>>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<Rc<Icon>>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<Icon>>>>>: Freeze, *const TextScaler is !null: Freeze, PhantomData<TextScaler>: Freeze,

§

impl Move for ThemeData

§

impl Unpin for ThemeData
where &'static dyn ColorExtension: Unpin, Rc<dyn ColorExtension>: Unpin, *const u8 is !null: Unpin, Rc<Paint>: Unpin, *const (): Unpin, Rc<dyn ThemeExtension>: Unpin, Rc<dyn ErasedAdaptation>: Unpin, Rc<dyn TextStyleExtension>: Unpin, Rc<dyn BorderSideExtension>: Unpin, Rc<dyn InputBorder>: Unpin, Rc<IndexMap<TargetPlatform, PageTransitionsBuilderRef>>: Unpin, Rc<dyn WidgetStateProperty<Option<bool>>>: Unpin, Rc<dyn WidgetStateProperty<Option<f64>>>: Unpin, Rc<dyn WidgetStateProperty<Option<Color>>>: Unpin, Rc<dyn InteractiveInkFeatureFactory>: Unpin, Rc<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData>: Unpin, Rc<TextTheme>: Unpin, Rc<dyn Fn(&mut App, AnyElement) -> Rc<dyn Widget>>: Unpin, Rc<dyn ShapeBorder>: Unpin, Rc<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>>: Unpin, Rc<dyn OutlinedBorder>: Unpin, Rc<dyn Decoration>: Unpin, Rc<dyn Fn(&mut App, AnyElement, bool, bool) -> Rc<dyn Widget>>: Unpin, Rc<dyn WidgetStateProperty<Option<OutlinedBorderRef>>>: Unpin, Rc<dyn WidgetStateProperty<Option<TextStyle>>>: Unpin, Rc<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>>: Unpin, Rc<dyn WidgetStateProperty<Option<Size>>>: Unpin, Rc<dyn WidgetStateProperty<Option<BorderSide>>>: Unpin, Rc<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>>: Unpin, Rc<dyn Curve>: Unpin, Rc<dyn WidgetStateProperty<Option<Rc<dyn Widget>>>>: Unpin, Rc<dyn WidgetStateProperty<Option<IconThemeData>>>: Unpin, NonZero<u32>: Unpin, Rc<Keep>: Unpin, Rc<dyn Widget>: Unpin, Rc<dyn SliderComponentShape>: Unpin, Rc<dyn SliderTickMarkShape>: Unpin, Rc<dyn SliderTrackShape>: Unpin, Rc<dyn RangeSliderTickMarkShape>: Unpin, Rc<dyn RangeSliderThumbShape>: Unpin, Rc<dyn RangeSliderTrackShape>: Unpin, Rc<dyn RangeSliderValueIndicatorShape>: Unpin, Rc<dyn Fn(TextDirection, RangeValues, f64, Size, Size, f64) -> Option<Thumb>>: Unpin, Rc<dyn WidgetStateProperty<Option<Rc<Icon>>>>: Unpin, Box<TextScaler>: Unpin,

§

impl UnsafeUnpin for ThemeData
where &'static dyn ColorExtension: UnsafeUnpin, *const RcInner<dyn ColorExtension> is !null: UnsafeUnpin, PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin, *const RcInner<Paint> is !null: UnsafeUnpin, PhantomData<RcInner<Paint>>: UnsafeUnpin, PhantomData<Shadow>: UnsafeUnpin, PhantomData<FontFeature>: UnsafeUnpin, PhantomData<FontVariation>: UnsafeUnpin, PhantomData<usize>: UnsafeUnpin, PhantomData<Bucket<TypeId, Rc<dyn ThemeExtension>>>: UnsafeUnpin, PhantomData<Bucket<TypeId, AdaptationRef>>: UnsafeUnpin, *const RcInner<dyn TextStyleExtension> is !null: UnsafeUnpin, PhantomData<RcInner<dyn TextStyleExtension>>: UnsafeUnpin, *const RcInner<dyn BorderSideExtension> is !null: UnsafeUnpin, PhantomData<RcInner<dyn BorderSideExtension>>: UnsafeUnpin, *const RcInner<dyn InputBorder> is !null: UnsafeUnpin, PhantomData<RcInner<dyn InputBorder>>: UnsafeUnpin, *const RcInner<IndexMap<TargetPlatform, PageTransitionsBuilderRef>> is !null: UnsafeUnpin, PhantomData<RcInner<IndexMap<TargetPlatform, PageTransitionsBuilderRef>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<bool>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<bool>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<f64>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<f64>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<Color>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<Color>>>>: UnsafeUnpin, *const RcInner<dyn InteractiveInkFeatureFactory> is !null: UnsafeUnpin, PhantomData<RcInner<dyn InteractiveInkFeatureFactory>>: UnsafeUnpin, *const RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData>>: UnsafeUnpin, *const RcInner<TextTheme> is !null: UnsafeUnpin, PhantomData<RcInner<TextTheme>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, AnyElement) -> Rc<dyn Widget>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, AnyElement) -> Rc<dyn Widget>>>: UnsafeUnpin, *const RcInner<dyn ShapeBorder> is !null: UnsafeUnpin, PhantomData<RcInner<dyn ShapeBorder>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>>>: UnsafeUnpin, *const RcInner<dyn OutlinedBorder> is !null: UnsafeUnpin, PhantomData<RcInner<dyn OutlinedBorder>>: UnsafeUnpin, *const RcInner<dyn Decoration> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Decoration>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, AnyElement, bool, bool) -> Rc<dyn Widget>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, bool, bool) -> Rc<dyn Widget>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<OutlinedBorderRef>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<OutlinedBorderRef>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<TextStyle>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<TextStyle>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<EdgeInsetsGeometry>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<Size>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<Size>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<BorderSide>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<BorderSide>>>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, &HashSet<WidgetState>, Option<Rc<dyn Widget>>) -> Rc<dyn Widget>>>: UnsafeUnpin, *const (): UnsafeUnpin, *const RcInner<dyn Curve> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Curve>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<Rc<dyn Widget>>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<dyn Widget>>>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<IconThemeData>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<IconThemeData>>>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, PhantomData<fn() -> AnimationController>: UnsafeUnpin, *const RcInner<Keep> is !null: UnsafeUnpin, PhantomData<RcInner<Keep>>: UnsafeUnpin, *const RcInner<dyn Widget> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Widget>>: UnsafeUnpin, *const RcInner<dyn SliderComponentShape> is !null: UnsafeUnpin, PhantomData<RcInner<dyn SliderComponentShape>>: UnsafeUnpin, *const RcInner<dyn SliderTickMarkShape> is !null: UnsafeUnpin, PhantomData<RcInner<dyn SliderTickMarkShape>>: UnsafeUnpin, *const RcInner<dyn SliderTrackShape> is !null: UnsafeUnpin, PhantomData<RcInner<dyn SliderTrackShape>>: UnsafeUnpin, *const RcInner<dyn RangeSliderTickMarkShape> is !null: UnsafeUnpin, PhantomData<RcInner<dyn RangeSliderTickMarkShape>>: UnsafeUnpin, *const RcInner<dyn RangeSliderThumbShape> is !null: UnsafeUnpin, PhantomData<RcInner<dyn RangeSliderThumbShape>>: UnsafeUnpin, *const RcInner<dyn RangeSliderTrackShape> is !null: UnsafeUnpin, PhantomData<RcInner<dyn RangeSliderTrackShape>>: UnsafeUnpin, *const RcInner<dyn RangeSliderValueIndicatorShape> is !null: UnsafeUnpin, PhantomData<RcInner<dyn RangeSliderValueIndicatorShape>>: UnsafeUnpin, *const RcInner<dyn Fn(TextDirection, RangeValues, f64, Size, Size, f64) -> Option<Thumb>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(TextDirection, RangeValues, f64, Size, Size, f64) -> Option<Thumb>>>: UnsafeUnpin, *const RcInner<dyn WidgetStateProperty<Option<Rc<Icon>>>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<Icon>>>>>: UnsafeUnpin, *const TextScaler is !null: UnsafeUnpin, PhantomData<TextScaler>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>