pub struct NavigationDrawerThemeData {
pub tile_height: Option<f64>,
pub background_color: Option<Color>,
pub elevation: Option<f64>,
pub shadow_color: Option<Color>,
pub surface_tint_color: Option<Color>,
pub indicator_color: Option<Color>,
pub indicator_shape: Option<ShapeBorderRef>,
pub indicator_size: Option<Size>,
pub label_text_style: Option<WidgetStatePropertyRef<Option<TextStyle>>>,
pub icon_theme: Option<WidgetStatePropertyRef<Option<IconThemeData>>>,
}Expand description
Defines default property values for descendant NavigationDrawer
widgets.
Descendant widgets obtain the current NavigationDrawerThemeData object
using NavigationDrawerTheme::of. Instances of NavigationDrawerThemeData
can be customized with NavigationDrawerThemeData::copy_with.
Typically a NavigationDrawerThemeData is specified as part of the
overall Theme with ThemeData::navigation_drawer_theme. Alternatively, a
NavigationDrawerTheme inherited widget can be used to theme NavigationDrawers
in a subtree of widgets.
All NavigationDrawerThemeData properties are null by default.
When null, the NavigationDrawer will provide its own defaults based on the
overall Theme’s textTheme and colorScheme. See the individual
NavigationDrawer properties for details.
See also:
ThemeData, which describes the overall theme information for the application.
Fields§
§tile_height: Option<f64>Overrides the default height of NavigationDrawerDestination.
background_color: Option<Color>Overrides the default value of NavigationDrawer::background_color.
elevation: Option<f64>Overrides the default value of NavigationDrawer::elevation.
shadow_color: Option<Color>Overrides the default value of NavigationDrawer::shadow_color.
surface_tint_color: Option<Color>Overrides the default value of NavigationDrawer::surface_tint_color.
indicator_color: Option<Color>Overrides the default value of NavigationDrawer’s selection indicator.
indicator_shape: Option<ShapeBorderRef>Overrides the default shape of the NavigationDrawer’s selection indicator.
indicator_size: Option<Size>Overrides the default size of the NavigationDrawer’s selection indicator.
label_text_style: Option<WidgetStatePropertyRef<Option<TextStyle>>>The style to merge with the default text style for
NavigationDestination labels.
You can use this to specify a different style when the label is selected.
icon_theme: Option<WidgetStatePropertyRef<Option<IconThemeData>>>The theme to merge with the default icon theme for
NavigationDestination icons.
You can use this to specify a different icon theme when the icon is selected.
Implementations§
Sourcepub fn new() -> NavigationDrawerThemeData
pub fn new() -> NavigationDrawerThemeData
Creates a theme that can be used for ThemeData::navigation_drawer_theme and
NavigationDrawerTheme; Dart’s optional named arguments are the fluent setters.
Sourcepub fn tile_height(self, tile_height: f64) -> NavigationDrawerThemeData
pub fn tile_height(self, tile_height: f64) -> NavigationDrawerThemeData
Dart NavigationDrawerThemeData(tileHeight:).
Sourcepub fn background_color(
self,
background_color: Color,
) -> NavigationDrawerThemeData
pub fn background_color( self, background_color: Color, ) -> NavigationDrawerThemeData
Dart NavigationDrawerThemeData(backgroundColor:).
Sourcepub fn elevation(self, elevation: f64) -> NavigationDrawerThemeData
pub fn elevation(self, elevation: f64) -> NavigationDrawerThemeData
Dart NavigationDrawerThemeData(elevation:).
Sourcepub fn shadow_color(self, shadow_color: Color) -> NavigationDrawerThemeData
pub fn shadow_color(self, shadow_color: Color) -> NavigationDrawerThemeData
Dart NavigationDrawerThemeData(shadowColor:).
Sourcepub fn surface_tint_color(
self,
surface_tint_color: Color,
) -> NavigationDrawerThemeData
pub fn surface_tint_color( self, surface_tint_color: Color, ) -> NavigationDrawerThemeData
Dart NavigationDrawerThemeData(surfaceTintColor:).
Sourcepub fn indicator_color(
self,
indicator_color: Color,
) -> NavigationDrawerThemeData
pub fn indicator_color( self, indicator_color: Color, ) -> NavigationDrawerThemeData
Dart NavigationDrawerThemeData(indicatorColor:).
Sourcepub fn indicator_shape(
self,
indicator_shape: impl Into<ShapeBorderRef>,
) -> NavigationDrawerThemeData
pub fn indicator_shape( self, indicator_shape: impl Into<ShapeBorderRef>, ) -> NavigationDrawerThemeData
Dart NavigationDrawerThemeData(indicatorShape:).
Sourcepub fn indicator_size(self, indicator_size: Size) -> NavigationDrawerThemeData
pub fn indicator_size(self, indicator_size: Size) -> NavigationDrawerThemeData
Dart NavigationDrawerThemeData(indicatorSize:).
Sourcepub fn label_text_style(
self,
label_text_style: WidgetStatePropertyRef<Option<TextStyle>>,
) -> NavigationDrawerThemeData
pub fn label_text_style( self, label_text_style: WidgetStatePropertyRef<Option<TextStyle>>, ) -> NavigationDrawerThemeData
Dart NavigationDrawerThemeData(labelTextStyle:).
Sourcepub fn icon_theme(
self,
icon_theme: WidgetStatePropertyRef<Option<IconThemeData>>,
) -> NavigationDrawerThemeData
pub fn icon_theme( self, icon_theme: WidgetStatePropertyRef<Option<IconThemeData>>, ) -> NavigationDrawerThemeData
Dart NavigationDrawerThemeData(iconTheme:).
Sourcepub fn copy_with(&self) -> NavigationDrawerThemeData
pub fn copy_with(&self) -> NavigationDrawerThemeData
Creates a copy of this object with the given fields replaced with the new values.
Dart’s named arguments are the fluent setters on the copy
(data.copy_with().tile_height(48.0)).
Sourcepub fn lerp(
a: Option<&NavigationDrawerThemeData>,
b: Option<&NavigationDrawerThemeData>,
t: f64,
) -> Option<NavigationDrawerThemeData>
pub fn lerp( a: Option<&NavigationDrawerThemeData>, b: Option<&NavigationDrawerThemeData>, t: f64, ) -> Option<NavigationDrawerThemeData>
Linearly interpolate between two navigation rail themes.
If both arguments are null then null is returned.
{@macro dart.ui.shadow.lerp}
Trait Implementations§
Source§fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Object.runtimeType as diagnostics print it: the last segment of
the Rust type path, without generic arguments.Source§fn identity_hash(&self) -> u64
fn identity_hash(&self) -> u64
Object.hashCode as diagnostics print it: the object’s address.Source§fn to_string_short(&self) -> String
fn to_string_short(&self) -> String
Source§fn to_diagnostics_node(&self) -> DiagnosticableNode
fn to_diagnostics_node(&self) -> DiagnosticableNode
DiagnosticsNode::to_string_deep.Source§fn to_diagnostics_node_with(
&self,
name: Option<String>,
style: Option<DiagnosticsTreeStyle>,
) -> DiagnosticableNode
fn to_diagnostics_node_with( &self, name: Option<String>, style: Option<DiagnosticsTreeStyle>, ) -> DiagnosticableNode
toDiagnosticsNode(name:, style:).Source§fn to_string(&self) -> String
fn to_string(&self) -> String
toString: a single-line description with properties and no
children. Read moreSource§fn to_string_at(&self, min_level: DiagnosticLevel) -> String
fn to_string_at(&self, min_level: DiagnosticLevel) -> String
toString(minLevel:).super(...)
arguments a defaults struct keeps.Source§fn surface_tint_color(&self, app: &mut App) -> Option<Color>
fn surface_tint_color(&self, app: &mut App) -> Option<Color>
surface_tint_color getter.Source§fn indicator_shape(&self, app: &mut App) -> Option<ShapeBorderRef>
fn indicator_shape(&self, app: &mut App) -> Option<ShapeBorderRef>
indicator_shape getter.Source§fn label_text_style(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<TextStyle>>>
fn label_text_style( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<TextStyle>>>
label_text_style getter.Source§fn icon_theme(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<IconThemeData>>>
fn icon_theme( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<IconThemeData>>>
icon_theme getter.Source§fn copy_with(&self, app: &mut App) -> NavigationDrawerThemeData
fn copy_with(&self, app: &mut App) -> NavigationDrawerThemeData
copyWith() with no arguments: a plain value holding what every getter
answers, for the caller’s setters to change.