VTabBarStyle class

VTopTabBar 的样式配置

用法:

VTopTabBar(
  tabModelArr: [...],
  tabTitle: [...],
  style: const VTabBarStyle(
    indicatorMode: VTabIndicatorMode.fixed,
    indicatorWidth: 30,
    labelWeight: FontWeight.bold,
  ),
)

颜色字段为 null 时组件自动走 ColorScheme:

  • indicatorColor / labelColor → colorScheme.primary
  • unselectedLabelColor → colorScheme.onSurfaceVariant
  • bgColor → colorScheme.surfaceContainerLowest

Constructors

VTabBarStyle({VTabIndicatorMode indicatorMode = VTabIndicatorMode.fixed, double indicatorWidth = 25, double indicatorHeight = 5, Color? indicatorColor, double indicatorBottom = 5, double tabHeight = 45, Color? bgColor, Color? labelColor, double labelSize = 13, FontWeight? labelWeight, Color? unselectedLabelColor, double unselectedLabelSize = 13, FontWeight? unselectedLabelWeight})
const

Properties

bgColor Color?
整体背景色,null 时走 colorScheme.surfaceContainerLowest
final
hashCode int
The hash code for this object.
no setterinherited
indicatorBottom double
指示器距 tab 底部的距离
final
indicatorColor Color?
指示器颜色,null 时走 colorScheme.primary
final
indicatorHeight double
指示器高度(线的厚度)
final
indicatorMode VTabIndicatorMode
指示器宽度模式
final
indicatorWidth double
固定模式下的指示器宽度
final
labelColor Color?
选中文字色,null 时走 colorScheme.primary
final
labelSize double
选中文字字号
final
labelWeight FontWeight?
选中文字粗细,null 时不加粗
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tabHeight double
Tab 整体高度
final
unselectedLabelColor Color?
未选中文字色,null 时走 colorScheme.onSurfaceVariant
final
unselectedLabelSize double
未选中文字字号
final
unselectedLabelWeight FontWeight?
未选中文字粗细
final

Methods

copyWith({VTabIndicatorMode? indicatorMode, double? indicatorWidth, double? indicatorHeight, Color? indicatorColor, double? indicatorBottom, double? tabHeight, Color? bgColor, Color? labelColor, double? labelSize, FontWeight? labelWeight, Color? unselectedLabelColor, double? unselectedLabelSize, FontWeight? unselectedLabelWeight}) VTabBarStyle
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.
inherited