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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,13 @@
1
-
2
-
## 1.0.0-nullsafety.1
1
+
## 1.0.0
3
2
- Stable nullsafety release.
3
+
-**BREAKING**: opt into null safety
4
+
- Dart SDK constraints: >=2.12.0-0 <3.0.0
4
5
-**BREAKING**: Removed `prevState` from `IndicatorController` class.
5
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.
6
7
- Added `IndicatorStateHelper` class.
7
8
- Added `IndicatorController` unit tests.
8
9
- Added warp indicator example.
9
-
10
-
## 1.0.0-nullsafety.0
11
-
12
-
-**BREAKING**: opt into null safety
13
-
- Dart SDK constraints: >=2.12.0-0 <3.0.0
10
+
- Added `stopDrag` method to the `IndicatorController` class. It allows you to stop current user drag.
Copy file name to clipboardExpand all lines: README.md
+30-14Lines changed: 30 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,9 @@ If there is something that can be improved, fixed or you just have some great id
9
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. |
80
81
81
-
82
-
83
-
84
82
# Documentation
85
83
86
84
## CustomRefreshIndicator widget
@@ -92,7 +90,7 @@ Almost all of these examples are available in the example application.
92
90
### Controller state and value changes.
93
91
94
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.
95
-
93
+
96
94

97
95
98
96
| state | value | value description | Description |
@@ -104,34 +102,52 @@ The best way to understand how the "CustomRefreshIndicator" widget changes its c
104
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. |
105
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. |
106
104
107
-
___
105
+
---
108
106
109
-
### `didStateChange`
110
-
With this method, you can easily check if the indicator's state has changed.
107
+
### IndicatorStateHelper
111
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