110 lines
3.9 KiB
Dart
110 lines
3.9 KiB
Dart
import 'package:citycards_customer/checkout/widget/purchase_details_bottomsheet.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:citycards_customer/common_packages/custom_text.dart';
|
|
|
|
class AllCouponsBottomsheet extends StatelessWidget {
|
|
AllCouponsBottomsheet({super.key});
|
|
|
|
final List<String> coupons = [
|
|
"assets/images/red_coupon.png",
|
|
"assets/images/green_coupon.png",
|
|
"assets/images/orange_coupon.png",
|
|
"assets/images/orange_coupon.png",
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AnimatedPadding(
|
|
duration: const Duration(milliseconds: 250),
|
|
curve: Curves.easeOut,
|
|
padding: EdgeInsets.only(
|
|
top: 24.h,
|
|
left: 20.w,
|
|
right: 20.w,
|
|
bottom: MediaQuery.of(context).viewInsets.bottom,
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
/// --- Header ---
|
|
Container(
|
|
height: 4.h,
|
|
width: 40.w,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF2D3134),
|
|
borderRadius: BorderRadius.circular(4.r),
|
|
),
|
|
),
|
|
SizedBox(height: 12.h),
|
|
CustomText(text: "All Coupons", size: 18.sp, weight: FontWeight.w500),
|
|
SizedBox(height: 22.h),
|
|
|
|
/// --- Coupon list ---
|
|
Flexible(
|
|
child: ListView.separated(
|
|
shrinkWrap: true,
|
|
physics: const BouncingScrollPhysics(),
|
|
itemCount: coupons.length,
|
|
separatorBuilder: (_, __) => SizedBox(height: 12.h),
|
|
itemBuilder: (context, index) {
|
|
return Container(
|
|
alignment: Alignment.center,
|
|
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 8.h),
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(12.r),
|
|
border: Border.all(
|
|
color: const Color(0xFFF95F62).withOpacity(0.12),
|
|
),
|
|
),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Image.asset(
|
|
width: 183.9.w,
|
|
height: 72.82.h,
|
|
coupons[index],
|
|
fit: BoxFit.cover,
|
|
),
|
|
GestureDetector(
|
|
onTap: (){
|
|
Navigator.pop(context);
|
|
showModalBottomSheet(context: context,
|
|
isScrollControlled: true,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.vertical(
|
|
top: Radius.circular(12.r),
|
|
),
|
|
),
|
|
builder: (_) => const PurchaseDetailsBottomsheet());
|
|
},
|
|
child: Container(
|
|
width: 110.w,
|
|
height: 44.h,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFFF95F62),
|
|
borderRadius: BorderRadius.circular(12.r),
|
|
),
|
|
child: Center(
|
|
child: CustomText(
|
|
text: "Apply Coupon",
|
|
size: 12.sp,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|