Flutter Product Card for E-commerce Grids
An e-commerce product card with a discount badge, name, price, star rating, and an add-to-cart button. Styled entirely with Wind UI utility classes and dark mode ready.
main.dart
WDiv(
className: 'mx-auto max-w-xs flex flex-col rounded-2xl border bg-white border-gray-200 shadow-lg overflow-hidden dark:bg-gray-900 dark:border-gray-800',
children: [
WDiv(
className: 'relative h-40 w-full bg-gradient-to-br from-amber-200 to-orange-300 dark:from-amber-700 dark:to-orange-800',
children: [
WDiv(
className: 'flex items-center justify-center w-full h-40',
child: WIcon(
Icons.shopping_bag,
className: 'text-white text-6xl'
)
),
WDiv(
className: 'absolute top-3 left-3 rounded-full px-2.5 py-1 bg-rose-500 dark:bg-rose-600',
child: WText(
'-20%',
className: 'text-xs font-bold text-white'
)
),
],
),
WDiv(
className: 'flex flex-col gap-2 p-4',
children: [
WText(
'Wireless Headphones',
className: 'text-base font-semibold text-gray-900 dark:text-white'
),
WDiv(
className: 'flex flex-row items-center gap-1',
children: [
WIcon(
Icons.star_rate,
className: 'text-amber-400 text-sm'
),
WText(
'4.8',
className: 'text-sm font-medium text-gray-700 dark:text-gray-300'
),
WText(
'(214)',
className: 'text-xs text-gray-400 dark:text-gray-500'
),
],
),
WDiv(
className: 'flex flex-row items-center justify-between pt-1',
children: [
WDiv(
className: 'flex flex-row items-end gap-2',
children: [
WText(
'$79',
className: 'text-xl font-extrabold text-gray-900 dark:text-white'
),
WText(
'$99',
className: 'text-sm font-medium line-through text-gray-400 dark:text-gray-500'
)
]
),
WButton(
className: 'rounded-xl p-2.5 bg-indigo-600 hover:bg-indigo-500 dark:bg-indigo-500 dark:hover:bg-indigo-400',
child: WIcon(
Icons.shopping_cart,
className: 'text-white text-lg'
)
),
],
),
],
),
],
)
Stats
- Views
- 25
- Stars
- 0
- Revisions
- 2
- Size
- 2,377 chars
- Created
- Jun 9, 2026
Revisions