Skip to content

Commit a192774

Browse files
authored
Merge pull request #59 from gonuit/v4.0.0
V4.0.0
2 parents 8268a0d + c53a421 commit a192774

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2100
-1161
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,6 @@ build/
7474
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
7575

7676
# Flutter version manager
77-
.fvm
77+
78+
# FVM Version Cache
79+
.fvm/

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## 4.0.0-dev.3
2+
- **CustomRefreshIndicator**:
3+
- Removed deprecated parameters: *indicatorCancelDuration*, *indicatorSettleDuration*, *indicatorFinalizeDuration* and *completeStateDuration* .If you are still using them, switch to the *duration* parameter.
4+
- Improved handling of indicator controller changes.
5+
- Fixed missing *dragDetails* data when overscrolling.
6+
- **IndicatorController**:
7+
- Added *minValue* and *maxValue* static constants.
8+
- Added *transform* method. Allows you to transform controller animation values from the range *0.0**1.5* to another range.
9+
- Added *normalize* method. Normalizes *value* by converting it to the range *0.0**1.0*. This allows the animation to be used directly with most Flutter widgets and tweens. You can still use *clamp* if you want to remove values above *1.0* instead of transforming the whole range.
10+
- **CustomMaterialIndicator**:
11+
- Redesigned/reimplemented. Now, when *indicatorBuilder* argument is not provided, it completely recreates the look and behavior of the built-in *RefreshIndicator* widget.
12+
- Added *CustomMaterialIndicator.adaptive* constructor.
13+
- *indicatorBuilder* parameter is now optional.
14+
- The deprecated parameter *withRotation* has been removed. It was confusing and was not related to the material indicator design. To add rotation to the indicator, you need to implement rotation yourself 😔.
15+
- Added *color*, *semanticsValue*, *semanticsLabel* and *strokeWidth* parameters. They are applied only when the default *indicatorBuilder* is used (given a null value).
16+
- Removed deprecated *IndicatorBuilderDelegate* and *MaterialIndicatorDelegate* classes.
17+
- Added *TransformedAnimation* class that allows transforming the parent animation value.
18+
- Exposed a *PositionedIndicatorContainer* widget that allows easy positioning of the indicator.
19+
- **Example app**:
20+
- Updated custom material indicator example.
21+
- Updated application design.
22+
- Added tooltips.
23+
- Added *ball indicator* example, which is an overview of the drag details based indicator.
24+
- Updated web example.
125
## 3.1.2
226
- Deprecated the *withRotation* argument of the *CustomMaterialIndicator* widget. The rotation function will be removed in the upcoming version.
327
- Fixed missing drag detail (*IndicatorController.dragDetails*) information from scroll events.

README.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ If you just want to replace the content of the material indicator, you can use _
2727
```dart
2828
CustomMaterialIndicator(
2929
onRefresh: onRefresh, // Your refresh logic
30-
builder: (context, controller) {
31-
return Icon(
32-
Icons.ac_unit,
33-
color: Colors.blue,
34-
size: 30,
30+
backgroundColor: Colors.white,
31+
indicatorBuilder: (context, controller) {
32+
return Padding(
33+
padding: const EdgeInsets.all(6.0),
34+
child: CircularProgressIndicator(
35+
color: Colors.redAccent,
36+
value: controller.state.isLoading ? null : math.min(controller.value, 1.0),
37+
),
3538
);
3639
},
37-
child: scrollable,
40+
child: child,
3841
)
3942
```
4043

