flutter card swiper fork, with my modifications
Go to file
Ricardo Dalarme bb0fc895e0 feat(example): improve example perfomance 2023-01-12 21:03:25 -03:00
example feat(example): improve example perfomance 2023-01-12 21:03:25 -03:00
lib chore(lint): add flutter_lints 2023-01-12 20:45:42 -03:00
readme-assets chore: fork project from `cta-flutter-tinder-card-animation` 2023-01-12 20:38:20 -03:00
test chore: fork project from `cta-flutter-tinder-card-animation` 2023-01-12 20:38:20 -03:00
.gitignore chore: fork project from `cta-flutter-tinder-card-animation` 2023-01-12 20:38:20 -03:00
.metadata chore: fork project from `cta-flutter-tinder-card-animation` 2023-01-12 20:38:20 -03:00
CHANGELOG.md chore: fork project from `cta-flutter-tinder-card-animation` 2023-01-12 20:38:20 -03:00
LICENSE chore: fork project from `cta-flutter-tinder-card-animation` 2023-01-12 20:38:20 -03:00
README.md chore: fork project from `cta-flutter-tinder-card-animation` 2023-01-12 20:38:20 -03:00
analysis_options.yaml chore(lint): add flutter_lints 2023-01-12 20:45:42 -03:00
pubspec.lock chore(lint): add flutter_lints 2023-01-12 20:45:42 -03:00
pubspec.yaml chore(lint): add flutter_lints 2023-01-12 20:45:42 -03:00

README.md

stacked_cards

This is Tinder like swipeable cards package. You can add your own widgets to the stack, receive all four events, left, right, up and down. You can define your own business logic for each direction.

Demo

Documentation

Installation

Add stacked_cards to your pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter

  # added below
  stacked_cards: <latest version>

Adding to app

Use the SwipeableCardsSection widget provided by the package

@override
  Widget build(BuildContext context) {
    //create a SwipeableCardSectionController
    SwipeableCardSectionController _cardController = SwipeableCardSectionController();

    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          SwipeableCardsSection(
            cardController: _cardController,
            context: context,
            //add the first 3 cards (widgets)
            items: [
              CardView(text: "First card"),
              CardView(text: "Second card"),
              CardView(text: "Third card"),
            ],
            //Get card swipe event callbacks
            onCardSwiped: (dir, index, widget) {
              //Add the next card using _cardController
              _cardController.addItem(CardView(text: "Next card"));
              
              //Take action on the swiped widget based on the direction of swipe
              //Return false to not animate cards
            },
            //
            enableSwipeUp: true,
            enableSwipeDown: false,
          ),
          //other children
        )
    }
          

Author

CodeToArt Technology