Tinder Style Swipe Cards in Flutter: A Step-by-Step Guide
Swipeable card layouts, popularized by dating apps like Tinder, provide an interactive and visually appealing user experience. In this tutorial, we’ll create Tinder-style swipe cards in Flutter using the scrumlab_flutter_tindercard
package. This package simplifies the process, making it easy to implement swipeable cards with minimal effort.
Let’s dive into the details!

Table of Contents
- Introduction to Tinder-Style Cards
- Setting Up Your Flutter Project
- Installing
scrumlab_flutter_tindercard
- Implementing Swipe Cards
- Setting Up the Card Controller
- Building the Swipeable Card Layout
- Customizing the Card Behavior
- Best Practices for Tinder-Style Cards
- Conclusion
1. Introduction to Tinder-Style Cards
Swipeable cards are a great way to:
- Display content interactively.
- Engage users with swipe gestures for actions like “like” or “dislike.”
- Create dynamic and fluid user experiences.
By leveraging the scrumlab_flutter_tindercard
package, you can implement this feature efficiently.
2. Setting Up Your Flutter Project
Ensure you have Flutter installed and set up. Create a new project using the following command:
flutter create tinder_swipe_cards
cd tinder_swipe_cards
Open the project in your favorite IDE.
3. Installing scrumlab_flutter_tindercard
Add the package to your project dependencies by updating the pubspec.yaml
file:
dependencies:
flutter:
sdk: flutter
scrumlab_flutter_tindercard: ^0.0.1
Run the following command to install the package:
bashCopy codeflutter pub get
4. Implementing Swipe Cards
Now, let’s dive into the code to build Tinder-style cards.
Step 1: Setting Up the Card Controller
The CardController
is essential for managing swipe gestures and tracking the current card index. You’ll define it in your State
class.
CardController controller;
Step 2: Building the Swipeable Card Layout
Below is the complete implementation of the SwipeCardExample
widget:
import 'package:flutter/material.dart';
import 'package:scrumlab_flutter_tindercard/scrumlab_flutter_tindercard.dart';
class SwipeCardExample extends StatefulWidget {
const SwipeCardExample({Key? key}) : super(key: key);
@override
State<SwipeCardExample> createState() => _SwipeCardExampleState();
}
class _SwipeCardExampleState extends State<SwipeCardExample> {
List<String> tinderImages = [
'assets/img_1.png',
'assets/img_2.png',
'assets/img_3.png',
'assets/img_4.png',
'assets/img_5.png',
];
@override
Widget build(BuildContext context) {
CardController controller;
return Scaffold(
body: Center(
child: SizedBox(
height: MediaQuery.of(context).size.height * 0.6,
child: TinderSwapCard(
swipeUp: true,
swipeDown: true,
orientation: AmassOrientation.bottom,
totalNum: tinderImages.length,
stackNum: 4,
swipeEdge: 4.0,
maxWidth: MediaQuery.of(context).size.width * 0.9,
maxHeight: MediaQuery.of(context).size.width * 0.9,
minWidth: MediaQuery.of(context).size.width * 0.8,
minHeight: MediaQuery.of(context).size.width * 0.8,
cardBuilder: (context, index) => Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0),
),
clipBehavior: Clip.antiAliasWithSaveLayer,
child: Image.asset(tinderImages[index], fit: BoxFit.cover),
),
cardController: controller = CardController(),
swipeUpdateCallback: (DragUpdateDetails details, Alignment align) {
if (align.x < 0) {
print("Swiping Left");
} else if (align.x > 0) {
print("Swiping Right");
}
},
swipeCompleteCallback:
(CardSwipeOrientation orientation, int index) {
print("Card $index swiped $orientation");
},
),
),
),
);
}
}
5. Customizing the Card Behavior
The scrumlab_flutter_tindercard
package offers a variety of options for customizing card behavior:
1. Setting Orientation
Use AmassOrientation
to control swipe direction:
AmassOrientation.bottom
: Swipes from bottom to top.AmassOrientation.top
: Swipes from top to bottom.
2. Stack Number
Control how many cards are visible in the stack:
dartCopy codestackNum: 4
3. Swipe Callbacks
Customize actions on swipe updates or completions:
swipeUpdateCallback: (DragUpdateDetails details, Alignment align) {
// Add custom swipe logic here
},
swipeCompleteCallback: (CardSwipeOrientation orientation, int index) {
// Execute actions based on swipe direction or card index
},
6. Best Practices for Tinder-Style Cards
- Optimize Images: Use optimized images to reduce app size.
- Gesture Feedback: Provide visual or haptic feedback during swipes.
- Track Swipes: Log or store swipe results for user data analytics.
- Error Handling: Handle empty or invalid image paths gracefully.
7. Conclusion
Creating Tinder-style swipe cards in Flutter is simple and fun using the scrumlab_flutter_tindercard
package. With swipe gestures, you can add an interactive element to your app that users will love. Customize the behavior and visuals to align with your app’s theme and purpose.
Have you tried creating swipeable cards in Flutter? Share your experiences in the comments, and stay tuned to Widget Wisdom for more exciting Flutter tutorials!


Explore Other Flutter Topics…
- Introduction to Flutter and Dart
- Why choose Flutter
- Installing Flutter On Your Windows Mac And Linux System
- Your first Flutter app
- Flutter project structure
- Building blocks of Flutter
- Stateful vs. Stateless Widgets Explained
- Flutter layout system
- Flutter text widget
- Creating Buttons in Flutter: ElevatedButton, TextButton, and IconButton
- Handling User Input with Flutter Forms
- Container class in Flutter
- Flutter Navigation
- Flutter – Pass Data One Screen To Another Screen
- Managing Device Orientation in Flutter
- Stateful widget lifecycle in Flutter
- Future of Flutter
- Flutter Themes
- Flutter Animations
- Flutter AppBar Customization
- ListView in Flutter
- Flutter GridView
- Flutter Expanded Widget
- Flutter BottomNavigation Bar
- Floating Action Button
- Drawer Widgets in Flutter
- Form Validation in Flutter
- Flutter TextField
- Adding AdMob ads to a Flutter app
- Building Flutter Web & Desktop Applications
- What is Async and Await in Flutter
- HTTP requests in Flutter
- Parsing JSON in Flutter
- Tinder-Style Swipe Cards in Flutter
- Flutter Tic Tac Toe Game Tutorial
- Flutter Login UI Tutorial
- Flutter Card Widget Tutorial
- Flutter music player app tutorial
- Flutter introduction screens
- Shared Preferences in Flutter
- SQLite Database in Flutter
- Firebase Authentication in Flutter
- Firebase Firestore in Flutter
- Push Notifications in Flutter
- Handling File Uploads in Flutter
- Responsive Design in Flutter
- Provider in Flutter
- Riverpod in Flutter
- Flutter BLoC Pattern Tutorial