-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathflash_sale.dart
68 lines (65 loc) · 2.25 KB
/
flash_sale.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import 'package:flutter/material.dart';
import '/components/Banner/M/banner_m_with_counter.dart';
import '../../../../components/product/product_card.dart';
import '../../../../constants.dart';
import '../../../../models/product_model.dart';
import '../../../../route/route_constants.dart';
class FlashSale extends StatelessWidget {
const FlashSale({
super.key,
});
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// While loading show 👇
// const BannerMWithCounterSkelton(),
BannerMWithCounter(
duration: const Duration(hours: 8),
text: "Super Flash Sale \n50% Off",
press: () {},
),
const SizedBox(height: defaultPadding / 2),
Padding(
padding: const EdgeInsets.all(defaultPadding),
child: Text(
"Flash sale",
style: Theme.of(context).textTheme.titleSmall,
),
),
// While loading show 👇
// const ProductsSkelton(),
SizedBox(
height: 220,
child: ListView.builder(
scrollDirection: Axis.horizontal,
// Find demoFlashSaleProducts on models/ProductModel.dart
itemCount: demoFlashSaleProducts.length,
itemBuilder: (context, index) => Padding(
padding: EdgeInsets.only(
left: defaultPadding,
right: index == demoFlashSaleProducts.length - 1
? defaultPadding
: 0,
),
child: ProductCard(
image: demoFlashSaleProducts[index].image,
brandName: demoFlashSaleProducts[index].brandName,
title: demoFlashSaleProducts[index].title,
price: demoFlashSaleProducts[index].price,
priceAfetDiscount:
demoFlashSaleProducts[index].priceAfetDiscount,
dicountpercent: demoFlashSaleProducts[index].dicountpercent,
press: () {
Navigator.pushNamed(context, productDetailsScreenRoute,
arguments: index.isEven);
},
),
),
),
),
],
);
}
}