Liquid Pull To Refresh is a highly customizable Flutter library that adds liquid-inspired Pull-To-Refresh functionality to your apps. It provides a unique and visually engaging way to update content and adds a touch of dynamism.
To use the library in your Flutter project, follow the steps below:
- Add
liquid_pull_to_refresh
to yourpubspec.yaml
dependencies:
dependencies:
liquid_pull_to_refresh: ^latest_version
- Install the package via the command line by running:
$ flutter pub get
To use the Liquid Pull To Refresh widget, follow the steps below:
- Import the
liquid_pull_to_refresh.dart
file into your project:
import 'package:liquid_pull_to_refresh/liquid_pull_to_refresh.dart';
- Wrap your
ListView
,GridView
,CustomScrollView
, or any other scrollable widget in theLiquidPullToRefresh
:
LiquidPullToRefresh(
key: _refreshIndicatorKey,
onRefresh: _handleRefresh,
child: ListView.builder(
itemBuilder: (context, index) => ListTile(title: Text("Item $index")),
itemCount: 10,
)
);
- Create a function that performs the desired action on refresh (e.g., data fetching):
Future<void> _handleRefresh() async {
// update data and state here
await Future.delayed(Duration(seconds: 3));
}
For more information and advanced usage, please refer to the example project.
- Unique and visually engaging liquid-based design
- Highly customizable: colors, opacity, displacement, etc.
- Integrated with
ScrollController
for programmatic control - Supports various scrollable widgets like
ListView
,GridView
, andCustomScrollView
- Easy installation and usage
- Prebuilt example project for quick testing and understanding
Contributions are welcomed for this project. Please review the contributing guidelines and code of conduct before making any changes or submitting a pull request. For any questions or issues, please open an issue on GitHub.
This project is licensed under the MIT License. Please see the license file for more information.
If you have any questions or queries related to the project, feel free to reach out to the maintainer:
- Youssef: GitHub
Additionally, you can open an issue in the repository for any support requests or bug reports.