立即下载 ️⬇️

一个漂亮的自定义刷新指示器,提供Ramotion Pull Down to Refresh功能

<div align="center">Liquid Pull To Refresh</div>

A beautiful and custom refresh indicator for flutter highly inspired from Ramotion Pull Down to Refresh.

Table of contents


1. Depend on it

Add this to your package’s pubspec.yaml file:

  liquid_pull_to_refresh: ^1.1.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

3. Import it

Now in your Dart code, you can use:

import 'package:liquid_pull_to_refresh/liquid_pull_to_refresh.dart';


要在flutter应用程序中添加此自定义刷新指示器,您只需将* ListView GridView *包装在LiquidPullToRefresh中。 你还提供了onRefresh参数的值,这是一个刷新回调。

**注意 - **LiquidPullToRefresh只能与垂直滚动视图一起使用。


        key: _refreshIndicatorKey,	// key if you want to add
        onRefresh: _handleRefresh,	// refresh callback
        child: ListView(),		// scroll view

如果你不想要children的不透明度转换,那么设置showChildOpacityTransition:false。 关于这个小部件的两种形式的预览如下: -

showChildOpacityTransition: true showChildOpacityTransition: false


LiquidPullToRefresh Class

Dart attribute Datatype Description Default Value
child ScrollView The widget below this widget in the tree. @required
onRefresh RefreshCallback A function that’s called when the refreshing of page takes place. @required
height double The distance from the child’s top or bottom edge to where the box will settle after the spring effect. 100.0
springAnimationDurationInMilliseconds int Duration in milliseconds of springy effect that occurs when we leave dragging after full drag. 1000
borderWidth double Border width of progressing circle in Progressing Indicator. 2.0
showChildOpacityTransition bool Whether to show child opacity transition or not. true
color Color The progress indicator’s foreground color. ThemeData.accentColor
backgroundColor Color The progress indicator’s background color. ThemeData.canvasColor
notificationPredicate ScrollNotificationPredicate A check that specifies whether a ScrollNotification should be handled by this widget. null
scrollController ScrollController Controls the ScrollView child. null

For help on editing package code, view the flutter documentation.

Bugs or Requests


查阅 Contributing.md.

Github主页 👉aagarwal1012/Liquid-Pull-To-Refresh