fix(stack): use the stack to render the items

This commit is contained in:
Ricardo Dalarme 2023-02-21 20:51:34 -03:00
parent 6aa09f71dd
commit 7fdcb099d9
1 changed files with 2 additions and 2 deletions

View File

@ -173,7 +173,7 @@ class _CardSwiperState<T extends Widget> extends State<CardSwiper<T>>
angle: _angle, angle: _angle,
child: ConstrainedBox( child: ConstrainedBox(
constraints: constraints, constraints: constraints,
child: widget.cards[_currentIndex], child: _stack[_currentIndex],
), ),
), ),
onTap: () { onTap: () {
@ -226,7 +226,7 @@ class _CardSwiperState<T extends Widget> extends State<CardSwiper<T>>
constraints: constraints, constraints: constraints,
child: _stack.length <= 1 child: _stack.length <= 1
? widget.cards.last ? widget.cards.last
: widget.cards[_currentIndex - 1], : _stack[_currentIndex - 1],
), ),
), ),
); );