LazyLoadRefreshIndicator class
A widget that supports the Material "swipe to refresh" idiom and lazy loading.
When the child's Scrollable descendant overscrolls at the top, an animated circular progress indicator is faded into view. When the scroll ends, if the indicator has been dragged far enough for it to become completely opaque, the onRefresh callback is called. The callback is expected to update the scrollable's contents and then complete the Future it returns. The refresh indicator disappears after the callback's Future has completed.
The trigger mode is configured by RefreshIndicator.triggerMode.
When the child's Scrollable descendant overscrolls at the end and the overscroll is higher than the scrollOffset the onEndOfPage callback is called.
A LazyLoadRefreshIndicator can only be used with a vertical scroll view.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- LazyLoadRefreshIndicator
Constructors
- LazyLoadRefreshIndicator({Key? key, required Widget child, required VoidCallback onEndOfPage, required RefreshCallback onRefresh, int scrollOffset = 100, bool isLoading = false, double displacement = 40.0, Color? color, Color? backgroundColor, ScrollNotificationPredicate notificationPredicate = defaultScrollNotificationPredicate, String? semanticsLabel, String? semanticsValue, double strokeWidth = 2.0, RefreshIndicatorTriggerMode triggerMode = RefreshIndicatorTriggerMode.onEdge})
-
Creates a lazy load refresh indicator.
const
Properties
- backgroundColor → Color?
-
The progress indicator's background color. The current theme's
ThemeData.canvasColor by default.
final
- child → Widget
-
The widget below this widget in the tree.
final
- color → Color?
-
The progress indicator's foreground color. The current theme's
ThemeData.accentColor
by default.final - displacement → double
-
The distance from the child's top or bottom edge to where the refresh
indicator will settle. During the drag that exposes the refresh indicator,
its actual displacement may significantly exceed this value.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isLoading → bool
-
Used to determine if loading of new data has finished. You should use set this if you aren't using a FutureBuilder or StreamBuilder
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- notificationPredicate → ScrollNotificationPredicate
-
A check that specifies whether a ScrollNotification should be
handled by this widget.
final
- onEndOfPage → VoidCallback
-
Called when the child reaches the end of the list
final
- onRefresh → RefreshCallback
-
A function that's called when the user has dragged the refresh indicator
far enough to demonstrate that they want the app to refresh. The returned
Future must complete when the refresh operation is finished.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollOffset → int
-
The offset to take into account when triggering onEndOfPage in pixels
final
- semanticsLabel → String?
-
The SemanticsProperties.label for this progress indicator.
final
- semanticsValue → String?
-
The SemanticsProperties.value for this progress indicator.
final
- strokeWidth → double
-
Defines
strokeWidth
forRefreshIndicator
.final - triggerMode → RefreshIndicatorTriggerMode
-
Defines how this RefreshIndicator can be triggered when users overscroll.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _LazyLoadRefreshIndicatorState -
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