Skip to content

Commit 1a699b6

Browse files
author
Kamil Klyta
committed
Typo fix
1 parent 9012595 commit 1a699b6

File tree

9 files changed

+32
-23
lines changed

9 files changed

+32
-23
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## [0.8.0] - April 12, 2020
1+
## [0.8.0+1] - April 12, 2020
22

33
## BREAKING API CHANGES
44

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ CustomRefreshIndicator(
5353

5454
### How the controller data change
5555

56-
The best way to understand how the "CustomRefreshIndicator" widget changes its controller data is to see the example 😉.
56+
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.
57+
5758
![Controller_Data](readme/controller_data.gif)
5859

5960
## Examples
@@ -98,7 +99,7 @@ CustomRefreshIndicator is idle (There is no action)
9899
controller.value == 0.0
99100
```
100101

101-
#### `draging`
102+
#### `dragging`
102103

103104
Whether the user is dragging a scrollable widget.
104105
Ending the scroll **WILL NOT** result in `onRefresh` function call
@@ -122,7 +123,7 @@ controller.value >= 1.0
122123
#### `hiding`
123124

124125
CustomRefreshIndicator is hiding its indicator. After the future returned from `onRefresh` function is completed or scroll ended when the state was equal to `dragging` or the user started scrolling through the list.
125-
controller value decreases to `0.0` in duration specified by `dragingToIdleDuration` CustomRefreshIndicator widget argument.
126+
controller value decreases to `0.0` in duration specified by `draggingToIdleDuration` CustomRefreshIndicator widget argument.
126127

127128
```dart
128129
controller.value <= 1.0

example/lib/screens/presentation_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class _PresentationScreenState extends State<PresentationScreen> {
2424
child: CustomRefreshIndicator(
2525
loadingToIdleDuration: const Duration(seconds: 1),
2626
armedToLoadingDuration: const Duration(seconds: 1),
27-
dragingToIdleDuration: const Duration(seconds: 1),
27+
draggingToIdleDuration: const Duration(seconds: 1),
2828
leadingGlowVisible: false,
2929
trailingGlowVisible: false,
3030
offsetToArmed: 100.0,

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ packages:
7777
path: ".."
7878
relative: true
7979
source: path
80-
version: "0.8.0"
80+
version: "0.8.0+1"
8181
flutter:
8282
dependency: "direct main"
8383
description: flutter

lib/src/controller.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ enum IndicatorState {
77
/// (`CustomRefreshIndicatorData.value == 0`)
88
idle,
99

10-
/// #### Whether user is draging [CustomRefreshIndicator]
10+
/// #### Whether user is dragging [CustomRefreshIndicator]
1111
/// ending the scroll **WILL NOT** result in `onRefresh` call
1212
///
1313
/// (`CustomRefreshIndicatorData.value < 1`)
14-
draging,
14+
dragging,
1515

1616
/// #### [CustomRefreshIndicator] is armed
1717
/// ending the scroll **WILL** result in:
@@ -29,7 +29,7 @@ enum IndicatorState {
2929
/// so `value` was less than `1` or the user started scrolling through the list)
3030
///
3131
/// (`CustomRefreshIndicatorData.value` decreases to `0`
32-
/// in duration specified by `CustomRefreshIndicator.dragingToIdleDuration`)
32+
/// in duration specified by `CustomRefreshIndicator.draggingToIdleDuration`)
3333
hiding,
3434

3535
/// #### [CustomRefreshIndicator] is awaiting on `onRefresh` call result
@@ -132,14 +132,14 @@ class IndicatorController extends ChangeNotifier {
132132
/// Describes current [CustomRefreshIndicator] state
133133
IndicatorState get state => _state;
134134
bool get isArmed => _state == IndicatorState.armed;
135-
bool get isDraging => _state == IndicatorState.draging;
135+
bool get isDragging => _state == IndicatorState.dragging;
136136
bool get isLoading => _state == IndicatorState.loading;
137137
bool get isHiding => _state == IndicatorState.hiding;
138138
bool get isIdle => _state == IndicatorState.idle;
139139

140140
bool _refreshEnabled;
141141

142-
/// Whether custom refresh indicator can change [IndicatorState] from `idle` to `draging`
142+
/// Whether custom refresh indicator can change [IndicatorState] from `idle` to `dragging`
143143
bool get isRefreshEnabled => _refreshEnabled;
144144

145145
/// Disables list pull to refresh

lib/src/custom_refresh_indicator.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CustomRefreshIndicator extends StatefulWidget {
1212

1313
/// Duration of changing [IndicatorController] value from `<1.0` to `0.0`.
1414
/// When user stop dragging list before it become to armed [IndicatorState].
15-
final Duration dragingToIdleDuration;
15+
final Duration draggingToIdleDuration;
1616

1717
/// Duration of changing [IndicatorController] value from `<=1.5` to `1.0`.
1818
/// Will start just before [onRefresh] function invocation.
@@ -75,7 +75,7 @@ class CustomRefreshIndicator extends StatefulWidget {
7575
this.controller,
7676
this.offsetToArmed,
7777
this.extentPercentageToArmed = defaultExtentPercentageToArmed,
78-
this.dragingToIdleDuration = const Duration(milliseconds: 300),
78+
this.draggingToIdleDuration = const Duration(milliseconds: 300),
7979
this.armedToLoadingDuration = const Duration(milliseconds: 200),
8080
this.loadingToIdleDuration = const Duration(milliseconds: 100),
8181
this.leadingGlowVisible = false,
@@ -92,7 +92,7 @@ class _CustomRefreshIndicatorState extends State<CustomRefreshIndicator>
9292
with TickerProviderStateMixin {
9393
bool __canStart = false;
9494

95-
/// Whether custom refresh indicator can change [IndicatorState] from `idle` to `draging`
95+
/// Whether custom refresh indicator can change [IndicatorState] from `idle` to `dragging`
9696
bool get _canStart =>
9797
__canStart && _customRefreshIndicatorController._refreshEnabled;
9898
set _canStart(bool canStart) {
@@ -156,15 +156,15 @@ class _CustomRefreshIndicatorState extends State<CustomRefreshIndicator>
156156
_canStart = notification.metrics.extentBefore == 0 &&
157157
controller.state == IndicatorState.idle;
158158

159-
if (_canStart) controller._setIndicatorState(IndicatorState.draging);
159+
if (_canStart) controller._setIndicatorState(IndicatorState.dragging);
160160

161161
controller._setAxisDirection(notification.metrics.axisDirection);
162162
return false;
163163
}
164164

165165
bool _handleScrollUpdateNotification(ScrollUpdateNotification notification) {
166166
/// hide when list starts to scroll
167-
if (controller.state == IndicatorState.draging ||
167+
if (controller.state == IndicatorState.dragging ||
168168
controller.state == IndicatorState.armed) {
169169
if (notification.metrics.extentBefore > 0.0) {
170170
_hide();
@@ -220,7 +220,7 @@ class _CustomRefreshIndicatorState extends State<CustomRefreshIndicator>
220220
if (newValue >= CustomRefreshIndicator.armedFromValue) {
221221
controller._setIndicatorState(IndicatorState.armed);
222222
} else if (newValue > 0.0) {
223-
controller._setIndicatorState(IndicatorState.draging);
223+
controller._setIndicatorState(IndicatorState.dragging);
224224
}
225225

226226
/// triggers indicator update
@@ -267,7 +267,7 @@ class _CustomRefreshIndicatorState extends State<CustomRefreshIndicator>
267267
_canStart = false;
268268
await _animationController.animateTo(
269269
0.0,
270-
duration: widget.dragingToIdleDuration,
270+
duration: widget.draggingToIdleDuration,
271271
curve: Curves.ease,
272272
);
273273

lib/src/helpers/positioned_indicator_container.dart

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,18 @@ class PositionedIndicatorContainer extends StatelessWidget {
1919
final double positionFromSide = -50 + (controller.value * 110);
2020

2121
return Positioned(
22-
top: controller.direction == AxisDirection.down ? positionFromSide : null,
23-
bottom: controller.direction == AxisDirection.up ? positionFromSide : null,
24-
left: controller.direction == AxisDirection.right ? positionFromSide : null,
25-
right: controller.direction == AxisDirection.left ? positionFromSide : null,
22+
top: controller.direction == AxisDirection.down
23+
? positionFromSide
24+
: null,
25+
bottom: controller.direction == AxisDirection.up
26+
? positionFromSide
27+
: null,
28+
left: controller.direction == AxisDirection.right
29+
? positionFromSide
30+
: null,
31+
right: controller.direction == AxisDirection.left
32+
? positionFromSide
33+
: null,
2634
child: Container(
2735
height: controller.isHorizontalDirection
2836
? MediaQuery.of(context).size.height

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: Flutter Widget that make it easy to implement custom refresh indicator.
3-
version: 0.8.0
3+
version: 0.8.0+1
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

readme/controller_data.gif

-1.97 MB
Loading

0 commit comments

Comments
 (0)