October 27, 2024
Chicago 12, Melborne City, USA
Android

card swiper flutter , no response swip when press button


i use card swiper package and everthing is fine but when i use flaoting button to swip a card to sepcific direction nothhing happen when press it



Flexible(
          child: CardSwiper(
            controller: CardSwiperController(),
            cardsCount: flip_cards.length,
            onSwipe: _onswip,
            onUndo: _onUndo,
            isLoop: false,
            numberOfCardsDisplayed: 3,
            cardBuilder: (
              context,
              index,
              horizontalThresholdPercentage,
              verticalThresholdPercentage,
            ) =>
                flip_cards[index],
          ),
        ),


FloatingActionButton(
              onPressed: () {
                controller.swipe(CardSwiperDirection.right);
              },
              child: const Icon(
                Icons.thumb_up,
                color: Colors.green,
                size: 80.0,
              ),

i tried to put setstate when press and change button to elevated button



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video