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
|Indicator with complete state [[SOURCE CODE](example/lib/indicators/check_mark_indicator.dart)]| Your indicator |
78
+
|With complete state [[SOURCE CODE](example/lib/indicators/check_mark_indicator.dart)][[DEMO](https://custom-refresh-indicator.klyta.it/#/check-mark)]| Your indicator |
|| Have you created a fancy refresh indicator? This place is for you. Open PR. |
80
81
81
82
# Documentation
82
83
83
84
## CustomRefreshIndicator widget
84
85
85
-
`CustomRefreshIndicator` widget provides an absolute minimum functionality that allows you to create and set your own custom indicators.
86
+
The _CustomRefreshIndicator_ widget provides an absolute minimum functionality that allows you to create and set your own custom indicators.
87
+
88
+
### onStateChanged
89
+
90
+
The _onStateChanged_ callback is called everytime _IndicatorState_ has been changed.
91
+
This is a convenient place for tracking indicator state changes. For a reference take a look at the [example check mark indicator widget](example/lib/indicators/check_mark_indicator.dart).
92
+
93
+
Example usage:
94
+
```dart
95
+
CustomRefreshIndicator(
96
+
onRefresh: onRefresh,
97
+
// You can track state changes here.
98
+
onStateChanged: (IndicatorStateChange change) {
99
+
if (change.didChange(from: IndicatorState.dragging, to: IndicatorState.armed)) {
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.
114
+
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.
92
115
93
116

94
117
@@ -103,58 +126,12 @@ The best way to understand how the "CustomRefreshIndicator" widget changes its c
103
126
104
127
---
105
128
106
-
### IndicatorStateHelper
129
+
### Support
107
130
108
-
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).
109
-
110
-
All you need to do is to update it's value on every controller update.
111
-
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.
/// When the state changes from [idle] to [dragging]
137
-
if (_helper.didStateChange(
138
-
from: IndicatorState.idle,
139
-
to: IndicatorState.dragging,
140
-
)) {
141
-
// Code...
142
-
}
143
-
144
-
/// When the state changes from [idle] to another.
145
-
if (_helper.didStateChange(
146
-
from: IndicatorState.idle,
147
-
)) {
148
-
// Code...
149
-
}
150
-
151
-
/// When the state changes.
152
-
if (_helper.didStateChange()) {
153
-
// Code...
154
-
}
155
-
```
156
-
___
131
+
If you like this package, you have learned something from it, or you just don't know what to do with your money 😅 just buy me a cup of coffee ☕️ and this dose of caffeine will put a smile on my face which in turn will help me improve this package. Also as a thank you, you will be mentioned in this readme as a sponsor.
157
132
158
-
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).
133
+
<divalign="center">
134
+
<ahref="https://www.buymeacoffee.com/kamilklyta"target="_blank"><imgsrc="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png"alt="Buy Me A Coffee"style="height: 60px!important;width: 217px!important;" ></a>
135
+
</div>
159
136
160
-
If you implemented your own custom refresh indicator using 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).
0 commit comments