InfinitePageView class

do what @author yulun @since 2020-06-23 14:47 支持无限循环滚动 支持自动轮播 支持预加载

Inheritance

Constructors

InfinitePageView({@required int count, @required Widget buildItem(BuildContext context, int index), double viewportFraction = 1.0, bool padEnds = true, void onPageChange(int pageIdnex), void onControllerListener(PageController controller), bool autoScroll = false, bool cycleRolling = true, int autoPlaySeconds = delayPlaySeconds, Duration animateDuration = kTabScrollDuration, int initIndex = 0, int countMultiple = 1})

Properties

animateDuration Duration
轮播动画时间
final
autoPlaySeconds int
轮播间隔时间 , 默认4s
final
autoScroll bool
支持自动轮播 默认false
final
buildItem Widget Function(BuildContext context, int index)
构建item
final
count int
page数量
final
countMultiple int
系数 例如 1,2,3,countMultiple = 5,那实际的个数就是15,业务方还是正常使用 参考了其他方案,index个数都是无限大,这个对于内存肯定是个大问题,除非用key复用,但这样对于业务方来说就显的比较复杂了
final
cycleRolling bool
无限滚动
final
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
initIndex int
初始化位置
final
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
onControllerListener → void Function(PageController controller)
控制器监听器
final
onPageChange → void Function(int pageIdnex)
页面切换
final
padEnds bool
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
viewportFraction double
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. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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}) 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. [...]
@nonVirtual, inherited

Static Methods

of(BuildContext context) InfinitePageViewState