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
### Changes:
- Stable nullsafety release.
- **BREAKING**: Removed `prevState` from `IndicatorController` class.
Because flutter only marks the widget that it is ready for rebuild, it is possible that the controller state will change more than once during a single frame what causes one or more steps to be skipped. To still use `prevState` and `didChangeState` method, you can use `IndicatorStateHelper`. Take a look at `check_mark_indicator.dart` or `warp_indicator.dart` for example usage.
- Added `IndicatorStateHelper` class.
- Added `IndicatorController` unit tests.
- Added warp indicator example.
- Added `stopDrag` method to the `IndicatorController` class. It allows you to stop current user drag.
Resolves#15, #16
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,13 @@
1
-
## 1.0.0-nullsafety.0
2
-
1
+
## 1.0.0
2
+
- Stable nullsafety release.
3
3
-**BREAKING**: opt into null safety
4
4
- Dart SDK constraints: >=2.12.0-0 <3.0.0
5
+
-**BREAKING**: Removed `prevState` from `IndicatorController` class.
6
+
Because flutter only marks the widget that it is ready for rebuild, it is possible that the controller state will change more than once during a single frame what causes one or more steps to be skipped. To still use `prevState` and `didChangeState` method, you can use `IndicatorStateHelper`. Take a look at `check_mark_indicator.dart` or `warp_indicator.dart` for example usage.
7
+
- Added `IndicatorStateHelper` class.
8
+
- Added `IndicatorController` unit tests.
9
+
- Added warp indicator example.
10
+
- Added `stopDrag` method to the `IndicatorController` class. It allows you to stop current user drag.
This package provides `CustomRefreshIndicator` widget that make it easy to implement your own custom refresh indicator. It listens for scroll events from scroll widget passed to child argument and parsing it to data easy for custom refresh indicator implementation. Indicator data is provided by IndicatorController (third argument of builder method). Long story short... thats it!
4
6
5
7
If there is something that can be improved, fixed or you just have some great idea feel free to open github issue [HERE](https://github.com/gonuit/flutter-custom-refresh-indicator/issues) or open a pull request [HERE](https://github.com/gonuit/flutter-custom-refresh-indicator/pulls).
6
8
7
9
If you implemented your own custom refresh indicator with this library and you want it to be mentioned here or provided as an example to the eample app, just open a pull request [HERE](https://github.com/gonuit/flutter-custom-refresh-indicator/pulls).
|| Have you created a fancy refresh indicator? This place is for you. Open PR. |
78
81
79
-
80
-
81
-
82
82
# Documentation
83
83
84
84
## CustomRefreshIndicator widget
@@ -90,7 +90,7 @@ Almost all of these examples are available in the example application.
90
90
### Controller state and value changes.
91
91
92
92
The best way to understand how the "CustomRefreshIndicator" widget changes its controller data is to see the example 😉. An example is available in the example application.
93
-
93
+
94
94

95
95
96
96
| state | value | value description | Description |
@@ -102,34 +102,52 @@ The best way to understand how the "CustomRefreshIndicator" widget changes its c
102
102
|**hiding**|`<=1.0`| Value decreses in duration of `draggingToIdleDuration` or `loadingToIdleDuration` arguments to `0.0`. | Indicator is hiding after:<br />- User ended dragging when indicator was in `dragging` state.<br />- Future returned from `onRefresh` function is resolved.<br />- Complete state ended.<br />- User started scrolling through the list. |
103
103
|**complete**|`==1.0`| Value equals `1.0` for duration of `completeStateDuration` argument. |**This state is OPTIONAL, provide `completeStateDuration` argument with non null value to enable it.**<br /> Loading is completed. |
104
104
105
-
___
105
+
---
106
106
107
-
### `didStateChange`
108
-
With this method, you can easily check if the indicator's state has changed.
107
+
### IndicatorStateHelper
109
108
109
+
With the IndicatorStateHelper class, you can easily track indicator's state changes. Example usage can be found [HERE](example/lib/indicators/check_mark_indicator.dart).
110
+
111
+
All you need to do is to update it's value on every controller update.
112
+
```dart
113
+
CustomRefreshIndicator(
114
+
onRefresh: onRefresh,
115
+
child: widget.child,
116
+
builder: (
117
+
BuildContext context,
118
+
Widget child,
119
+
IndicatorController controller,
120
+
) => AnimatedBuilder(
121
+
animation: controller,
122
+
builder: (BuildContext context, Widget? _) {
123
+
/// Now every state change will be tracked by the helper class.
0 commit comments