liquid pull to custom refresh
a beautiful and custom refresh indicator for flutter highly inspired from ramotion pull down to refresh.
installing
1. depend on it
custom refresh
add this to your package’s pubspec.yaml
file:
dependencies:
liquid_pull_to_refresh: ^1.1.0
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';
usage
for adding this custom refresh indicator in your flutter app, you have to simply wrap listview or gridview inside liquidpulltorefresh
. also you have provide the value of onrefresh
parameter which is a refresh callback.
note – liquidpulltorefresh
can only be used with a vertical scroll view.
for example:
liquidpulltorefresh(
key: _refreshindicatorkey, // key if you want to add
onrefresh: _handlerefresh, // refresh callback
child: listview(), // scroll view
);
if you do not want the opacity transition of child then set showchildopacitytransition: false
. preview regarding the both form of this widget is follows :-
showchildopacitytransition: true |
showchildopacitytransition: false |
---|---|
documentation
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
if you encounter any problems feel free to open an issue. if you feel the library is missing a feature, please raise a ticket on github and i’ll look into it. pull request are also welcome.
Comments are closed.