Skip to main content

TabBarThemeData

Struct TabBarThemeData 

Source
pub struct TabBarThemeData {
Show 17 fields pub indicator: Option<DecorationRef>, pub indicator_color: Option<Color>, pub indicator_size: Option<TabBarIndicatorSize>, pub divider_color: Option<Color>, pub divider_height: Option<f64>, pub label_color: Option<AnyColor>, pub label_padding: Option<EdgeInsetsGeometry>, pub label_style: Option<TextStyle>, pub unselected_label_color: Option<Color>, pub unselected_label_style: Option<TextStyle>, pub overlay_color: Option<WidgetStatePropertyRef<Option<Color>>>, pub splash_factory: Option<InteractiveInkFeatureFactoryRef>, pub mouse_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>, pub tab_alignment: Option<TabAlignment>, pub text_scaler: Option<TextScaler>, pub indicator_animation: Option<TabIndicatorAnimation>, pub splash_border_radius: Option<BorderRadius>,
}
Expand description

Defines default property values for descendant TabBar widgets.

Descendant widgets obtain the current TabBarThemeData object using TabBarTheme::of. Instances of TabBarThemeData can be customized with TabBarThemeData::copy_with.

Typically a TabBarThemeData is specified as part of the overall Theme with ThemeData::tab_bar_theme.

All TabBarThemeData properties are null by default. When null, the TabBar will use the values from ThemeData if they exist, otherwise it will provide its own defaults. See the individual TabBar properties for details.

See also:

  • TabBar, which displays a row of tabs.
  • ThemeData, which describes the overall theme information for the application.

Fields§

§indicator: Option<DecorationRef>

Overrides the default value for TabBar::indicator.

§indicator_color: Option<Color>

Overrides the default value for TabBar::indicator_color.

§indicator_size: Option<TabBarIndicatorSize>

Overrides the default value for TabBar::indicator_size.

§divider_color: Option<Color>

Overrides the default value for TabBar::divider_color.

§divider_height: Option<f64>

Overrides the default value for TabBar::divider_height.

§label_color: Option<AnyColor>

Overrides the default value for TabBar::label_color.

If label_color is a WidgetStateColor, then the effective color will depend on the WidgetState::Selected state, i.e. if the Tab is selected or not. In case of unselected state, this WidgetStateColor’s resolved color will be used even if TabBar::unselected_label_color or unselected_label_color is non-null.

§label_padding: Option<EdgeInsetsGeometry>

Overrides the default value for TabBar::label_padding.

If there are few tabs with both icon and text and few tabs with only icon or text, this padding is vertically adjusted to provide uniform padding to all tabs.

§label_style: Option<TextStyle>

Overrides the default value for TabBar::label_style.

§unselected_label_color: Option<Color>

Overrides the default value for TabBar::unselected_label_color.

§unselected_label_style: Option<TextStyle>

Overrides the default value for TabBar::unselected_label_style.

§overlay_color: Option<WidgetStatePropertyRef<Option<Color>>>

Overrides the default value for TabBar::overlay_color.

§splash_factory: Option<InteractiveInkFeatureFactoryRef>

Overrides the default value for TabBar::splash_factory.

§mouse_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>

The cursor for a mouse pointer when it enters or is hovering over the individual tab widgets.

If TabBar::mouse_cursor is a WidgetStateMouseCursor, WidgetStateProperty::resolve is used for the following WidgetStates:

  • WidgetState::Selected.

If specified, overrides the default value of TabBar::mouse_cursor.

§tab_alignment: Option<TabAlignment>

Overrides the default value for TabBar::tab_alignment.

§text_scaler: Option<TextScaler>

Overrides the default value for TabBar::text_scaler.

§indicator_animation: Option<TabIndicatorAnimation>

Overrides the default value for TabBar::indicator_animation.

§splash_border_radius: Option<BorderRadius>

Defines the clipping radius of splashes that extend outside the bounds of the tab.

Implementations§

Source§

impl TabBarThemeData

Source

pub fn new() -> TabBarThemeData

Creates a tab bar theme that can be used with ThemeData::tab_bar_theme; Dart’s named arguments are the fluent setters.

Source

pub fn indicator(self, indicator: impl Into<DecorationRef>) -> TabBarThemeData

Dart TabBarThemeData(indicator:).

Source

pub fn indicator_color(self, indicator_color: Color) -> TabBarThemeData

Dart TabBarThemeData(indicatorColor:).

Source

pub fn indicator_size( self, indicator_size: TabBarIndicatorSize, ) -> TabBarThemeData

Dart TabBarThemeData(indicatorSize:).

Source

pub fn divider_color(self, divider_color: Color) -> TabBarThemeData

Dart TabBarThemeData(dividerColor:).

Source

pub fn divider_height(self, divider_height: f64) -> TabBarThemeData

Dart TabBarThemeData(dividerHeight:).

Source

pub fn label_color(self, label_color: impl Into<AnyColor>) -> TabBarThemeData

Dart TabBarThemeData(labelColor:).

Source

pub fn label_padding( self, label_padding: impl Into<EdgeInsetsGeometry>, ) -> TabBarThemeData

Dart TabBarThemeData(labelPadding:).

