pub struct NavigationBarThemeData {
pub 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 label_text_style: Option<WidgetStatePropertyRef<Option<TextStyle>>>,
pub icon_theme: Option<WidgetStatePropertyRef<Option<IconThemeData>>>,
pub label_behavior: Option<NavigationDestinationLabelBehavior>,
pub overlay_color: Option<WidgetStatePropertyRef<Option<Color>>>,
pub label_padding: Option<EdgeInsetsGeometry>,
}Expand description
Defines default property values for descendant NavigationBar
widgets.
Descendant widgets obtain the current NavigationBarThemeData object
using NavigationBarTheme::of. Instances of NavigationBarThemeData can be
customized with NavigationBarThemeData::copy_with.
Typically a NavigationBarThemeData is specified as part of the
overall Theme with ThemeData::navigation_bar_theme. Alternatively, a
NavigationBarTheme inherited widget can be used to theme NavigationBars
in a subtree of widgets.
All NavigationBarThemeData properties are null by default.
When null, the NavigationBar will provide its own defaults based on the
overall Theme’s textTheme and colorScheme. See the individual
NavigationBar properties for details.
See also:
ThemeData, which describes the overall theme information for the application.
Fields§
§height: Option<f64>Overrides the default value of NavigationBar::height.
background_color: Option<Color>Overrides the default value of NavigationBar::background_color.
elevation: Option<f64>Overrides the default value of NavigationBar::elevation.
shadow_color: Option<Color>Overrides the default value of NavigationBar::shadow_color.
surface_tint_color: Option<Color>Overrides the default value of NavigationBar::surface_tint_color.
indicator_color: Option<Color>Overrides the default value of NavigationBar’s selection indicator.
indicator_shape: Option<ShapeBorderRef>Overrides the default shape of the NavigationBar’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.
label_behavior: Option<NavigationDestinationLabelBehavior>Overrides the default value of NavigationBar::label_behavior.
overlay_color: Option<WidgetStatePropertyRef<Option<Color>>>Overrides the default value of NavigationBar::overlay_color.
label_padding: Option<EdgeInsetsGeometry>Overrides the default value of NavigationBar::label_padding.
Implementations§
Sourcepub fn new() -> NavigationBarThemeData
pub fn new() -> NavigationBarThemeData
Creates a theme that can be used for ThemeData::navigation_bar_theme and
NavigationBarTheme; Dart’s optional named arguments are the fluent setters.
Sourcepub fn height(self, height: f64) -> NavigationBarThemeData
pub fn height(self, height: f64) -> NavigationBarThemeData
Dart NavigationBarThemeData(height:).
Sourcepub fn background_color(self, background_color: Color) -> NavigationBarThemeData
pub fn background_color(self, background_color: Color) -> NavigationBarThemeData
Dart NavigationBarThemeData(backgroundColor:).
Sourcepub fn elevation(self, elevation: f64) -> NavigationBarThemeData
pub fn elevation(self, elevation: f64) -> NavigationBarThemeData
Dart NavigationBarThemeData(elevation:).
Sourcepub fn shadow_color(self, shadow_color: Color) -> NavigationBarThemeData
pub fn shadow_color(self, shadow_color: Color) -> NavigationBarThemeData
Dart NavigationBarThemeData(shadowColor:).
Sourcepub fn surface_tint_color(
self,
surface_tint_color: Color,
) -> NavigationBarThemeData
pub fn surface_tint_color( self, surface_tint_color: Color, ) -> NavigationBarThemeData
Dart NavigationBarThemeData(surfaceTintColor:).
Sourcepub fn indicator_color(self, indicator_color: Color) -> NavigationBarThemeData
pub fn indicator_color(self, indicator_color: Color) -> NavigationBarThemeData
Dart NavigationBarThemeData(indicatorColor:).
Sourcepub fn indicator_shape(
self,
indicator_shape: impl Into<ShapeBorderRef>,
) -> NavigationBarThemeData
pub fn indicator_shape( self, indicator_shape: impl Into<ShapeBorderRef>, ) -> NavigationBarThemeData
Dart NavigationBarThemeData(indicatorShape:).
Sourcepub fn label_text_style(
self,
label_text_style: WidgetStatePropertyRef<Option<TextStyle>>,
) -> NavigationBarThemeData
pub fn label_text_style( self, label_text_style: WidgetStatePropertyRef<Option<TextStyle>>, ) -> NavigationBarThemeData
Dart NavigationBarThemeData(labelTextStyle:).
Sourcepub fn icon_theme(
self,
icon_theme: WidgetStatePropertyRef<Option<IconThemeData>>,
) -> NavigationBarThemeData
pub fn icon_theme( self, icon_theme: WidgetStatePropertyRef<Option<IconThemeData>>, ) -> NavigationBarThemeData
Dart NavigationBarThemeData(iconTheme:).
Sourcepub fn label_behavior(
self,
label_behavior: NavigationDestinationLabelBehavior,
) -> NavigationBarThemeData
pub fn label_behavior( self, label_behavior: NavigationDestinationLabelBehavior, ) -> NavigationBarThemeData
Dart NavigationBarThemeData(labelBehavior:).
Sourcepub fn overlay_color(
self,
overlay_color: WidgetStatePropertyRef<Option<Color>>,
) -> NavigationBarThemeData
pub fn overlay_color( self, overlay_color: WidgetStatePropertyRef<Option<Color>>, ) -> NavigationBarThemeData
Dart NavigationBarThemeData(overlayColor:).
Sourcepub fn label_padding(
self,
label_padding: impl Into<EdgeInsetsGeometry>,
) -> NavigationBarThemeData
pub fn label_padding( self, label_padding: impl Into<EdgeInsetsGeometry>, ) -> NavigationBarThemeData
Dart NavigationBarThemeData(labelPadding:).
Sourcepub fn copy_with(&self) -> NavigationBarThemeData
pub fn copy_with(&self) -> NavigationBarThemeData
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().height(64.0)).
Sourcepub fn lerp(
a: Option<&NavigationBarThemeData>,
b: Option<&NavigationBarThemeData>,
t: f64,
) -> Option<NavigationBarThemeData>
pub fn lerp( a: Option<&NavigationBarThemeData>, b: Option<&NavigationBarThemeData>, t: f64, ) -> Option<NavigationBarThemeData>
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 label_behavior(
&self,
app: &mut App,
) -> Option<NavigationDestinationLabelBehavior>
fn label_behavior( &self, app: &mut App, ) -> Option<NavigationDestinationLabelBehavior>
label_behavior getter.Source§fn overlay_color(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<Color>>>
fn overlay_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>
overlay_color getter.Source§fn label_padding(&self, app: &mut App) -> Option<EdgeInsetsGeometry>
fn label_padding(&self, app: &mut App) -> Option<EdgeInsetsGeometry>
label_padding getter.Source§fn copy_with(&self, app: &mut App) -> NavigationBarThemeData
fn copy_with(&self, app: &mut App) -> NavigationBarThemeData
copyWith() with no arguments: a plain value holding what every getter
answers, for the caller’s setters to change.