EasyRefresh class
EasyRefresh 下拉刷新,上拉加载组件
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- EasyRefresh
Constructors
- EasyRefresh({Key? key, EasyRefreshController? controller, OnRefreshCallback? onRefresh, OnLoadCallback? onLoad, bool enableControlFinishRefresh = false, bool enableControlFinishLoad = false, bool taskIndependence = false, ScrollController? scrollController, Header? header, bool firstRefresh = false, Widget? firstRefreshWidget, int headerIndex = 0, Widget? emptyWidget, bool topBouncing = true, bool bottomBouncing = true, bool isScrollEnabled = true, ScrollBehavior? behavior = const EmptyOverScrollScrollBehavior(), required Widget? child})
-
默认构造器
将child转换为CustomScrollView可用的slivers
const
- EasyRefresh.builder({Key? key, EasyRefreshController? controller, OnRefreshCallback? onRefresh, OnLoadCallback? onLoad, bool enableControlFinishRefresh = false, bool enableControlFinishLoad = false, bool taskIndependence = false, ScrollController? scrollController, Header? header, bool firstRefresh = false, bool topBouncing = true, bool isScrollEnabled = true, bool bottomBouncing = true, ScrollBehavior? behavior = const EmptyOverScrollScrollBehavior(), required EasyRefreshChildBuilder? builder})
-
自定义构造器
用法灵活,但需将physics、header和footer放入列表中
const
-
EasyRefresh.custom({Key? key, Key? listKey, EasyRefreshController? controller, OnRefreshCallback? onRefresh, OnLoadCallback? onLoad, bool enableControlFinishRefresh = false, bool enableControlFinishLoad = false, bool taskIndependence = false, Header? header, int headerIndex = 0, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController? scrollController, bool? primary, bool shrinkWrap = false, Key? center, double anchor = 0.0, double? cacheExtent, int? semanticChildCount, DragStartBehavior dragStartBehavior = DragStartBehavior.start, bool firstRefresh = false, Widget? firstRefreshWidget, Widget? emptyWidget, bool topBouncing = true, bool bottomBouncing = true, ScrollBehavior? behavior = const EmptyOverScrollScrollBehavior(), required List<
Widget> ? slivers, bool isScrollEnabled = true}) -
custom构造器(推荐)
直接使用CustomScrollView可用的slivers
const
Properties
- anchor → double
-
final
- behavior → ScrollBehavior?
-
滚动行为
final
- bottomBouncing → bool
-
底部回弹(Footer的overScroll属性优先,且onLoad和footer都为null时生效)
final
- builder → EasyRefreshChildBuilder?
-
子组件构造器
final
- cacheExtent → double?
-
final
- center → Key?
-
final
- child → Widget?
-
子组件
final
- controller → EasyRefreshController?
-
控制器
final
- dragStartBehavior → DragStartBehavior
-
final
- emptyWidget → Widget?
-
空视图
当不为null时,只会显示空视图
保留headerIndex以上的内容
final
- enableControlFinishLoad → bool
-
是否开启控制结束加载
final
- enableControlFinishRefresh → bool
-
是否开启控制结束刷新
final
- firstRefresh → bool
-
首次刷新
final
- firstRefreshWidget → Widget?
-
首次刷新组件
不设置时使用header
final
-
Footer
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → Header?
-
Header
final
- headerIndex → int
-
final
- isScrollEnabled → bool
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- listKey → Key?
-
CustomListView Key
final
- onLoad → OnLoadCallback?
-
加载回调(null为不开启加载)
final
- onRefresh → OnRefreshCallback?
-
刷新回调(null为不开启刷新)
final
- primary → bool?
-
final
- reverse → bool
-
反向
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
final
- scrollDirection → Axis
-
列表方向
final
- semanticChildCount → int?
-
final
- shrinkWrap → bool
-
final
-
slivers
→ List<
Widget> ? -
Slivers集合
final
- taskIndependence → bool
-
任务独立(刷新和加载状态独立)
final
- topBouncing → bool
-
顶部回弹(Header的overScroll属性优先,且onRefresh和header都为null时生效)
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _EasyRefreshState -
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
Static Properties
- callOverExtent ↔ double
-
触发时超过距离
getter/setter pair
-
no getter
- defaultHeader ← Header
-
no getter