@@ -74,19 +77,22 @@ Your creativity sets the boundaries! Explore our examples (just scroll a bit
7477

7578
# Examples
7679

77-
Almost all of these examples are available in the example application.
80+
All these examples are available in the example application.
7881

79-
| Plane indicator [[SOURCE](example/lib/indicators/plane_indicator.dart)][[DEMO](https://custom-refresh-indicator.klyta.it/#/plane)] | Ice cream [[SOURCE](example/lib/indicators/ice_cream_indicator.dart)][[DEMO](https://custom-refresh-indicator.klyta.it/#/ice-cream)] | Warp [[SOURCE](example/lib/indicators/warp_indicator.dart)][[DEMO](https://custom-refresh-indicator.klyta.it/#/warp)] |
80-
| :--------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------: |
81-
| ![plane_indicator](readme/plane_indicator.gif) | ![ice_cream_indicator](readme/ice_cream_indicator.gif) | ![warp_indicator](readme/warp_indicator.gif) |
82+
| Plane indicator | Ice cream | Warp |
83+
| :-----------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------: |
84+
| ![plane_indicator](readme/plane_indicator.gif) | ![ice_cream_indicator](readme/ice_cream_indicator.gif) | ![warp_indicator](readme/warp_indicator.gif) |
85+
| [[SOURCE](example/lib/indicators/plane_indicator.dart)] [[DEMO](https://custom-refresh-indicator.klyta.it/#/plane)] | [[SOURCE](example/lib/indicators/ice_cream_indicator.dart)] [[DEMO](https://custom-refresh-indicator.klyta.it/#/ice-cream)] | [[SOURCE](example/lib/indicators/warp_indicator.dart)] [[DEMO](https://custom-refresh-indicator.klyta.it/#/warp)] |
8286

83-
| 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)] |
84-
| :----------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------: |
85-
| ![indicator_with_complete_state](readme/indicator_with_complete_state.gif) | ![fetch_more](readme/fetch_more.gif) | ![Envelope indicator](readme/envelope_indicator.gif) |
87+
| With complete state | Pull to fetch more | Envelope |
88+
| :---------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------: |
89+
| ![complete_state](readme/complete_state.gif) | ![fetch_more](readme/fetch_more.gif) | ![Envelope indicator](readme/envelope_indicator.gif) |
90+
| [[SOURCE](example/lib/indicators/check_mark_indicator.dart)] [[DEMO](https://custom-refresh-indicator.klyta.it/#/check-mark)] | [[SOURCE](example/lib/indicators/swipe_action.dart)] [[DEMO](https://custom-refresh-indicator.klyta.it/#/fetch-more)] | [[SOURCE](example/lib/indicators/envelope_indicator.dart)] [[DEMO](https://custom-refresh-indicator.klyta.it/#/envelope)] |
8691

87-
| Programmatically controlled [[SOURCE](example/lib/screens/programmatically_controlled_indicator_screen.dart)][[DEMO](https://custom-refresh-indicator.klyta.it/#/programmatically-controlled)] | Your indicator | Your indicator |
88-
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------: |
89-
| ![programmatically_controlled](readme/programmatically_controlled.gif) | 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). |
92+
| Controlled | Based on drag details | Your indicator |
93+
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------: |
94+
| ![programmatically_controlled](readme/programmatically_controlled.gif) | ![drag_details](readme/drag_details.gif) | Have you created a fancy refresh indicator? This place is for you. |
95+
| [[SOURCE](example/lib/screens/programmatically_controlled_indicator_screen.dart)] [[DEMO](https://custom-refresh-indicator.klyta.it/#/programmatically-controlled)] | [[SOURCE](example/lib/indicators/ball_indicator.dart)] [[DEMO](https://custom-refresh-indicator.klyta.it/#/drag-details)] | [[OPEN PULL REQUEST](https://github.com/gonuit/flutter-custom-refresh-indicator/pulls)] |
9096

9197
---
9298

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>11.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
isa = PBXProject;
170170
attributes = {
171171
BuildIndependentTargetsInParallel = YES;
172-
LastUpgradeCheck = 1430;
172+
LastUpgradeCheck = 1510;
173173
ORGANIZATIONNAME = "";
174174
TargetAttributes = {
175175
331C8080294A63A400263BE5 = {
@@ -345,7 +345,7 @@
345345
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
346346
GCC_WARN_UNUSED_FUNCTION = YES;
347347
GCC_WARN_UNUSED_VARIABLE = YES;
348-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
348+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
349349
MTL_ENABLE_DEBUG_INFO = NO;
350350
SDKROOT = iphoneos;
351351
SUPPORTED_PLATFORMS = iphoneos;
@@ -473,7 +473,7 @@
473473
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
474474
GCC_WARN_UNUSED_FUNCTION = YES;
475475
GCC_WARN_UNUSED_VARIABLE = YES;
476-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
476+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
477477
MTL_ENABLE_DEBUG_INFO = YES;
478478
ONLY_ACTIVE_ARCH = YES;
479479
SDKROOT = iphoneos;
@@ -522,7 +522,7 @@
522522
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
523523
GCC_WARN_UNUSED_FUNCTION = YES;
524524
GCC_WARN_UNUSED_VARIABLE = YES;
525-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
525+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
526526
MTL_ENABLE_DEBUG_INFO = NO;
527527
SDKROOT = iphoneos;
528528
SUPPORTED_PLATFORMS = iphoneos;

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)