EasyRefresh class
A flutter widget that provides pull-down refresh and pull-up load.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- EasyRefresh
- Implementers
Constructors
- EasyRefresh({Key? key, required Widget? child, EasyRefreshController? controller, Header? header, FutureOr onRefresh()?, FutureOr onLoad()?, SpringDescription? spring, FrictionFactor? frictionFactor, NotRefreshHeader? notRefreshHeader, bool simultaneously = false, bool canRefreshAfterNoMore = false, bool canLoadAfterNoMore = false, bool resetAfterRefresh = true, bool refreshOnStart = false, Header? refreshOnStartHeader, double callRefreshOverOffset = 20, double callLoadOverOffset = 20, StackFit fit = StackFit.loose, Clip clipBehavior = Clip.hardEdge, ERScrollBehaviorBuilder? scrollBehaviorBuilder, ScrollController? scrollController, Axis? triggerAxis})
-
const
- EasyRefresh.builder({Key? key, required ERChildBuilder? childBuilder, EasyRefreshController? controller, Header? header, FutureOr onRefresh()?, FutureOr onLoad()?, SpringDescription? spring, FrictionFactor? frictionFactor, NotRefreshHeader? notRefreshHeader, bool simultaneously = false, bool canRefreshAfterNoMore = false, bool canLoadAfterNoMore = false, bool resetAfterRefresh = true, bool refreshOnStart = false, Header? refreshOnStartHeader, double callRefreshOverOffset = 20, double callLoadOverOffset = 20, StackFit fit = StackFit.loose, Clip clipBehavior = Clip.hardEdge, ERScrollBehaviorBuilder? scrollBehaviorBuilder, ScrollController? scrollController, Axis? triggerAxis})
-
const
Properties
- callLoadOverOffset → double
-
Offset beyond trigger offset when calling load.
Used when EasyRefreshController.callLoad.
final
- callRefreshOverOffset → double
-
Offset beyond trigger offset when calling refresh.
Used when refreshOnStart is true and EasyRefreshController.callRefresh.
final
- canLoadAfterNoMore → bool
-
Is it possible to load after there is no more.
final
- canRefreshAfterNoMore → bool
-
Is it possible to refresh after there is no more.
final
- child → Widget?
-
Try to avoid including multiple ScrollViews.
Or set separate ScrollPhysics for other ScrollView.
Otherwise use EasyRefresh.builder.
final
- childBuilder → ERChildBuilder?
-
EasyRefresh child builder.
Provide ScrollPhysics, and use it in your ScrollView.
ScrollPhysics will not be scoped.
final
- clipBehavior → Clip
-
See Stack.clipBehavior.
final
- controller → EasyRefreshController?
-
EasyRefresh controller.
final
- fit → StackFit
-
See
Stack.StackFit
final -
Footer indicator.
final
- frictionFactor → FrictionFactor?
-
Friction factor when list is out of bounds.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → Header?
-
Header indicator.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
Overscroll behavior when onLoad is null.
Won't build widget.
final
- notRefreshHeader → NotRefreshHeader?
-
Overscroll behavior when onRefresh is null.
Won't build widget.
final
- onLoad → FutureOr Function()?
-
Load callback.
Triggered on load.
When null, disable load.
The Footer current state is IndicatorMode.processing.
More see
IndicatorNotifier._onTask
. The return value can be IndicatorResult, the default processing result is IndicatorResult.success, and IndicatorResult.fail when an exception occurs. When EasyRefreshController.controlFinishLoad is true, the return value is invalid.final - onRefresh → FutureOr Function()?
-
Refresh callback.
Triggered on refresh.
When null, disable refresh.
The Header current state is IndicatorMode.processing.
More see
IndicatorNotifier._onTask
. The return value can be IndicatorResult, the default processing result is IndicatorResult.success, and IndicatorResult.fail when an exception occurs. When EasyRefreshController.controlFinishRefresh is true, the return value is invalid.final - refreshOnStart → bool
-
Refresh on start.
When the EasyRefresh build is complete, trigger the refresh.
final
- refreshOnStartHeader → Header?
-
Header for refresh on start.
Use header when null.
final
- resetAfterRefresh → bool
-
Reset after refresh when no more deactivation is loaded.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollBehaviorBuilder → ERScrollBehaviorBuilder?
-
use ERScrollBehavior by default.
final
- scrollController → ScrollController?
-
When the position cannot be determined, such as NestedScrollView.
Mainly used to trigger events.
NOTE: You also need to bind this to your Scrollable.controller.
final
- simultaneously → bool
-
Refresh and load can be performed simultaneously.
final
- spring → SpringDescription?
-
Structure that describes a spring's constants.
When spring is not set in Header and Footer.
final
- triggerAxis → Axis?
-
Direction of execution.
Other scroll directions will not show indicators and perform task.
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
Static Properties
-
Default footer indicator.
getter/setter pair
- defaultHeaderBuilder ↔ Header Function()
-
Default header indicator.
getter/setter pair
- defaultScrollBehaviorBuilder ↔ ScrollBehavior Function(ScrollPhysics? physics)
-
Default ScrollBehavior builder.
getter/setter pair
Static Methods
-
of(
BuildContext context) → EasyRefreshData