Flutter Card Widget Tutorial: A Comprehensive Guide
The Card Widget in Flutter is a versatile and visually appealing way to present content. Whether you want to display text, images, or interactive elements, the card widget provides a customizable container with features like shadows, borders, and rounded corners. In this tutorial, we explore various use cases and implementations of the card widget to enhance your app’s user interface.

1. Basic Card
A simple card can act as a clean container for text or any content. Here’s how you can create one:
Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text("This is a basic card."),
),
)
Output:
A minimal card with a text element.
2. Card with Elevation
Add depth and a 3D effect to your card by using the elevation
property:
Card(
elevation: 10,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text("Card with elevation."),
),
)
Why Use It?
Elevation helps cards stand out, especially in layered designs.
3. Rounded Corners
Give your cards a modern look by rounding the edges:
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text("Card with rounded corners."),
),
)
4. Add Borders
Add a border with customizable width and color:
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
side: BorderSide(color: Colors.blue, width: 2),
),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text("Card with a border."),
),
)
5. Card with an Image
Combine images with text or other widgets:
Card(
child: Column(
children: [
Image.network("https://via.placeholder.com/150"),
Padding(
padding: const EdgeInsets.all(16.0),
child: Text("Card with an image."),
),
],
),
)
6. Card with Icon and Text
Integrate icons into your card for enhanced usability:
Card(
child: ListTile(
leading: Icon(Icons.star, color: Colors.amber),
title: Text("Card with an icon."),
subtitle: Text("This card has both icon and text."),
),
)
7. Card with Buttons
Add interactivity to your cards with action buttons:
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
leading: Icon(Icons.album),
title: Text("Card with buttons"),
subtitle: Text("This card has action buttons below."),
),
ButtonBar(
children: [
TextButton(
onPressed: () {},
child: Text("ACTION 1"),
),
TextButton(
onPressed: () {},
child: Text("ACTION 2"),
),
],
),
],
),
)
8. Gradient Background
Create a card with an eye-catching gradient background:
Card(
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.blue, Colors.purple],
),
),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text("Card with gradient background."),
),
),
)
9. Interactive Card
Make your cards clickable with the InkWell
widget:
Card(
child: InkWell(
onTap: () {
print("Card tapped!");
},
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text("Tap me!"),
),
),
)
10. Scrollable Card List
Display multiple cards in a vertically scrollable list:
ListView(
children: [
Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text("Card 1"),
),
),
Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text("Card 2"),
),
),
],
)
11. Horizontal Card
Create a horizontally scrollable card list:
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
Card(
child: Container(
width: 200,
height: 150,
color: Colors.red,
),
),
Card(
child: Container(
width: 200,
height: 150,
color: Colors.green,
),
),
],
),
)
12. Custom Shadow
Customize the card’s shadow color and spread:
Card(
elevation: 10,
shadowColor: Colors.red,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text("Card with custom shadow color."),
),
)
13. Card with Stack
Layer widgets on top of each other for a creative design:
Card(
child: Stack(
children: [
Container(
height: 150,
color: Colors.blue,
),
Positioned(
bottom: 10,
left: 10,
child: Text(
"Overlay text on a card.",
style: TextStyle(color: Colors.white, fontSize: 16),
),
),
],
),
)
Conclusion
The Card Widget in Flutter is a powerful tool for building beautiful, responsive UI designs. From simple text containers to interactive, image-laden cards, it offers endless possibilities. Experiment with these examples to find the perfect implementation for your app.


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