Last updated:
0 purchases
astro refresh indicator
Astro Refresh Indicator #
A Flutter package that implements a RefreshIndicator. This package is meant to be used along with pull_to_refresh package.
⚙️ Getting started #
Add the following lines to the pubspec.yaml:
dependencies:
astro_refresh_indicator: ^1.0.4
pull_to_refresh: ^2.0.0
copied to clipboard
🚀 Usage #
final RefreshController _refreshController = RefreshController();
Future<void> _onRefresh() async {
await Future<void>.delayed(const Duration(milliseconds: 3000));
_refreshController.refreshCompleted();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: RefreshConfiguration(
// should be greater than the AstroRefreshIndicator height
headerTriggerDistance: 155,
child: SmartRefresher(
header: const AstroRefreshIndicator(),
controller: _refreshController,
onRefresh: _onRefresh,
child: ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 5),
itemBuilder: (c, i) => const Card(),
itemExtent: 200,
itemCount: 5,
),
),
),
);
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
copied to clipboard
❤️ Credits #
Used packages:
rive
pull_to_refresh
very_good_analysis
Used animations:
Interactive animations
License #
Licensed under the MIT License.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.