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
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,28 @@
1
+
## 1.1.0
2
+
3
+
### Fixes:
4
+
5
+
- Handle errors thrown from the `onRefresh` method.
6
+
7
+
### Improvements:
8
+
9
+
- Updated example app
10
+
- Added support for the Android embedding v2
11
+
- Added web support
12
+
- Added windows support.
13
+
- Added a web based demo app (url in the readme file).
14
+
- Replaced the deprecated `disallowGlow` method calls with `disallowIndicator`.
15
+
- Added `onStateChanged` function argument that allows tracking indicator state changes.
16
+
- The `IndicatorStateHelper` class is now deprecated in favor of `onStateChange` function and `IndicatorStateChange` class.
17
+
- Initial support for programmatically-controlled indicators has been added. Added the `show`,` hide` and `refresh` methods to the` CustomRefreshIndicatorState` class. It can be accessed via GlobalKey. Take a look at an [programmatically-controlled screen example](/example/lib/screens/programmatically_controlled_indicator_screen.dart).
18
+
- Use the `flutter_lints` package for analysis.
19
+
- Deprecate `leadingGlowVisible` and `trailingGlowVisible` in favor of `leadingScrollIndicatorVisible` and `trailingScrollIndicatorVisible` arguments.
20
+
- Added `reversed` argument that allows you to trigger a refresh indicator from the end of the list.
21
+
- Added `envelope` example.
22
+
- Added `pull to fetch more` example.
23
+
1
24
## 1.0.0
25
+
2
26
- Stable nullsafety release.
3
27
-**BREAKING**: opt into null safety
4
28
- Dart SDK constraints: >=2.12.0-0 <3.0.0
@@ -28,7 +52,7 @@
28
52
- Added `wasArmed`, `wasDragging`, `wasLoading`, `wasHiding` and `wasIdle` properties.
29
53
- Added `notificationPredicate` property to the `CustomRefreshIndicator` widget.
30
54
- Example app:
31
-
- Added initial version of `check_mark_indicator`. Example that shows how to make use of `complete` state.
55
+
- Added initial version of `check_mark_indicator`. Example that shows how to make use of `complete` state.
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!
6
+
A flutter package that allows you to easily create a custom refresh indicatorwidget.
6
7
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).
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).
|With complete state [[SOURCE](example/lib/indicators/check_mark_indicator.dart)][[DEMO](https://custom-refresh-indicator.klyta.it/#/check-mark)]|Pull to fetch more [[SOURCE](example/lib/indicators/swipe_action.dart)][[DEMO](https://custom-refresh-indicator.klyta.it/#/fetch-more)]|Envelope [[SOURCE](example/lib/indicators/envelope_indicator.dart)][[DEMO](https://custom-refresh-indicator.klyta.it/#/envelope)]|
|| Have you created a fancy refresh indicator? This place is for you. Open PR. |
67
+
|Programmatically controlled [[SOURCE](example/lib/screens/programmatically_controlled_indicator_screen.dart)][[DEMO](https://custom-refresh-indicator.klyta.it/#/programmatically-controlled)]|Your indicator| Your indicator |
|| Have you created a fancy refresh indicator? This place is for you. [Open PR](https://github.com/gonuit/flutter-custom-refresh-indicator/pulls). | Have you created a fancy refresh indicator? This place is for you. [Open PR](https://github.com/gonuit/flutter-custom-refresh-indicator/pulls). |
81
70
82
71
# Documentation
83
72
84
73
## CustomRefreshIndicator widget
85
74
86
-
`CustomRefreshIndicator` widget provides an absolute minimum functionality that allows you to create and set your own custom indicators.
75
+
The _CustomRefreshIndicator_ widget provides an absolute minimum functionality that allows you to create and set your own custom indicators.
76
+
77
+
### onStateChanged
78
+
79
+
The _onStateChanged_ callback is called everytime _IndicatorState_ has been changed.
80
+
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).
81
+
82
+
Example usage:
83
+
84
+
```dart
85
+
CustomRefreshIndicator(
86
+
onRefresh: onRefresh,
87
+
// You can track state changes here.
88
+
onStateChanged: (IndicatorStateChange change) {
89
+
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.
104
+
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
105
94
-

106
+
[](https://custom-refresh-indicator.klyta.it/#/presentation)
@@ -104,50 +117,11 @@ The best way to understand how the "CustomRefreshIndicator" widget changes its c
104
117
105
118
---
106
119
107
-
### IndicatorStateHelper
120
+
### Support
108
121
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.
/// When the state changes from [idle] to [dragging]
135
-
if (_helper.didStateChange(
136
-
from: IndicatorState.idle,
137
-
to: IndicatorState.dragging,
138
-
)) {
139
-
// Code...
140
-
}
141
-
142
-
/// When the state changes from [idle] to another.
143
-
if (_helper.didStateChange(
144
-
from: IndicatorState.idle,
145
-
)) {
146
-
// Code...
147
-
}
148
-
149
-
/// When the state changes.
150
-
if (_helper.didStateChange()) {
151
-
// Code...
152
-
}
153
-
```
122
+
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.
123
+
124
+
<divalign="center">
125
+
<ahref="https://www.buymeacoffee.com/kamilklyta"target="_blank"><imgheight="60px"width="217px"src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png"alt="Buy Me A Coffee"style="height: 60px!important;width: 217px!important;" ></a>
0 commit comments