SwipeRefresh class
Refresh indicator widget.
Params for Material Design style: indicatorColor, backgroundColor(more details MaterialSwipeRefresh).
Params for Cupertino style: refreshTriggerPullDistance, refreshIndicatorExtent, indicatorBuilder (more details CupertinoSwipeRefresh).
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SwipeRefresh
Constructors
-
SwipeRefresh(SwipeRefreshStyle style, {required Stream<
SwipeRefreshState> stateStream, required VoidCallback onRefresh, Key? key, List<Widget> ? children, SwipeRefreshState? initState, ScrollController? scrollController, SliverChildDelegate? childrenDelegate, EdgeInsets? padding, Color? indicatorColor, bool shrinkWrap = false, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, ScrollPhysics? physics, Color? backgroundColor, double? refreshTriggerPullDistance, double? refreshIndicatorExtent, RefreshControlIndicatorBuilder? indicatorBuilder, PlatformWrapper? platform, double? cacheExtent}) -
const
-
SwipeRefresh.adaptive({required Stream<
SwipeRefreshState> stateStream, required VoidCallback onRefresh, List<Widget> ? children, SliverChildDelegate? childrenDelegate, Key? key, SwipeRefreshState? initState, Color? indicatorColor, Color? backgroundColor, double? refreshTriggerPullDistance, double? refreshIndicatorExtent, RefreshControlIndicatorBuilder? indicatorBuilder, ScrollController? scrollController, EdgeInsets? padding, bool shrinkWrap = false, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, ScrollPhysics? physics, PlatformWrapper? platform, double? cacheExtent}) -
Create refresh indicator adaptive to platform.
const
-
SwipeRefresh.builder({required IndexedWidgetBuilder itemBuilder, required int itemCount, required Stream<
SwipeRefreshState> stateStream, required VoidCallback onRefresh, Key? key, SwipeRefreshState? initState, Color? indicatorColor, Color? backgroundColor, double? refreshTriggerPullDistance, double? refreshIndicatorExtent, RefreshControlIndicatorBuilder? indicatorBuilder, ScrollController? scrollController, EdgeInsets? padding, bool shrinkWrap = false, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, ScrollPhysics? physics, PlatformWrapper? platform, double? cacheExtent}) -
Create refresh indicator with adaptive to platform style.
Uses SliverChildBuilderDelegate in childrenDelegate to avoid
creating more children than are visible through the Viewport.
factory
-
SwipeRefresh.cupertino({required Stream<
SwipeRefreshState> stateStream, required VoidCallback onRefresh, List<Widget> ? children, SliverChildDelegate? childrenDelegate, Key? key, SwipeRefreshState? initState, double? refreshTriggerPullDistance, double? refreshIndicatorExtent, RefreshControlIndicatorBuilder? indicatorBuilder, ScrollController? scrollController, EdgeInsets? padding, bool shrinkWrap = false, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, ScrollPhysics? physics, double? cacheExtent}) -
Create refresh indicator with Cupertino style.
const
-
SwipeRefresh.material({required Stream<
SwipeRefreshState> stateStream, required VoidCallback onRefresh, List<Widget> ? children, SliverChildDelegate? childrenDelegate, Key? key, SwipeRefreshState? initState, Color? indicatorColor, Color? backgroundColor, ScrollController? scrollController, EdgeInsets? padding, bool shrinkWrap = false, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, ScrollPhysics? physics, double? cacheExtent}) -
Create refresh indicator with Material Design style.
const
Properties
- backgroundColor → Color
-
final
- cacheExtent → double?
-
final
-
children
→ List<
Widget> ? -
final
- childrenDelegate → SliverChildDelegate?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- indicatorBuilder → RefreshControlIndicatorBuilder
-
final
- indicatorColor → Color?
-
final
- initState → SwipeRefreshState?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardDismissBehavior → ScrollViewKeyboardDismissBehavior?
-
final
- onRefresh → VoidCallback
-
final
- padding → EdgeInsets?
-
final
- physics → ScrollPhysics?
-
final
- refreshIndicatorExtent → double
-
final
- refreshTriggerPullDistance → double
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
final
- shrinkWrap → bool
-
final
-
stateStream
→ Stream<
SwipeRefreshState> -
final
- style → SwipeRefreshStyle
-
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's 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}) → 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