Skip to content
On this page

PullToRefresh

A pull gesture that triggers an asynchronous refresh.

PullToRefresh in FluttyUIPullToRefresh in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

PullToRefresh

const PullToRefresh({
  super.key,
  required this.onRefresh,
  this.size,
  required Widget this._child,
  this.controller,
  this.physics,
  this.padding = EdgeInsets.zero,
  this.triggerDistance = 100,
  this.indicatorExtent = 60,
  this.indicatorBuilder,
  this.enabled = true,
  this.haptic = HapticType.light,
  this.onError,
  this.semanticsLabel = 'Refreshing',
});
ParameterTypeRequiredDefault
keyKey?Nonull
onRefreshFuture<void> Function()Yes—
sizeComponentSize?Nonull
controllerScrollController?Nonull
physicsScrollPhysics?Nonull
paddingEdgeInsetsGeometryNoEdgeInsets.zero
triggerDistancedoubleNo100
indicatorExtentdoubleNo60
indicatorBuilderPullToRefreshIndicatorBuilder?Nonull
enabledboolNotrue
hapticHapticTypeNoHapticType.light
onErrorRefreshErrorCallback?Nonull
semanticsLabelStringNo'Refreshing'

PullToRefresh.slivers

const PullToRefresh.slivers({
  super.key,
  required this.onRefresh,
  this.size,
  required List<Widget> this._slivers,
  this.controller,
  this.physics,
  this.padding = EdgeInsets.zero,
  this.triggerDistance = 100,
  this.indicatorExtent = 60,
  this.indicatorBuilder,
  this.enabled = true,
  this.haptic = HapticType.light,
  this.onError,
  this.semanticsLabel = 'Refreshing',
});

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/feedbacks/pull_to_refresh/pull_to_refresh.dart

This reference is generated from the PullToRefresh declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI