205 lines
7.8 KiB
Dart
205 lines
7.8 KiB
Dart
import 'package:citycards_customer/cart/widget/ticket_card_view.dart';
|
|
import 'package:citycards_customer/checkout/widget/all_coupons_bottomsheet.dart';
|
|
import 'package:citycards_customer/common_packages/custom_filled_button.dart';
|
|
import 'package:citycards_customer/common_packages/custom_text.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import '../../login/view/login_email_bottomsheet.dart';
|
|
import '../blocs/postcard_bloc.dart';
|
|
|
|
class MyPostCardsPage extends StatelessWidget {
|
|
const MyPostCardsPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocBuilder<PostCardBloc, PostCardState>(
|
|
builder: (context, state) {
|
|
if (state is PostCardLoading) {
|
|
return const Center(child: CircularProgressIndicator());
|
|
} else if (state is PostCardLoaded) {
|
|
return SingleChildScrollView(
|
|
padding: const EdgeInsets.all(16),
|
|
child:
|
|
Column(
|
|
children: [
|
|
TicketCard(),
|
|
SizedBox(height: 40.h),
|
|
Container(
|
|
padding: EdgeInsets.symmetric(
|
|
horizontal: 12.w,
|
|
vertical: 12.h,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFFFFF5F5),
|
|
borderRadius: BorderRadius.circular(8.r),
|
|
border: Border.all(
|
|
color: Color(0xFFBB474A).withOpacity(0.4),
|
|
width: 0.8,
|
|
),
|
|
),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
CustomText(
|
|
text: "Get 10% off on your first trip",
|
|
color: Color(0xFF262626),
|
|
size: 14.sp,
|
|
),
|
|
SizedBox(height: 7.h),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
GestureDetector(
|
|
onTap: () {
|
|
showModalBottomSheet(
|
|
context: context,
|
|
isScrollControlled: true,
|
|
backgroundColor: Colors.white,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.vertical(
|
|
top: Radius.circular(12.r),
|
|
),
|
|
),
|
|
builder: (_) => AllCouponsBottomsheet(),
|
|
);
|
|
},
|
|
child: CustomText(
|
|
text: "View all coupons",
|
|
color: Color(0xFFF95F62),
|
|
size: 12,
|
|
),
|
|
),
|
|
SizedBox(width: 3.w),
|
|
Icon(Icons.arrow_right, color: Color(0xFFF95F62)),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
|
|
const Spacer(),
|
|
Container(
|
|
padding: EdgeInsets.symmetric(
|
|
horizontal: 20.w,
|
|
vertical: 10.h,
|
|
),
|
|
decoration: BoxDecoration(
|
|
border: Border.all(color: Color(0xFFF95F62)),
|
|
borderRadius: BorderRadius.circular(8.r),
|
|
),
|
|
child: CustomText(
|
|
text: "Apply",
|
|
color: Color(0xFFF95F62),
|
|
size: 14.sp,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
|
|
SizedBox(height: 15.h),
|
|
|
|
Divider(color: Color(0xFFACACAC), thickness: 1.h),
|
|
SizedBox(height: 10.h),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
CustomText(text: "Subtotal", size: 14.sp),
|
|
CustomText(
|
|
text: "\$49.50",
|
|
size: 14.sp,
|
|
weight: FontWeight.w500,
|
|
),
|
|
],
|
|
),
|
|
SizedBox(height: 14.h),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
CustomText(text: "Discount", size: 14.sp),
|
|
CustomText(
|
|
text: "-7.20%",
|
|
size: 14.sp,
|
|
weight: FontWeight.w500,
|
|
),
|
|
],
|
|
),
|
|
SizedBox(height: 10.h),
|
|
Divider(color: Color(0xFFACACAC), thickness: 1.h),
|
|
SizedBox(height: 10.h),
|
|
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
CustomText(text: 'Total', size: 14.sp),
|
|
SizedBox(height: 4.h),
|
|
CustomText(
|
|
text: "Including \$2.24 in taxes",
|
|
size: 12.sp,
|
|
color: Colors.black.withOpacity(0.6),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
CustomText(
|
|
text: "\$42.60",
|
|
size: 24.sp,
|
|
weight: FontWeight.w500,
|
|
),
|
|
],
|
|
),
|
|
SizedBox(height: 60.h),
|
|
CustomFilledButton(
|
|
onTap: () {
|
|
showModalBottomSheet(
|
|
backgroundColor: Colors.white,
|
|
context: context,
|
|
isScrollControlled: true,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.vertical(
|
|
top: Radius.circular(12.r),
|
|
),
|
|
),
|
|
builder: (_) => const LoginEmailBottomsheet(),
|
|
);
|
|
},
|
|
width: double.infinity,
|
|
label: "Proceed to Checkout",
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
return Center(
|
|
child: Column(
|
|
children: [
|
|
Image.asset("assets/gif/empty_post_card.gif", width: 250.w),
|
|
Text(
|
|
"You do not have any postcards",
|
|
style: TextStyle(
|
|
fontSize: 24.sp,
|
|
color: Color(0xFFF95F62)
|
|
),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
SizedBox(height: 4.h),
|
|
Text(
|
|
"You do not possess any postcards yet nor have you sent to anyone",
|
|
style: TextStyle(color: Color(0xFF656565), fontSize: 14.sp),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|