Skip to content

Commit 4b9c36d

Browse files
committed
docs: update quick start section
1 parent b2230c9 commit 4b9c36d

File tree

4 files changed

+38
-40
lines changed

4 files changed

+38
-40
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 3.0.0-beta.2
1+
## 3.0.0-beta.3
22
- **CustomRefreshIndicator**:
33
- Deprecated *indicatorFinalizeDuration*, *indicatorSettleDuration*, *indicatorCancelDuration* and *completeStateDuration* parameters in favor of *durations*.
44
- The indicator widget will now be rebuilt every time *state* changes, even if the *autoRebuilt* parameter is set to false. This will make managing the state of the indicator widget simpler.

README.md

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Create your own custom refresh indicator widget in the blink of an eye!
99
### Features:
1010

1111
- [Create a **COMPLETELY** custom refresh indicator widget.](#examples)
12-
- [Quickly change the content of the material refresh indicator.](#materialindicatordelegate)
12+
- [Quickly change the content of the material refresh indicator.](#custommaterialindicator)
1313
- [Trigger refresh indicator on horizontal lists (online example).](https://custom-refresh-indicator.klyta.it/#/horizontal)
1414
- [Trigger the refresh indicator from the leading, trailing, or both scroll edges.](#trigger-indicatortrigger)
1515

@@ -19,46 +19,14 @@ Create your own custom refresh indicator widget in the blink of an eye!
1919

2020
## QUICK START
2121

22-
```dart
23-
CustomRefreshIndicator(
24-
/// Scrollable widget
25-
child: ListView.builder(
26-
itemBuilder: (BuildContext context, int index) => Text(index.toString()),
27-
),
28-
/// The function that builds the indicator
29-
builder: (
30-
BuildContext context,
31-
Widget child,
32-
IndicatorController controller,
33-
) {
34-
/// TODO: Implement your own refresh indicator
35-
return Stack(
36-
children: <Widget>[
37-
/// The scroll widget that was passed as the [child] argument.
38-
///
39-
/// TIP:
40-
/// You can also wrap [child] with the [Transform] widget to also animate the list transformation (see the example app).
41-
child,
42-
43-
/// Your indicator implementation
44-
return MyIndicator(value: controller.value, loading: controller.state.isLoading);
45-
],
46-
);
47-
}
48-
/// A function that is called when the user drags the refresh indicator.
49-
onRefresh: myAsyncRefreshFunction,
50-
)
51-
```
52-
53-
## CustomMaterialIndicator
22+
### **CustomMaterialIndicator**
5423

5524
If you just want to replace the content of the material indicator, you can use _CustomMaterialIndicator_ widget, which builds a material container. In addition to the built in _RefreshIndicator_ it supports horizontal lists and triggering from both edges (see the [trigger argument](#trigger-indicatortrigger)).
5625

57-
### Code:
5826

5927
```dart
6028
CustomMaterialIndicator(
61-
onRefresh: myAsyncRefreshFunction,
29+
onRefresh: onRefresh, // Your refresh logic
6230
builder: (context, controller) {
6331
return Icon(
6432
Icons.ac_unit,
@@ -72,7 +40,37 @@ CustomMaterialIndicator(
7240

7341
### Effect:
7442

75-
![simple_indicator](readme/simple_indicator.gif)
43+
<div align="center">
44+
<a href="https://custom-refresh-indicator.klyta.it/#/presentation" target="_blank">
45+
<img width="200px" src="https://raw.githubusercontent.com/gonuit/flutter-custom-refresh-indicator/master/readme/simple_indicator.gif" alt="Controller data example" >
46+
</a>
47+
</div>
48+
49+
50+
### **CustomRefreshIndicator**
51+
52+
Elevate your Flutter app with a tailor-made refresh indicator using the CustomRefreshIndicator widget. Just wrap your scrollable list, and design your unique indicator. It's that easy! 😏
53+
54+
```dart
55+
CustomRefreshIndicator(
56+
onRefresh: onRefresh, // Your refresh logic
57+
builder: (context, child, controller) {
58+
// Place your custom indicator here.
59+
// Need inspiration? Look at the example app!
60+
return MyIndicator(
61+
child: child,
62+
controller: controller,
63+
);
64+
},
65+
child: ListView.builder(
66+
itemBuilder: (_, index) => Text('Item $index'),
67+
),
68+
)
69+
```
70+
71+
### ~~Effect:~~ What's Possible?
72+
73+
Your creativity sets the boundaries! Explore our examples (just scroll a bit 👇) to see what you can build. From subtle animations to eye-catching visuals, make the refresh action a delightful moment. 🚀
7674

7775
# Examples
7876

@@ -142,7 +140,7 @@ CustomRefreshIndicator(
142140

143141
### Customization
144142

145-
- **notificationPredicate ()**: Determines which _ScrollNotifications_ will trigger the indicator.
143+
- **notificationPredicate (ScrollNotificationPredicate)**: Determines which _ScrollNotifications_ will trigger the indicator.
146144
- **leadingScrollIndicatorVisible (bool)**: Visibility of the leading scroll indicator.
147145
- **trailingScrollIndicatorVisible (bool)**: Visibility of the trailing scroll indicator.
148146

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ packages:
4747
path: ".."
4848
relative: true
4949
source: path
50-
version: "3.0.0-beta.2"
50+
version: "3.0.0-beta.3"
5151
fake_async:
5252
dependency: transitive
5353
description:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: custom_refresh_indicator
22
description: Widget that makes it easy to implement a custom pull to refresh gesture.
3-
version: 3.0.0-beta.2
3+
version: 3.0.0-beta.3
44
repository: https://github.com/gonuit/flutter-custom-refresh-indicator
55
issue_tracker: https://github.com/gonuit/flutter-custom-refresh-indicator/issues
66
homepage: https://github.com/gonuit/flutter-custom-refresh-indicator

0 commit comments

Comments
 (0)