Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.
swipeable_card_stack
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.
Documentation
Installation
Add swipeable_card_stack to your pubspec.yaml:
dependencies:
flutter:
sdk: flutter
swipeable_card_stack: <latest version>
Adding to app
Use the SwipeableCardsSection widget provided by the package
@override
Widget build (BuildContext context) {
SwipeableCardSectionController _cardController = SwipeableCardSectionController ();
return Scaffold (
appBar: AppBar (
title: Text (widget.title),
),
body: Column (
mainAxisAlignment: MainAxisAlignment .spaceBetween,
children: [
SwipeableCardsSection (
cardController: _cardController,
context: context,
items: [
CardView (text: "First card" ),
CardView (text: "Second card" ),
CardView (text: "Third card" ),
],
onCardSwiped: (dir, index, widget) {
_cardController.addItem (CardView (text: "Next card" ));
},
enableSwipeUp: true ,
enableSwipeDown: false ,
),
)
}
Author
CodeToArt Technology