diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..fc60389 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,5 @@ +{ + "MD041": false, + "MD033": false, + "MD013": false +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 712e0b9..56e6024 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 1.1.0 * Added support for all TargetPlatform. -* Added cacheExtent property +* Added cacheExtent property. * SDK version is up. ## 1.0.2 diff --git a/README.md b/README.md index 7064d90..2843b00 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,11 @@ This package is part of the [SurfGear](https://github.com/surfstudio/SurfGear) t Widget for refresh by swipe. +- :1234: Enabled on every platform - the package is fully written on Flutter side and enabled on every platform. +- :recycle: Fully covered by tests - guaranteeing the result and expectations from this package. +- :notebook_with_decorative_cover: End-to-end documentation - every aspect of implementation is documented, so there is full understanding. +- :cow2: Support from the best Flutter experts - we are open to any enhancement ideas and contributions. + ![](https://i.ibb.co/7Kmy91f/material.gif) ![](https://i.ibb.co/smPxRp7/cupertino.gif) diff --git a/lib/src/material_swipe_refresh.dart b/lib/src/material_swipe_refresh.dart index cfae4ba..8aa78e6 100644 --- a/lib/src/material_swipe_refresh.dart +++ b/lib/src/material_swipe_refresh.dart @@ -87,6 +87,14 @@ class MaterialSwipeRefresh extends SwipeRefreshBase { class _MaterialSwipeRefreshState extends SwipeRefreshBaseState { + late final ScrollController _scrollController; + + @override + void initState() { + super.initState(); + _scrollController = widget.scrollController ?? ScrollController(); + } + @override Widget buildRefresher( Key key, @@ -109,7 +117,7 @@ class _MaterialSwipeRefreshState shrinkWrap: widget.shrinkWrap, padding: widget.padding, cacheExtent: widget.cacheExtent, - controller: widget.scrollController ?? ScrollController(), + controller: _scrollController, physics: AlwaysScrollableScrollPhysics(parent: widget.physics), keyboardDismissBehavior: widget.keyboardDismissBehavior ?? ScrollViewKeyboardDismissBehavior.manual, @@ -120,7 +128,7 @@ class _MaterialSwipeRefreshState padding: widget.padding, cacheExtent: widget.cacheExtent, childrenDelegate: widget.childrenDelegate!, - controller: widget.scrollController ?? ScrollController(), + controller: _scrollController, keyboardDismissBehavior: widget.keyboardDismissBehavior ?? ScrollViewKeyboardDismissBehavior.manual, physics: AlwaysScrollableScrollPhysics(parent: widget.physics), diff --git a/pubspec.yaml b/pubspec.yaml index 24a6e99..d62b327 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: swipe_refresh -version: 1.0.5 +version: 1.1.0 description: Set of widgets provides make refresh by using pull down gesture. repository: "https://github.com/surfstudio/flutter-swipe-refresh" issue_tracker: "https://github.com/surfstudio/flutter-swipe-refresh/issues"