Skip to content

Commit

Permalink
Merge pull request #8 from aagarwal1012/develop
Browse files Browse the repository at this point in the history
Merge #6 and updated version
  • Loading branch information
aagarwal1012 authored Jan 30, 2019
2 parents bb6562c + 5bda416 commit 0e79fd1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.1.0
* Added new parameter **scrollController** that can be added to control the `ScrollView` child.

## 1.0.2

## 1.0.1
Expand Down
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Add this to your package's `pubspec.yaml` file:

```yaml
dependencies:
liquid_pull_to_refresh: ^1.0.2
liquid_pull_to_refresh: ^1.1.0
```
### 2. Install it
Expand Down Expand Up @@ -103,17 +103,18 @@ If you do not want the opacity transition of child then set `showChildOpacityTra

### LiquidPullToRefresh Class

| Dart attribute | Datatype | Description | Default Value |
| :------------------------------------ | :-------------------------- | :----------------------------------------------------------- | :---------------------------: |
| child | ScrollView | The widget below this widget in the tree. | @required |
| onRefresh | RefreshCallback | A function that's called when the refreshing of page takes place. | @required |
| height | double | The distance from the child's top or bottom edge to where the box will settle after the spring effect. | 100.0 |
| springAnimationDurationInMilliseconds | int | Duration in milliseconds of springy effect that occurs when we leave dragging after full drag. | 1000 |
| borderWidth | double | Border width of progressing circle in Progressing Indicator. | 2.0 |
| showChildOpacityTransition | bool | Whether to show child opacity transition or not. | true |
| color | Color | The progress indicator's foreground color. | ThemeData.accentColor |
| backgroundColor | Color | The progress indicator's background color. | ThemeData.canvasColor |
| notificationPredicate | ScrollNotificationPredicate | A check that specifies whether a `ScrollNotification` should be handled by this widget. | null |
| Dart attribute | Datatype | Description | Default Value |
| :------------------------------------ | :-------------------------- | :----------------------------------------------------------- | :-------------------: |
| child | ScrollView | The widget below this widget in the tree. | @required |
| onRefresh | RefreshCallback | A function that's called when the refreshing of page takes place. | @required |
| height | double | The distance from the child's top or bottom edge to where the box will settle after the spring effect. | 100.0 |
| springAnimationDurationInMilliseconds | int | Duration in milliseconds of springy effect that occurs when we leave dragging after full drag. | 1000 |
| borderWidth | double | Border width of progressing circle in Progressing Indicator. | 2.0 |
| showChildOpacityTransition | bool | Whether to show child opacity transition or not. | true |
| color | Color | The progress indicator's foreground color. | ThemeData.accentColor |
| backgroundColor | Color | The progress indicator's background color. | ThemeData.canvasColor |
| notificationPredicate | ScrollNotificationPredicate | A check that specifies whether a `ScrollNotification` should be handled by this widget. | null |
| scrollController | ScrollCOntroller | Controls the `ScrollView` child. | null |

For help on editing package code, view the [flutter documentation](https://flutter.io/developing-packages/).

Expand Down
7 changes: 7 additions & 0 deletions lib/liquid_pull_to_refresh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class LiquidPullToRefresh extends StatefulWidget {
this.springAnimationDurationInMilliseconds = 1000,
this.borderWidth = 2.0,
this.showChildOpacityTransition = true,
this.scrollController,
}) : assert(child != null),
assert(onRefresh != null),
assert(notificationPredicate != null),
Expand Down Expand Up @@ -110,6 +111,10 @@ class LiquidPullToRefresh extends StatefulWidget {
/// else for more complicated layouts.
final ScrollNotificationPredicate notificationPredicate;

/// Controls the [ScrollView] child.
/// [null] by default.
final ScrollController scrollController;

@override
_LiquidPullToRefreshState createState() => _LiquidPullToRefreshState();
}
Expand Down Expand Up @@ -611,6 +616,7 @@ class _LiquidPullToRefreshState extends State<LiquidPullToRefresh>
child: NotificationListener<OverscrollIndicatorNotification>(
onNotification: _handleGlowNotification,
child: CustomScrollView(
controller: widget.scrollController,
slivers: slivers,
),
),
Expand Down Expand Up @@ -654,6 +660,7 @@ class _LiquidPullToRefreshState extends State<LiquidPullToRefresh>
child: NotificationListener<OverscrollIndicatorNotification>(
onNotification: _handleGlowNotification,
child: CustomScrollView(
controller: widget.scrollController,
slivers: slivers,
),
),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: liquid_pull_to_refresh
description: A beautiful and custom refresh indicator with some cool animations and transitions for flutter.
version: 1.0.2
version: 1.1.0
author: Ayush Agarwal <[email protected]>
homepage: https://github.com/aagarwal1012/Liquid-Pull-To-Refresh/

Expand Down

0 comments on commit 0e79fd1

Please sign in to comment.