Skip to content

Commit

Permalink
fix starting index for custom layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
danReynolds authored and TheAnkurPanchani committed Jun 4, 2021
1 parent d512373 commit 654d34a
Showing 1 changed file with 2 additions and 2 deletions.
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;
late int _startIndex;
int? _animationCount;
int _currentIndex = 0;

@override
void initState() {
_currentIndex = widget.index ?? 0;
if (widget.itemWidth == null) {
throw Exception(
'==============\n\nwidget.itemWidth must not be null when use stack layout.\n========\n',
Expand Down Expand Up @@ -245,8 +247,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

0 comments on commit 654d34a

Please sign in to comment.