FluentTabStyle class

The visual configuration of a FluentTab.

Shaped like FluentButtonStyle: every visual property is a WidgetStateProperty, so hover, pressed, selected and disabled values live on the property rather than being branched on at build time.

Every field is nullable and means "inherit". Resolution order, lowest to highest precedence:

  1. the orientation/appearance/size defaults derived from the theme
  2. the nearest FluentTabTheme
  3. the FluentTabList's own style
  4. the tab's own style

The selection indicator

indicatorColor, indicatorThickness, indicatorInset and indicatorRadius describe the bar Figma calls Selector and upstream draws as the tab's ::after pseudo-element. It runs along the bottom edge of a horizontal tab and the leading edge of a vertical one, inset from both ends by indicatorInset. A null indicatorColor — or a zero indicatorThickness — means no bar at all, which is what an unselected tab at rest and every pill-shaped tab paint.

Annotations

Constructors

FluentTabStyle({WidgetStateProperty<Color?>? backgroundColor, WidgetStateProperty<Color?>? foregroundColor, WidgetStateProperty<Color?>? iconColor, WidgetStateProperty<Color?>? borderColor, WidgetStateProperty<double?>? borderWidth, WidgetStateProperty<BorderRadius?>? borderRadius, WidgetStateProperty<BorderRadius?>? focusRingRadius, WidgetStateProperty<TextStyle?>? textStyle, WidgetStateProperty<EdgeInsetsGeometry?>? padding, WidgetStateProperty<double?>? gap, WidgetStateProperty<double?>? iconSize, WidgetStateProperty<Size?>? minimumSize, WidgetStateProperty<Color?>? indicatorColor, WidgetStateProperty<double?>? indicatorThickness, WidgetStateProperty<double?>? indicatorInset, WidgetStateProperty<BorderRadius?>? indicatorRadius, WidgetStateProperty<MouseCursor?>? mouseCursor})
Creates a style. Omitted properties inherit.
const

Properties

backgroundColor WidgetStateProperty<Color?>?
Surface fill.
final
borderColor WidgetStateProperty<Color?>?
Border colour. Null and transparent are different: Fluent's transparentStroke becomes opaque in high contrast.
final
borderRadius WidgetStateProperty<BorderRadius?>?
Corner radius of the tab surface.
final
borderWidth WidgetStateProperty<double?>?
Border width. Zero means no border, which is not the same as a transparent one — a zero-width border cannot become visible in high contrast.
final
focusRingRadius WidgetStateProperty<BorderRadius?>?
Corner radius of the keyboard focus ring.
final
foregroundColor WidgetStateProperty<Color?>?
Label colour.
final
gap WidgetStateProperty<double?>?
Space between icon and label.
final
hashCode int
The hash code for this object.
no setteroverride
iconColor WidgetStateProperty<Color?>?
Icon colour.
final
iconSize WidgetStateProperty<double?>?
Icon edge length.
final
indicatorColor WidgetStateProperty<Color?>?
Selection indicator colour, or null for no indicator.
final
indicatorInset WidgetStateProperty<double?>?
How far the indicator is held back from each end of the tab.
final
indicatorRadius WidgetStateProperty<BorderRadius?>?
Selection indicator corner radius.
final
indicatorThickness WidgetStateProperty<double?>?
Selection indicator thickness. Zero suppresses it.
final
minimumSize WidgetStateProperty<Size?>?
Minimum tap target.
final
mouseCursor WidgetStateProperty<MouseCursor?>?
Cursor while hovering.
final
padding WidgetStateProperty<EdgeInsetsGeometry?>?
Padding inside the border.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textStyle WidgetStateProperty<TextStyle?>?
Label text style. Its colour is overridden by foregroundColor.
final

Methods

copyWith({WidgetStateProperty<Color?>? backgroundColor, WidgetStateProperty<Color?>? foregroundColor, WidgetStateProperty<Color?>? iconColor, WidgetStateProperty<Color?>? borderColor, WidgetStateProperty<double?>? borderWidth, WidgetStateProperty<BorderRadius?>? borderRadius, WidgetStateProperty<BorderRadius?>? focusRingRadius, WidgetStateProperty<TextStyle?>? textStyle, WidgetStateProperty<EdgeInsetsGeometry?>? padding, WidgetStateProperty<double?>? gap, WidgetStateProperty<double?>? iconSize, WidgetStateProperty<Size?>? minimumSize, WidgetStateProperty<Color?>? indicatorColor, WidgetStateProperty<double?>? indicatorThickness, WidgetStateProperty<double?>? indicatorInset, WidgetStateProperty<BorderRadius?>? indicatorRadius, WidgetStateProperty<MouseCursor?>? mouseCursor}) FluentTabStyle
This style with the given properties replaced.
merge(FluentTabStyle? other) FluentTabStyle
This style with the non-null properties of other layered on top.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

from({Color? backgroundColor, Color? foregroundColor, Color? iconColor, Color? borderColor, double? borderWidth, BorderRadius? borderRadius, BorderRadius? focusRingRadius, TextStyle? textStyle, EdgeInsetsGeometry? padding, double? gap, double? iconSize, Size? minimumSize, Color? indicatorColor, double? indicatorThickness, double? indicatorInset, BorderRadius? indicatorRadius, MouseCursor? mouseCursor}) FluentTabStyle
Convenience for the common case of one value across every state.