滚动组件 - TabBar

2023-08-09  本文已影响0人  努力生活的西鱼
TabBar({
   super.key, 
   required this.tabs, // 一般使用tab对象,当然也可以是其他List<Widget>
   this.controller, // 一个TabController对象,用于控制标签的切换和滚动等行为
   this.isScrollable = false, // true,可以通过滑动来切换标签;false,标签宽度会等比分配,不会出现滚动条
   this.padding,
   this.indicatorColor, // 指示器颜色
   this.automaticIndicatorColorAdjustment = true,
   this.indicatorWeight = 2.0, // 指示器的线宽,默认为2.0
   this.indicatorPadding = EdgeInsets.zero, // 指示器的内边距
   this.indicator, // 一个Widget对象,用于自定义指示器的样式
   this.indicatorSize, // TabBarIndicatorSize.label:指示器和文字同宽,TabBarIndicatorSize.tab 与tab同宽
   this.dividerColor,
   this.labelColor, // 选中Tab文字颜色
   this.labelStyle, // 选中Tab文字Style
   this.labelPadding,
   this.unselectedLabelColor, // 未选中Tab中文字颜色
   this.unselectedLabelStyle, // 未选中Tab中文字style
   this.dragStartBehavior = DragStartBehavior.start,
   this.overlayColor,
   this.mouseCursor,
   this.enableFeedback,
   this.onTap, // 点击标签页时的回调函数
   this.physics,
   this.splashFactory,
   this.splashBorderRadius,
  })
上一篇 下一篇

猜你喜欢

热点阅读