Source

pub fn label_style(self, label_style: TextStyle) -> TabBarThemeData

Dart TabBarThemeData(labelStyle:).

Source

pub fn unselected_label_color( self, unselected_label_color: Color, ) -> TabBarThemeData

Dart TabBarThemeData(unselectedLabelColor:).

Source

pub fn unselected_label_style( self, unselected_label_style: TextStyle, ) -> TabBarThemeData

Dart TabBarThemeData(unselectedLabelStyle:).

Source

pub fn overlay_color( self, overlay_color: WidgetStatePropertyRef<Option<Color>>, ) -> TabBarThemeData

Dart TabBarThemeData(overlayColor:).

Source

pub fn splash_factory( self, splash_factory: InteractiveInkFeatureFactoryRef, ) -> TabBarThemeData

Dart TabBarThemeData(splashFactory:).

Source

pub fn mouse_cursor( self, mouse_cursor: WidgetStatePropertyRef<Option<MouseCursorRef>>, ) -> TabBarThemeData

Dart TabBarThemeData(mouseCursor:).

Source

pub fn tab_alignment(self, tab_alignment: TabAlignment) -> TabBarThemeData

Dart TabBarThemeData(tabAlignment:).

Source

pub fn text_scaler(self, text_scaler: TextScaler) -> TabBarThemeData

Dart TabBarThemeData(textScaler:).

Source

pub fn indicator_animation( self, indicator_animation: TabIndicatorAnimation, ) -> TabBarThemeData

Dart TabBarThemeData(indicatorAnimation:).

Source

pub fn splash_border_radius( self, splash_border_radius: BorderRadius, ) -> TabBarThemeData

Dart TabBarThemeData(splashBorderRadius:).

Source

pub fn copy_with(&self) -> TabBarThemeData

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

Dart’s named arguments are the fluent setters on the copy (data.copy_with().divider_height(2.0)).

Source

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

Linearly interpolate between two tab bar themes.

{@macro dart.ui.shadow.lerp}

Trait Implementations§

Source§

impl Clone for TabBarThemeData

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 TabBarThemeData

Source§

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

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

impl Default for TabBarThemeData

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Diagnosticable for TabBarThemeData

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 TabBarThemeData

Source§

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

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

impl PartialEq for TabBarThemeData

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl TabBarThemeDataGetters for TabBarThemeData

Source§

fn tab_bar_theme_data(&self) -> &TabBarThemeData

The fields Dart’s constructor sets: the struct itself, or the super(...) arguments a defaults struct keeps.
Source§

fn indicator(&self, app: &mut App) -> Option<DecorationRef>

Dart’s indicator getter.
Source§

fn indicator_color(&self, app: &mut App) -> Option<Color>

Dart’s indicator_color getter.
Source§

fn indicator_size(&self, app: &mut App) -> Option<TabBarIndicatorSize>

Dart’s indicator_size getter.
Source§

fn divider_color(&self, app: &mut App) -> Option<Color>

Dart’s divider_color getter.
Source§

fn divider_height(&self, app: &mut App) -> Option<f64>

Dart’s divider_height getter.
Source§

fn label_color(&self, app: &mut App) -> Option<AnyColor>

Dart’s label_color getter.
Source§

fn label_padding(&self, app: &mut App) -> Option<EdgeInsetsGeometry>

Dart’s label_padding getter.
Source§

fn label_style(&self, app: &mut App) -> Option<TextStyle>

Dart’s label_style getter.
Source§

fn unselected_label_color(&self, app: &mut App) -> Option<Color>

Dart’s unselected_label_color getter.
Source§

fn unselected_label_style(&self, app: &mut App) -> Option<TextStyle>

Dart’s unselected_label_style getter.
Source§

fn overlay_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>

Dart’s overlay_color getter.
Source§

fn splash_factory( &self, app: &mut App, ) -> Option<InteractiveInkFeatureFactoryRef>

Dart’s splash_factory getter.
Source§

fn mouse_cursor( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>

Dart’s mouse_cursor getter.
Source§

fn tab_alignment(&self, app: &mut App) -> Option<TabAlignment>

Dart’s tab_alignment getter.
Source§

fn text_scaler(&self, app: &mut App) -> Option<TextScaler>

Dart’s text_scaler getter.
Source§

fn indicator_animation(&self, app: &mut App) -> Option<TabIndicatorAnimation>

Dart’s indicator_animation getter.
Source§

fn splash_border_radius(&self, app: &mut App) -> Option<BorderRadius>

Dart’s splash_border_radius getter.
Source§

fn copy_with(&self, app: &mut App) -> TabBarThemeData

Dart’s copyWith() with no arguments: a plain value holding what every getter answers, for the caller’s setters to change.

Auto Trait Implementations§

§

impl !RefUnwindSafe for TabBarThemeData

§

impl !Send for TabBarThemeData

§

impl !Sync for TabBarThemeData

§

impl !UnwindSafe for TabBarThemeData

§

impl Forget for TabBarThemeData

§

impl Freeze for TabBarThemeData

§

impl Move for TabBarThemeData

§

impl Unpin for TabBarThemeData

§

impl UnsafeUnpin for TabBarThemeData

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>