app/lib/components/product_card.dart

66 lines
1.7 KiB
Dart
Raw Normal View History

import 'package:flutter/material.dart';
import '../utils/utils.dart';
class ProductCard extends StatelessWidget {
const ProductCard({
Key? key,
required this.image,
required this.title,
required this.price,
required this.press,
required this.bgColor,
}) : super(key: key);
final String image, title;
final VoidCallback press;
final int price;
final Color bgColor;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: press,
child: Container(
width: 154,
padding: const EdgeInsets.all(defaultPadding / 2),
decoration: const BoxDecoration(
2022-05-15 10:19:33 +02:00
color: const Color(0xff212226),
borderRadius: BorderRadius.all(Radius.circular(defaultBorderRadius)),
),
child: Column(
children: [
Container(
width: double.infinity,
decoration: BoxDecoration(
2022-05-15 10:19:33 +02:00
color: const Color(0xff212226),
borderRadius: const BorderRadius.all(
Radius.circular(defaultBorderRadius)),
),
child: Image.asset(
image,
height: 132,
),
),
const SizedBox(height: defaultPadding / 2),
Row(
children: [
Expanded(
child: Text(
title,
2022-05-15 10:19:33 +02:00
style: const TextStyle(color: Colors.white),
),
),
const SizedBox(width: defaultPadding / 4),
Text(
2022-05-14 18:44:03 +02:00
"\$$price",
2022-05-15 10:19:33 +02:00
style: const TextStyle(color: Colors.white),
),
],
)
],
),
),
);
}
}