recipe_card_stack 0.0.5 copy "recipe_card_stack: ^0.0.5" to clipboard
recipe_card_stack: ^0.0.5 copied to clipboard

A smooth, swipeable stacked-card widget with tap-to-focus, infinite looping and customizable card layouts.

recipe_card_stack #

Logo

A smooth, swipeable stacked-card widget for Flutter. Cards appear behind each other with visible β€œtabs”, giving a vintage index-card feel. Users can:

  • Swipe cards left and right
  • Tap any back card to bring it to the front
  • Preview upcoming cards in the stack
  • Loop infinitely through the deck
  • Fade in full card content when the card becomes active
  • Customize every part of the UI

Perfect for recipe boxes, flash cards, quizzes, selectors, photo stacks, or any classic card-based interface.


✨ Features #

  • 🎞 Smooth swipe animations
  • πŸ‘† Tap-to-focus stacked cards
  • β™Ύ Infinite looping
  • 🌫 Fade-in content for focused cards
  • 🧩 Customizable layout + builder
  • βš™ Configurable spacing, scale & depth
  • πŸͺΆ Very lightweight (no dependencies)

πŸŽ₯ Demo #


πŸš€ Installation #

Add this to your pubspec.yaml:

dependencies:
  recipe_card_stack: ^0.0.3

Then run:

flutter pub get

🎯 Basic Usage #

InfiniteSwipeCardStack<String>(
  items: ["One", "Two", "Three", "Four"],
  maxVisibleCards: 4,
  scaleGap: 0.05,
  verticalGap: 70,
  cardBuilder: (context, item, index, isFront) {
    return Container(
      alignment: Alignment.center,
      decoration: BoxDecoration(
        color: isFront ? Colors.white : Colors.grey.shade200,
        borderRadius: BorderRadius.circular(12),
        border: Border.all(color: Colors.black, width: 2),
      ),
      child: Text(
        item,
        style: TextStyle(
          fontSize: isFront ? 28 : 20,
          fontWeight: FontWeight.bold,
        ),
      ),
    );
  },
  onSwipe: (index, direction, item) {
    print("Swiped: $item");
  },
);

βš™ Configuration Parameters #

Parameter Type Description
items List<T> Your card data
cardBuilder builder Build UI for each card
onSwipe callback Triggered when top card is swiped away
maxVisibleCards int Number of visible stacked cards
scaleGap double Scale difference between stacked cards
verticalGap double Vertical offset for stacked cards
allowDirections Set<SwipeDirection> Allowed swipe directions

πŸ“¦ Example Project #

A fully working example is included in the example/ folder:

flutter run -t example/lib/main.dart

πŸ“„ License #

This package is licensed under the MIT License.
See the LICENSE file for details.


❀️ Contributing #

Issues and pull requests are welcome! Feel free to open discussions or submit improvements on GitHub.

2
likes
140
points
222
downloads

Publisher

unverified uploader

Weekly Downloads

A smooth, swipeable stacked-card widget with tap-to-focus, infinite looping and customizable card layouts.

Repository (GitHub)
View/report issues

Topics

#cards #swipe #stack #ui #selector

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on recipe_card_stack