Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix starting index for custom layouts #212

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [1.1.7] - [2020/07/16]

* Fix index for custom layouts

## [1.1.5] - [2019/03/10]

Expand Down Expand Up @@ -81,4 +84,4 @@
* Pagination
* Custom control buttons
* Custom pagination
* Controler
* Controler
4 changes: 2 additions & 2 deletions lib/src/custom_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ abstract class _CustomLayoutStateBase<T extends _SubSwiper> extends State<T>
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");
Expand Down Expand Up @@ -244,8 +246,6 @@ abstract class _CustomLayoutStateBase<T extends _SubSwiper> extends State<T>

_animationController.value = value;
}

int _currentIndex = 0;
}

double _getValue(List<double> values, double animationValue, int index) {
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: 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 <[email protected]>
homepage: https://github.com/jzoom/flutter_swiper

Expand Down