CustomRefreshIndicator class

Inheritance

Constructors

CustomRefreshIndicator({Key? key, required Widget child, required AsyncCallback onRefresh, required IndicatorBuilder builder, IndicatorController? controller, IndicatorTrigger trigger = IndicatorTrigger.leadingEdge, IndicatorTriggerMode triggerMode = IndicatorTriggerMode.onEdge, ScrollNotificationPredicate notificationPredicate = defaultScrollNotificationPredicate, bool autoRebuild = true, double? offsetToArmed, OnStateChanged? onStateChanged, double? containerExtentPercentageToArmed, Duration indicatorCancelDuration = const Duration(milliseconds: 300), Duration indicatorSettleDuration = const Duration(milliseconds: 150), Duration indicatorFinalizeDuration = const Duration(milliseconds: 100), Duration? completeStateDuration, bool leadingScrollIndicatorVisible = false, bool trailingScrollIndicatorVisible = true})
const

Properties

autoRebuild bool
When set to true, the builder function will be called whenever the controller changes. It is set to true by default.
final
builder IndicatorBuilder
Function that builds the custom refresh indicator.
final
child Widget
Part of widget tree that contains scrollable widget (like ListView).
final
completeStateDuration Duration?
Duration for which the indicator remains at value of 1.0 and IndicatorState.complete state after the onRefresh function completes.
final
containerExtentPercentageToArmed double
The distance the user must scroll for the indicator to be armed, as a percentage of the scrollable's container extent.
final
controller IndicatorController?
The indicator controller stores all the data related to the refresh indicator widget. It extends the ChangeNotifier class.
final
hashCode int
The hash code for this object.
no setterinherited
indicatorCancelDuration Duration
Duration of hiding the indicator when dragging was stopped before the indicator was armed (the onRefresh callback was not called).
final
indicatorFinalizeDuration Duration
Duration of hiding the pointer after the onRefresh function completes.
final
indicatorSettleDuration Duration
The time of settling the pointer on the target location after releasing the pointer in the armed state.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
leadingScrollIndicatorVisible bool
Whether to display leading scroll indicator
final
notificationPredicate ScrollNotificationPredicate
Determines whether the received ScrollNotification should be handled by this widget.
final
offsetToArmed double?
The distance in number of pixels that the user should drag to arm the indicator. The armed indicator will trigger the onRefresh function when the gesture is completed.
final
onRefresh AsyncCallback
A function that is called when the user drags the refresh indicator far enough to trigger a "pull to refresh" action.
final
onStateChanged OnStateChanged?
Called on every indicator state change.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
trailingScrollIndicatorVisible bool
Whether to display trailing scroll indicator
final
trigger IndicatorTrigger
Defines the trigger for the pull to refresh gesture.
final
triggerMode IndicatorTriggerMode
Configures how CustomRefreshIndicator can be triggered.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() CustomRefreshIndicatorState
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}) 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

Constants

armedFromValue → const double
The value from which IndicatorController is considered to be armed.
defaultContainerExtentPercentageToArmed → const double
The default distance the user must over-scroll for the indicator to be armed, as a percentage of the scrollable's container extent.