From 941e653f8278781cbfc88aaa73abe458686fc14f Mon Sep 17 00:00:00 2001 From: Dan Reynolds Date: Thu, 16 Jul 2020 01:53:42 -0400 Subject: [PATCH 1/2] fix starting index for custom layouts --- CHANGELOG.md | 3 +++ lib/src/custom_layout.dart | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf3bd83..db72c2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [1.1.6] - [2020/07/16] + + * Fix index for custom layouts ## [1.1.5] - [2019/03/10] diff --git a/lib/src/custom_layout.dart b/lib/src/custom_layout.dart index 8ce77f2..6ebc4b4 100644 --- a/lib/src/custom_layout.dart +++ b/lib/src/custom_layout.dart @@ -8,9 +8,11 @@ abstract class _CustomLayoutStateBase extends State AnimationController _animationController; int _startIndex; int _animationCount; + int _currentIndex; @override void initState() { + _currentIndex = widget.index ?? 0; if (widget.itemWidth == null) { throw new Exception( "==============\n\nwidget.itemWith must not be null when use stack layout.\n========\n"); @@ -244,8 +246,6 @@ abstract class _CustomLayoutStateBase extends State _animationController.value = value; } - - int _currentIndex = 0; } double _getValue(List values, double animationValue, int index) { diff --git a/pubspec.yaml b/pubspec.yaml index 17ed711..93683a4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_swiper description: The best swiper(carousel) for flutter, with multiple layouts, infinite loop. Compatible with Android & iOS. -version: 1.1.6 +version: 1.1.7 author: JZoom homepage: https://github.com/jzoom/flutter_swiper From 8cc3903f2f45459f85212295fc1b774ced6de33f Mon Sep 17 00:00:00 2001 From: Dan Reynolds Date: Tue, 22 Sep 2020 09:29:01 -0400 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db72c2e..016c602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## [1.1.6] - [2020/07/16] +## [1.1.7] - [2020/07/16] * Fix index for custom layouts @@ -84,4 +84,4 @@ * Pagination * Custom control buttons * Custom pagination - * Controler \ No newline at end of file + * Controler