small_refresh 1.0.22 copy "small_refresh: ^1.0.22" to clipboard
small_refresh: ^1.0.22 copied to clipboard

This is a refresh view based on CustomScrollView with Smooth animations,and you can customize your header view or footer view simply.

import 'package:small_refresh/small_refresh.dart';

#Create A Controller at first
final SmallRefreshController _refreshController = SmallRefreshController();

int _dataCount = 0;
List dataList = List.from({"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"});

#build your refresh view
Widget _buildRefresh() {
return SmallRefresh(
topPadding: 0,
bottomPadding: 0,
firstRefresh: true,
controller: _refreshController,
header: DefaultSmallRefreshHeader(
controller: _refreshController,
),
footer: DefaultSmallRefreshFooter(
controller: _refreshController,
),
slivers: _buildSliver(),
onRefresh: () async {
await Future.delayed(const Duration(milliseconds: 2000));
dataList.clear();
_dataCount = 0;
for (int s = 0; s < 10; s++) {
_dataCount++;
dataList.add(_dataCount.toString());
}
},
onLoad: () async {
await Future.delayed(const Duration(milliseconds: 2000));
if (dataList.length < 30) {
for (int s = 0; s < 10; s++) {
_dataCount++;
dataList.add(_dataCount.toString());
}
setState(() {});
} else {
_refreshController.footerEnd();
setState(() {});
}
},
);
}

#You can customize your header or footer by StatefulWidget's State extends SmallRefreshHeaderState/SmallRefreshFooterState

#or just extends SmallRefreshHeaderWidget/SmallRefreshFooterWidget with listeners in State

1
likes
150
points
36
downloads

Publisher

unverified uploader

Weekly Downloads

This is a refresh view based on CustomScrollView with Smooth animations,and you can customize your header view or footer view simply.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_spinkit, synchronized

More

Packages that depend on small_refresh