|
|
|
|
@ -22,17 +22,16 @@ class AdsDetailView extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
print("adId: ${adDetails.isMyAd}");
|
|
|
|
|
print("adId: ${adDetails.id}");
|
|
|
|
|
print("statusID: ${adDetails.adPostStatus}");
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: CustomAppBar(
|
|
|
|
|
title: "Ads",
|
|
|
|
|
profileImageUrl: MyAssets.bnCar,
|
|
|
|
|
isRemoveBackButton: false,
|
|
|
|
|
isDrawerEnabled: false,
|
|
|
|
|
actions: [Icon(Icons.chat_outlined).paddingOnly(right: 21)],
|
|
|
|
|
onTap: () {
|
|
|
|
|
print("heyyyy");
|
|
|
|
|
},
|
|
|
|
|
actions: [const Icon(Icons.chat_outlined).paddingOnly(right: 21)],
|
|
|
|
|
onTap: () {},
|
|
|
|
|
),
|
|
|
|
|
body: Container(
|
|
|
|
|
padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21),
|
|
|
|
|
@ -116,9 +115,7 @@ class AdsDetailView extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
14.height,
|
|
|
|
|
adDetails.isMyAd ?? false
|
|
|
|
|
? BuildAdDetailsActionButtonForMyAds(adPostStatus: adDetails.adPostStatus!, adId: adDetails.id!)
|
|
|
|
|
: BuildAdDetailsActionButtonForExploreAds(adPostStatus: adDetails.adPostStatus!, adId: adDetails.id!),
|
|
|
|
|
adDetails.isMyAd ?? false ? BuildAdDetailsActionButtonForMyAds(adDetailsModel: adDetails) : BuildAdDetailsActionButtonForExploreAds(adDetailsModel: adDetails),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
@ -130,73 +127,159 @@ class AdsDetailView extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
|
|
|
|
|
final AdPostStatus adPostStatus;
|
|
|
|
|
final int adId;
|
|
|
|
|
final AdDetailsModel adDetailsModel;
|
|
|
|
|
|
|
|
|
|
const BuildAdDetailsActionButtonForExploreAds({Key? key, required this.adPostStatus, required this.adId}) : super(key: key);
|
|
|
|
|
const BuildAdDetailsActionButtonForExploreAds({Key? key, required this.adDetailsModel}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
Widget pendingForPaymentAction(BuildContext context, {required int adID}) {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Pay Now",
|
|
|
|
|
onPressed: () {
|
|
|
|
|
navigateWithName(context, AppRoutes.paymentMethodsView);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {},
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: "Delete Ad".toText(fontSize: 15, isBold: true, color: MyColors.redColor),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget markAsSoldAction(BuildContext context) {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Mark As Sold",
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {},
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: "Delete Ad".toText(fontSize: 15, isBold: true, color: MyColors.redColor),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
void reserveAdPriceBreakDownClicked(BuildContext context, AdDetailsModel adDetailsModel) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
enableDrag: true,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return InfoBottomSheet(
|
|
|
|
|
title: "Reserve Ad",
|
|
|
|
|
description: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Reservation Amounts".toText(fontSize: 16, isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"${adDetailsModel.reservePrice}".toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
"Below Amount that you will pay later".toText(fontSize: 12),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Car Price".toText(fontSize: 16, isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"${adDetailsModel.vehicle!.demandAmount ?? 0.0}".toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: [
|
|
|
|
|
// "Tax".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
// Row(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
// children: [
|
|
|
|
|
// "${adDetailsModel.taxPrice}".toText(fontSize: 16, isBold: true),
|
|
|
|
|
// 2.width,
|
|
|
|
|
// "SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 0),
|
|
|
|
|
// ],
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"VAT Excluded".toText(fontSize: 10, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
"Special Services".toText(fontSize: 16, isBold: true),
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Car insurance Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor, fontWeight: FontWeight.w500),
|
|
|
|
|
"To be Decided".toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Registration & Car Plates".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
"To be Decided".toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Home Delivery Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
"To be Decided".toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
"Special service charges will be added based on desired insurance and delivery Location".toText(fontSize: 12),
|
|
|
|
|
30.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Total Amount ".toText(fontSize: 16, isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"${(adDetailsModel.vehicle!.demandAmount ?? 0.0)}".toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Estimated".toText(fontSize: 10, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
44.height,
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
const Icon(
|
|
|
|
|
Icons.warning,
|
|
|
|
|
color: MyColors.adPendingStatusColor,
|
|
|
|
|
size: 19,
|
|
|
|
|
).paddingOnly(bottom: 2),
|
|
|
|
|
3.width,
|
|
|
|
|
"Some services are mandatory while reserving the Ad.".toText(
|
|
|
|
|
color: MyColors.adPendingStatusColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
15.height,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Complete Reservation",
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
navigateWithName(context, AppRoutes.paymentMethodsView, arguments: PaymentTypesEnum.adReserve);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
19.height,
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget cancelReservationAction(BuildContext context) {
|
|
|
|
|
@ -217,151 +300,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget defaultAction(BuildContext context) {
|
|
|
|
|
void reserveAdPriceBreakDownClicked(BuildContext context) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
enableDrag: true,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return InfoBottomSheet(
|
|
|
|
|
title: "Reserve Ad",
|
|
|
|
|
description: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Reservation Amounts".toText(fontSize: 16, isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"500".toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
"Below Amount that you will pay later".toText(fontSize: 12),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Car Price".toText(fontSize: 16, isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"30,000".toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Tax".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"4,500".toText(fontSize: 16, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 0),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
"Special Services".toText(fontSize: 16, isBold: true),
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Car insurance Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor, fontWeight: FontWeight.w500),
|
|
|
|
|
"To be Decided".toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Registration & Car Plates".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
"To be Decided".toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Home Delivery Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
"To be Decided".toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
"Special service charges will be added based on desired insurance and delivery Location".toText(fontSize: 12),
|
|
|
|
|
30.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Total Amount ".toText(fontSize: 16, isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"34,500".toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Estimated".toText(fontSize: 10, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
44.height,
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
const Icon(
|
|
|
|
|
Icons.warning,
|
|
|
|
|
color: MyColors.adPendingStatusColor,
|
|
|
|
|
size: 19,
|
|
|
|
|
).paddingOnly(bottom: 2),
|
|
|
|
|
3.width,
|
|
|
|
|
"Some services are mandatory while reserving the Ad.".toText(
|
|
|
|
|
color: MyColors.adPendingStatusColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
15.height,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Complete Reservation",
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
navigateWithName(context, AppRoutes.paymentMethodsView);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
19.height,
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget reserveAdAction(BuildContext context, AdDetailsModel adDetailsModel) {
|
|
|
|
|
return Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
@ -369,67 +308,274 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Reserve Ad",
|
|
|
|
|
onPressed: () {
|
|
|
|
|
reserveAdPriceBreakDownClicked(context);
|
|
|
|
|
reserveAdPriceBreakDownClicked(context, adDetailsModel);
|
|
|
|
|
// navigateWithName(context, AppRoutes.paymentMethodsView);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
8.width,
|
|
|
|
|
Container(
|
|
|
|
|
height: 55,
|
|
|
|
|
width: 55,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
decoration: BoxDecoration(border: Border.all(color: MyColors.black, width: 2)),
|
|
|
|
|
//TODO: It Will be replaced by a WhatsApp Icon
|
|
|
|
|
child: const Icon(Icons.message, color: MyColors.black),
|
|
|
|
|
).onPress(() {}),
|
|
|
|
|
8.width,
|
|
|
|
|
Container(
|
|
|
|
|
height: 55,
|
|
|
|
|
width: 55,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
decoration: BoxDecoration(border: Border.all(color: MyColors.black, width: 2)),
|
|
|
|
|
child: const Icon(Icons.phone, color: MyColors.black),
|
|
|
|
|
).onPress(() {}),
|
|
|
|
|
if (adDetailsModel.whatsAppNo != null) ...[
|
|
|
|
|
8.width,
|
|
|
|
|
Container(
|
|
|
|
|
height: 55,
|
|
|
|
|
width: 55,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
decoration: BoxDecoration(border: Border.all(color: MyColors.black, width: 2)),
|
|
|
|
|
//TODO: It Will be replaced by a WhatsApp Icon
|
|
|
|
|
child: const Icon(Icons.message, color: MyColors.black),
|
|
|
|
|
).onPress(() {}),
|
|
|
|
|
],
|
|
|
|
|
if (adDetailsModel.phoneNo != null) ...[
|
|
|
|
|
8.width,
|
|
|
|
|
Container(
|
|
|
|
|
height: 55,
|
|
|
|
|
width: 55,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
decoration: BoxDecoration(border: Border.all(color: MyColors.black, width: 2)),
|
|
|
|
|
child: const Icon(Icons.phone, color: MyColors.black),
|
|
|
|
|
).onPress(() {}),
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget defaultActionForProviderAndCustomer(BuildContext context, AdDetailsModel adDetailsModel) {
|
|
|
|
|
return (adDetailsModel.phoneNo != null)
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Contact",
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
isBold: false,
|
|
|
|
|
iconWidget: const Padding(
|
|
|
|
|
padding: EdgeInsets.only(right: 10),
|
|
|
|
|
child: Icon(Icons.phone, color: MyColors.white, size: 24),
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (adDetailsModel.whatsAppNo != null) ...[
|
|
|
|
|
8.width,
|
|
|
|
|
Container(
|
|
|
|
|
height: 55,
|
|
|
|
|
width: 55,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
decoration: BoxDecoration(border: Border.all(color: MyColors.black, width: 2)),
|
|
|
|
|
//TODO: It Will be replaced by a WhatsApp Icon
|
|
|
|
|
child: const Icon(Icons.message, color: MyColors.black),
|
|
|
|
|
).onPress(() {}),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox.shrink();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
context.read<PaymentVM>().updateCurrentAdId(id: adId);
|
|
|
|
|
switch (adPostStatus) {
|
|
|
|
|
case AdPostStatus.pendingForPayment:
|
|
|
|
|
return pendingForPaymentAction(context, adID: adId);
|
|
|
|
|
case AdPostStatus.active:
|
|
|
|
|
return markAsSoldAction(context);
|
|
|
|
|
case AdPostStatus.reserved:
|
|
|
|
|
return cancelReservationAction(context);
|
|
|
|
|
|
|
|
|
|
case AdPostStatus.buyingService:
|
|
|
|
|
case AdPostStatus.reserveCancel:
|
|
|
|
|
case AdPostStatus.rejected:
|
|
|
|
|
case AdPostStatus.cancelled:
|
|
|
|
|
case AdPostStatus.pendingForPost:
|
|
|
|
|
case AdPostStatus.pendingForReview:
|
|
|
|
|
return pendingForPaymentAction(context, adID: adId);
|
|
|
|
|
|
|
|
|
|
return defaultAction(context);
|
|
|
|
|
context.read<PaymentVM>().updateCurrentAdId(id: adDetailsModel.id!);
|
|
|
|
|
// switch (adPostStatus) {
|
|
|
|
|
// case AdPostStatus.pendingForPayment:
|
|
|
|
|
// break;
|
|
|
|
|
// case AdPostStatus.active:
|
|
|
|
|
// break;
|
|
|
|
|
// case AdPostStatus.reserved:
|
|
|
|
|
// return cancelReservationAction(context);
|
|
|
|
|
//
|
|
|
|
|
// case AdPostStatus.buyingService:
|
|
|
|
|
// case AdPostStatus.reserveCancel:
|
|
|
|
|
// case AdPostStatus.rejected:
|
|
|
|
|
// case AdPostStatus.cancelled:
|
|
|
|
|
// case AdPostStatus.pendingForPost:
|
|
|
|
|
// case AdPostStatus.pendingForReview:
|
|
|
|
|
// case AdPostStatus.sold:
|
|
|
|
|
// case AdPostStatus.expired:
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// return defaultAction(context);
|
|
|
|
|
|
|
|
|
|
return pendingForPaymentAction(context, adID: adId);
|
|
|
|
|
case AdPostStatus.sold:
|
|
|
|
|
case AdPostStatus.expired:
|
|
|
|
|
break;
|
|
|
|
|
switch (adDetailsModel.createdByRoleEnum!) {
|
|
|
|
|
case CreatedByRoleEnum.customer:
|
|
|
|
|
case CreatedByRoleEnum.provider:
|
|
|
|
|
return defaultActionForProviderAndCustomer(context, adDetailsModel);
|
|
|
|
|
case CreatedByRoleEnum.admin:
|
|
|
|
|
return reserveAdAction(context, adDetailsModel);
|
|
|
|
|
case CreatedByRoleEnum.allAds:
|
|
|
|
|
return SizedBox.shrink();
|
|
|
|
|
}
|
|
|
|
|
return defaultAction(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
final AdPostStatus adPostStatus;
|
|
|
|
|
final int adId;
|
|
|
|
|
final AdDetailsModel adDetailsModel;
|
|
|
|
|
|
|
|
|
|
const BuildAdDetailsActionButtonForMyAds({Key? key, required this.adPostStatus, required this.adId}) : super(key: key);
|
|
|
|
|
const BuildAdDetailsActionButtonForMyAds({Key? key, required this.adDetailsModel}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
void reserveAdPriceBreakDownClicked(BuildContext context) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
enableDrag: true,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return InfoBottomSheet(
|
|
|
|
|
title: "Reserve Ad",
|
|
|
|
|
description: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Reservation Amounts".toText(fontSize: 16, isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"500".toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
"Below Amount that you will pay later".toText(fontSize: 12),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Car Price".toText(fontSize: 16, isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"30,000".toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Tax".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"4,500".toText(fontSize: 16, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 0),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
"Special Services".toText(fontSize: 16, isBold: true),
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Car insurance Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor, fontWeight: FontWeight.w500),
|
|
|
|
|
"To be Decided".toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Registration & Car Plates".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
"To be Decided".toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Home Delivery Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
"To be Decided".toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
"Special service charges will be added based on desired insurance and delivery Location".toText(fontSize: 12),
|
|
|
|
|
30.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Total Amount ".toText(fontSize: 16, isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"34,500".toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Estimated".toText(fontSize: 10, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
44.height,
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
const Icon(
|
|
|
|
|
Icons.warning,
|
|
|
|
|
color: MyColors.adPendingStatusColor,
|
|
|
|
|
size: 19,
|
|
|
|
|
).paddingOnly(bottom: 2),
|
|
|
|
|
3.width,
|
|
|
|
|
"Some services are mandatory while reserving the Ad.".toText(
|
|
|
|
|
color: MyColors.adPendingStatusColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
15.height,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Complete Reservation",
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
navigateWithName(context, AppRoutes.paymentMethodsView);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
19.height,
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget pendingForReviewAction(BuildContext context, {required int adID}) {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
backgroundColor: MyColors.grey98Color.withOpacity(0.3),
|
|
|
|
|
txtColor: MyColors.lightTextColor,
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Waiting for Admins Approval",
|
|
|
|
|
isBold: false,
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget pendingForPaymentAction(BuildContext context, {required int adID}) {
|
|
|
|
|
return Column(
|
|
|
|
|
@ -442,7 +588,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Pay Now",
|
|
|
|
|
onPressed: () {
|
|
|
|
|
navigateWithName(context, AppRoutes.paymentMethodsView);
|
|
|
|
|
navigateWithName(context, AppRoutes.paymentMethodsView, arguments: PaymentTypesEnum.ads);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -480,17 +626,18 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {},
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: "Delete Ad".toText(fontSize: 15, isBold: true, color: MyColors.redColor),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
isFilled: true,
|
|
|
|
|
borderColor: MyColors.darkPrimaryColor,
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Deactivate Ad",
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -514,150 +661,6 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget defaultAction(BuildContext context) {
|
|
|
|
|
void reserveAdPriceBreakDownClicked(BuildContext context) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
enableDrag: true,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return InfoBottomSheet(
|
|
|
|
|
title: "Reserve Ad",
|
|
|
|
|
description: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Reservation Amounts".toText(fontSize: 16, isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"500".toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
"Below Amount that you will pay later".toText(fontSize: 12),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Car Price".toText(fontSize: 16, isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"30,000".toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Tax".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"4,500".toText(fontSize: 16, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 0),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
"Special Services".toText(fontSize: 16, isBold: true),
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Car insurance Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor, fontWeight: FontWeight.w500),
|
|
|
|
|
"To be Decided".toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Registration & Car Plates".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
"To be Decided".toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Home Delivery Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
"To be Decided".toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
"Special service charges will be added based on desired insurance and delivery Location".toText(fontSize: 12),
|
|
|
|
|
30.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Total Amount ".toText(fontSize: 16, isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"34,500".toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Estimated".toText(fontSize: 10, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
44.height,
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
const Icon(
|
|
|
|
|
Icons.warning,
|
|
|
|
|
color: MyColors.adPendingStatusColor,
|
|
|
|
|
size: 19,
|
|
|
|
|
).paddingOnly(bottom: 2),
|
|
|
|
|
3.width,
|
|
|
|
|
"Some services are mandatory while reserving the Ad.".toText(
|
|
|
|
|
color: MyColors.adPendingStatusColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
15.height,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Complete Reservation",
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
navigateWithName(context, AppRoutes.paymentMethodsView);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
19.height,
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
@ -693,10 +696,10 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
context.read<PaymentVM>().updateCurrentAdId(id: adId);
|
|
|
|
|
switch (adPostStatus) {
|
|
|
|
|
context.read<PaymentVM>().updateCurrentAdId(id: adDetailsModel.id!);
|
|
|
|
|
switch (adDetailsModel.adPostStatus!) {
|
|
|
|
|
case AdPostStatus.pendingForPayment:
|
|
|
|
|
return pendingForPaymentAction(context, adID: adId);
|
|
|
|
|
return pendingForPaymentAction(context, adID: adDetailsModel.id!);
|
|
|
|
|
case AdPostStatus.active:
|
|
|
|
|
return markAsSoldAction(context);
|
|
|
|
|
case AdPostStatus.reserved:
|
|
|
|
|
@ -707,10 +710,9 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
case AdPostStatus.cancelled:
|
|
|
|
|
case AdPostStatus.pendingForPost:
|
|
|
|
|
case AdPostStatus.pendingForReview:
|
|
|
|
|
break;
|
|
|
|
|
return defaultAction(context);
|
|
|
|
|
return pendingForReviewAction(context, adID: adDetailsModel.id!);
|
|
|
|
|
|
|
|
|
|
return pendingForPaymentAction(context, adID: adId);
|
|
|
|
|
// return pendingForPaymentAction(context, adID: adId);
|
|
|
|
|
case AdPostStatus.sold:
|
|
|
|
|
case AdPostStatus.expired:
|
|
|
|
|
break;
|
|
|
|
|
|