TabbarViewPager class

Inheritance

Constructors

TabbarViewPager.new({Key? key, required List<String> tabList, required Widget onPageBuilder(BuildContext context, int index), Widget onTabBuilder(BuildContext context, int index, String title)?, Color tabbarBackground = Colors.white, double tabbarWidth = double.infinity, bool tabbarIsScrollable = true, bool preNextPage = false, Color tabbarIndicatorColor = Colors.blue, Color dividerColor = Colors.transparent, TabBarIndicatorSize tabbarIndicatorSize = TabBarIndicatorSize.label, TextStyle tabbarLabelStyle = const TextStyle(color: Colors.black, fontSize: 16, fontWeight: FontWeight.bold), TextStyle tabbarUnselectedLabelStyle = const TextStyle(color: ColorConfig.black_5c5c5c, fontSize: 16, fontWeight: FontWeight.normal), bool canUserScroll = true, ValueChanged<int>? onPageChanged, ScrollPhysics? physics, PageController? pageController})
快速构建TabBar+ViewPager的组合控件 tabList 标题Tab列表 onPageBuilder page子视图构建器 onTabBuilder tab子视图构建器,为空则使用默认的tab视图 tabbarBackground tabbar的背景颜色,默认白色 tabbarWidth tabbarWidth宽度,默认撑满父容器 tabbarIsScrollable tabbar是否可以滑动,默认可以 preNextPage 是否需要预加载上一页和下一页,默认false tabbarIndicatorColor tabbar指示器(下面的横线)颜色,默认是蓝色 dividerColor 分割线颜色,默认是透明色 tabbarIndicatorSize tabbar指示器(下面的横线)大小模式,默认是TabBarIndicatorSize.label tabbarLabelStyle tabbar选中tab的文字样式 tabbarUnselectedLabelStyle tabbar未选中tab的文字样式 canUserScroll 用户是否可以手动滑动page进行page切换 onPageChanged 页面切换监听 pageController 页面切换控制器

Properties

canUserScroll bool
final
dividerColor Color
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPageBuilder Widget Function(BuildContext context, int index)
final
onPageChanged ValueChanged<int>?
final
onTabBuilder Widget Function(BuildContext context, int index, String title)?
final
pageController PageController
final
physics ScrollPhysics?
final
preNextPage bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tabbarBackground Color
final
tabbarIndicatorColor Color
final
tabbarIndicatorSize TabBarIndicatorSize
final
tabbarIsScrollable bool
final
tabbarLabelStyle TextStyle
final
tabbarUnselectedLabelStyle TextStyle
final
tabbarWidth double
final
tabList List<String>
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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