You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update version to 0.1.0 and enhance functionality in CHANGELOG.md, README.md, and any_refreshable_widget.dart
- Introduced lifecycle callbacks `onBeforeRefresh` and `onAfterRefresh` for better control during refresh operations.
- Added `RefreshConcurrency` enum to manage execution of multiple futures (concurrent or sequential).
- Updated README.md with new features, usage examples, and detailed API reference.
- Enhanced CHANGELOG.md to reflect the new version and features.
|`onAfterRefresh`|`VoidCallback?`| ❌ |`null`| Callback executed after refresh completes |
203
283
|`refreshColor`|`Color?`| ❌ |`null`| Color of the refresh indicator |
204
284
|`backgroundColor`|`Color?`| ❌ |`null`| Background color of the refresh indicator |
205
285
|`displacement`|`double`| ❌ |`40.0`| Distance from top to show indicator |
@@ -210,7 +290,24 @@ AnyRefreshableWidget.single(
210
290
211
291
### AnyRefreshableWidget.single
212
292
213
-
Same parameters as `AnyRefreshableWidget`, but `onRefresh` takes a single `Future<void> Function()` instead of a list.
293
+
Same parameters as `AnyRefreshableWidget`, but `onRefresh` takes a single `Future<void> Function()` instead of a list. The `concurrency` parameter is not applicable for single futures.
294
+
295
+
### RefreshConcurrency Enum
296
+
297
+
| Value | Description | Use Case |
298
+
|-------|-------------|----------|
299
+
|`RefreshConcurrency.concurrent`| Execute all futures simultaneously using `Future.wait`| fastest refresh when futures are independent |
300
+
|`RefreshConcurrency.sequential`| Execute futures one by one in order | When futures depend on each other or to limit resource usage |
301
+
302
+
## Callback Execution Order
303
+
304
+
When a refresh is triggered, the callbacks execute in this order:
305
+
306
+
1.**`onBeforeRefresh`** - Called first, awaited if async
Copy file name to clipboardExpand all lines: pubspec.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
name: any_refreshable_widget
2
2
description: A powerful Flutter package providing pull-to-refresh functionality for any widget, with support for single/multiple futures, custom indicators, and comprehensive error handling.
0 commit comments