LifecyclePageView class

替换PageView,添加生命周期

Inheritance

Constructors

LifecyclePageView({Key? key, Axis scrollDirection = Axis.horizontal, bool reverse = false, PageController? controller, ScrollPhysics? physics, bool pageSnapping = true, ValueChanged<int>? onPageChanged, List<Widget> children = const <Widget>[], DragStartBehavior dragStartBehavior = DragStartBehavior.start, bool allowImplicitScrolling = false, String? restorationId, Clip clipBehavior = Clip.hardEdge, ScrollBehavior? scrollBehavior, bool padEnds = true, bool itemKeepAlive = false, dynamic itemScopeBuilder(int index)?})
添加了生命周期,适配PageView 中item的生命周期Owner
LifecyclePageView.builder({Key? key, Axis scrollDirection = Axis.horizontal, bool reverse = false, PageController? controller, ScrollPhysics? physics, bool pageSnapping = true, ValueChanged<int>? onPageChanged, required NullableIndexedWidgetBuilder itemBuilder, ChildIndexGetter? findChildIndexCallback, required int itemCount, DragStartBehavior dragStartBehavior = DragStartBehavior.start, bool allowImplicitScrolling = false, String? restorationId, Clip clipBehavior = Clip.hardEdge, ScrollBehavior? scrollBehavior, bool padEnds = true, bool itemKeepAlive = false, dynamic itemScopeBuilder(int index)?})
添加了生命周期,适配PageView 中item的生命周期Owner

Properties

allowImplicitScrolling bool
If allowImplicitScrolling is true, the PageView will participate in accessibility scrolling more like a ListView, where implicit scroll actions will move to the next page rather than into the contents of the PageView.
finalinherited
childrenDelegate SliverChildDelegate
A delegate that provides the children for the PageView.
finalinherited
clipBehavior Clip
The content will be clipped (or not) according to this option.
finalinherited
controller PageController?
An object that can be used to control the position to which this page view is scrolled.
finalinherited
dragStartBehavior DragStartBehavior
Determines the way that drag start behavior is handled.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
hitTestBehavior HitTestBehavior
Defines the behavior of gesture detector used in this Scrollable.
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPageChanged ValueChanged<int>?
Called whenever the page in the center of the viewport changes.
finalinherited
padEnds bool
Whether to add padding to both ends of the list.
finalinherited
pageSnapping bool
Set to false to disable page snapping, useful for custom scroll behavior.
finalinherited
physics ScrollPhysics?
How the page view should respond to user input.
finalinherited
restorationId String?
Restoration ID to save and restore the scroll offset of the scrollable.
finalinherited
reverse bool
Whether the page view scrolls in the reading direction.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollBehavior ScrollBehavior?
A ScrollBehavior that will be applied to this widget individually.
finalinherited
scrollCacheExtent ScrollCacheExtent
The viewport has an area before and after the visible area to cache items that are about to become visible when the user scrolls.
finalinherited
scrollDirection Axis
The Axis along which the scroll view's offset increases with each page.
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<PageView>
Creates the mutable state for this widget at a given location in the tree.
inherited
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