|
|
|
|
@ -1,12 +1,10 @@
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
import 'dart:developer';
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:mc_common_app/classes/consts.dart';
|
|
|
|
|
import 'package:mc_common_app/config/routes.dart';
|
|
|
|
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
|
|
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:mc_common_app/generated/locale_keys.g.dart';
|
|
|
|
|
import 'package:mc_common_app/main.dart';
|
|
|
|
|
import 'package:mc_common_app/models/advertisment_models/ad_details_model.dart';
|
|
|
|
|
import 'package:mc_common_app/models/advertisment_models/ads_bank_details_model.dart';
|
|
|
|
|
@ -32,6 +30,7 @@ import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/txt_field.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
|
|
|
|
|
class AdsDetailView extends StatefulWidget {
|
|
|
|
|
final AdDetailsModel adDetails;
|
|
|
|
|
@ -62,12 +61,12 @@ class _AdsDetailViewState extends State<AdsDetailView> {
|
|
|
|
|
AdVM adVM = context.read<AdVM>();
|
|
|
|
|
return actionConfirmationBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
title: "Do you want to delete the ad?".toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
subtitle: "Your ad will be permanently deleted and you cannot undo this action.",
|
|
|
|
|
title: LocaleKeys.deleteAdConfirmation.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
subtitle: LocaleKeys.deleteAdConfirmationMessage.tr(),
|
|
|
|
|
actionButtonYes: Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Yes",
|
|
|
|
|
title: LocaleKeys.yes.tr(),
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
@ -80,7 +79,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
isFilled: false,
|
|
|
|
|
borderColor: MyColors.darkPrimaryColor,
|
|
|
|
|
title: "No",
|
|
|
|
|
title: LocaleKeys.no.tr(),
|
|
|
|
|
txtColor: MyColors.darkPrimaryColor,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
@ -95,22 +94,22 @@ class _AdsDetailViewState extends State<AdsDetailView> {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: CustomAppBar(
|
|
|
|
|
title: "Ads",
|
|
|
|
|
title: LocaleKeys.ads.tr(),
|
|
|
|
|
profileImageUrl: MyAssets.bnCar,
|
|
|
|
|
isRemoveBackButton: false,
|
|
|
|
|
isDrawerEnabled: false,
|
|
|
|
|
actions: [
|
|
|
|
|
((widget.adDetails.isMyAd ?? false) && (widget.adDetails.adPostStatus != AdPostStatus.reserved)
|
|
|
|
|
? IconButton(
|
|
|
|
|
icon: const Icon(Icons.delete_outline, color: MyColors.redColor),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
return deleteAdBottomSheet(context);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: IconButton(
|
|
|
|
|
icon: const Icon(Icons.chat_outlined, color: Colors.black),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
))
|
|
|
|
|
? IconButton(
|
|
|
|
|
icon: const Icon(Icons.delete_outline, color: MyColors.redColor),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
return deleteAdBottomSheet(context);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: IconButton(
|
|
|
|
|
icon: const Icon(Icons.chat_outlined, color: Colors.black),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
))
|
|
|
|
|
.toContainer(
|
|
|
|
|
margin: const EdgeInsets.fromLTRB(0, 8, 21, 8),
|
|
|
|
|
paddingAll: 0,
|
|
|
|
|
@ -155,7 +154,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
"Model: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
(LocaleKeys.model.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
"${widget.adDetails.vehicle!.modelyear!.label}".toText(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
isBold: true,
|
|
|
|
|
@ -170,7 +169,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
"Mileage: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
(LocaleKeys.mileage.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
"${widget.adDetails.vehicle!.mileage!.mileageEnd}Km".toText(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
isBold: true,
|
|
|
|
|
@ -184,7 +183,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
"Transmission: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
(LocaleKeys.transmission.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
"${widget.adDetails.vehicle!.transmission!.label}".toText(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
isBold: true,
|
|
|
|
|
@ -192,30 +191,30 @@ class _AdsDetailViewState extends State<AdsDetailView> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
"Description: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
(LocaleKeys.description.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
"${widget.adDetails.vehicle!.vehicleDescription}".toText(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
isBold: true,
|
|
|
|
|
),
|
|
|
|
|
if (widget.adDetails.isMyAd ?? false) ...[
|
|
|
|
|
8.height,
|
|
|
|
|
"Demand: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
(LocaleKeys.demand.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
widget.adDetails.vehicle!.demandAmount!.toInt().toString().toText(fontSize: 30, height: 1.2, isBold: true),
|
|
|
|
|
" SAR".toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 5),
|
|
|
|
|
LocaleKeys.sar.tr().toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 5),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if (widget.adDetails.adPostStatus == AdPostStatus.expired) ...[
|
|
|
|
|
8.height,
|
|
|
|
|
const Divider(thickness: 1, height: 1),
|
|
|
|
|
8.height,
|
|
|
|
|
"Your Ad Duration time is over.".toText(
|
|
|
|
|
color: MyColors.redColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
LocaleKeys.adDurationExpired.tr().toText(
|
|
|
|
|
color: MyColors.redColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
@ -227,7 +226,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
"Bank Details".toText(fontSize: 18, isBold: true),
|
|
|
|
|
LocaleKeys.bankDetails.tr().toText(fontSize: 18, isBold: true),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// "Full Name: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
@ -239,7 +238,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
|
|
|
|
|
// ),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
"Bank Name: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
(LocaleKeys.bankName.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
(adVM.adsBankDetailsModel!.bankName ?? "").toText(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
isBold: true,
|
|
|
|
|
@ -248,7 +247,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
"IBAN: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
(LocaleKeys.iban.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
(adVM.adsBankDetailsModel!.iban ?? "").toText(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
isBold: true,
|
|
|
|
|
@ -270,10 +269,10 @@ class _AdsDetailViewState extends State<AdsDetailView> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Rejection Comments".toText(fontSize: 13, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
LocaleKeys.rejectionComments.tr().toText(fontSize: 13, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
"Edit Ad".toText(fontSize: 10, isBold: true),
|
|
|
|
|
LocaleKeys.editAd.tr().toText(fontSize: 10, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
const Icon(Icons.edit, size: 15),
|
|
|
|
|
],
|
|
|
|
|
@ -312,7 +311,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
widget.adDetails.vehicle!.demandAmount!.toInt().toString().toText(fontSize: 30, isBold: true),
|
|
|
|
|
" SAR".toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 5),
|
|
|
|
|
LocaleKeys.sar.tr().toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 5),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
14.height,
|
|
|
|
|
@ -340,37 +339,37 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
|
|
|
|
|
enableDrag: true,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return InfoBottomSheet(
|
|
|
|
|
title: "Reserve Ad".toText(fontSize: 24, isBold: true),
|
|
|
|
|
title: LocaleKeys.reserveAd.tr().toText(fontSize: 24, isBold: true),
|
|
|
|
|
description: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Reservation Amount".toText(fontSize: 16, isBold: true),
|
|
|
|
|
LocaleKeys.reservationAmount.tr().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),
|
|
|
|
|
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
"Below Amount that you will pay later".toText(fontSize: 12),
|
|
|
|
|
LocaleKeys.belowAmountPayLater.tr().toText(fontSize: 12),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Car Price".toText(fontSize: 16, isBold: true),
|
|
|
|
|
LocaleKeys.carPrice.tr().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),
|
|
|
|
|
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
@ -379,48 +378,48 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"VAT Excluded".toText(fontSize: 10, isBold: true),
|
|
|
|
|
LocaleKeys.vatExcluded.tr().toText(fontSize: 10, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
"Special Services".toText(fontSize: 16, isBold: true),
|
|
|
|
|
LocaleKeys.specialService.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),
|
|
|
|
|
LocaleKeys.carInsuranceService.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor, fontWeight: FontWeight.w500),
|
|
|
|
|
LocaleKeys.toBeDecided.tr().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),
|
|
|
|
|
LocaleKeys.registrationCarPlates.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
LocaleKeys.toBeDecided.tr().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),
|
|
|
|
|
LocaleKeys.homeDeliveryService.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
LocaleKeys.toBeDecided.tr().toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
"Special service charges will be added based on desired insurance and delivery Location".toText(fontSize: 12, maxLines: 2),
|
|
|
|
|
LocaleKeys.specialServicechargesInsuranceDeliveryLocation.tr().toText(fontSize: 12, maxLines: 2),
|
|
|
|
|
30.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Total Amount ".toText(fontSize: 16, isBold: true),
|
|
|
|
|
LocaleKeys.totalAmount.tr().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),
|
|
|
|
|
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
@ -429,7 +428,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Estimated".toText(fontSize: 10, isBold: true),
|
|
|
|
|
LocaleKeys.estimated.tr().toText(fontSize: 10, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
30.height,
|
|
|
|
|
@ -442,11 +441,11 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
|
|
|
|
|
size: 19,
|
|
|
|
|
).paddingOnly(bottom: 2),
|
|
|
|
|
3.width,
|
|
|
|
|
"Some services are mandatory while reserving Ad.".toText(
|
|
|
|
|
color: MyColors.adPendingStatusColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
LocaleKeys.servicesReservingAd.tr().toText(
|
|
|
|
|
color: MyColors.adPendingStatusColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
15.height,
|
|
|
|
|
@ -455,7 +454,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Complete Reservation",
|
|
|
|
|
title: LocaleKeys.completeReservation.tr(),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
bool status = await context.read<AdVM>().createReserveAd(adId: adDetailsModel.id!, context: context);
|
|
|
|
|
@ -479,7 +478,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Reserve Ad",
|
|
|
|
|
title: LocaleKeys.reserveAd.tr(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
reserveAdPriceBreakDownClicked(context, adDetailsModel);
|
|
|
|
|
// navigateWithName(context, AppRoutes.paymentMethodsView);
|
|
|
|
|
@ -519,36 +518,36 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
|
|
|
|
|
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: () {
|
|
|
|
|
Utils.openNumberViaCaller(phoneNumber: adDetailsModel.phoneNo ?? "");
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (adDetailsModel.whatsAppNo == null) ...[
|
|
|
|
|
8.width,
|
|
|
|
|
Container(
|
|
|
|
|
height: 55,
|
|
|
|
|
width: 55,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
decoration: BoxDecoration(border: Border.all(color: MyColors.black, width: 2)),
|
|
|
|
|
child: MyAssets.whatsAppIcon.buildSvg(height: 33, width: 35))
|
|
|
|
|
.onPress(() {
|
|
|
|
|
Utils.openNumberViaWhatsApp(phoneNumber: adDetailsModel.whatsAppNo ?? "");
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: LocaleKeys.contact.tr(),
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
isBold: false,
|
|
|
|
|
iconWidget: const Padding(
|
|
|
|
|
padding: EdgeInsets.only(right: 10),
|
|
|
|
|
child: Icon(Icons.phone, color: MyColors.white, size: 24),
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Utils.openNumberViaCaller(phoneNumber: adDetailsModel.phoneNo ?? "");
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (adDetailsModel.whatsAppNo == null) ...[
|
|
|
|
|
8.width,
|
|
|
|
|
Container(
|
|
|
|
|
height: 55,
|
|
|
|
|
width: 55,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
decoration: BoxDecoration(border: Border.all(color: MyColors.black, width: 2)),
|
|
|
|
|
child: MyAssets.whatsAppIcon.buildSvg(height: 33, width: 35))
|
|
|
|
|
.onPress(() {
|
|
|
|
|
Utils.openNumberViaWhatsApp(phoneNumber: adDetailsModel.whatsAppNo ?? "");
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox.shrink();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -584,7 +583,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return Consumer(builder: (BuildContext context, AdVM adVM, Widget? child) {
|
|
|
|
|
return InfoBottomSheet(
|
|
|
|
|
title: "Set Date and Time".toText(fontSize: 16, isBold: true, letterSpacing: -1.44, height: 1.2),
|
|
|
|
|
title: LocaleKeys.setDateandTime.tr().toText(fontSize: 16, isBold: true, letterSpacing: -1.44, height: 1.2),
|
|
|
|
|
description: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
@ -592,23 +591,23 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
adVM.state == ViewState.busy
|
|
|
|
|
? const Center(child: CircularProgressIndicator())
|
|
|
|
|
: Builder(
|
|
|
|
|
builder: (context) {
|
|
|
|
|
List<DropValue> vehicleCitiesDrop = [];
|
|
|
|
|
for (int i = 0; i < adVM.photoSSSchedulesByOffices.length; i++) {
|
|
|
|
|
var element = adVM.photoSSSchedulesByOffices[i];
|
|
|
|
|
vehicleCitiesDrop.add(DropValue(element.photoOfficeID?.toInt() ?? 0, element.photoOfficeName ?? "", i.toString()));
|
|
|
|
|
}
|
|
|
|
|
builder: (context) {
|
|
|
|
|
List<DropValue> vehicleCitiesDrop = [];
|
|
|
|
|
for (int i = 0; i < adVM.photoSSSchedulesByOffices.length; i++) {
|
|
|
|
|
var element = adVM.photoSSSchedulesByOffices[i];
|
|
|
|
|
vehicleCitiesDrop.add(DropValue(element.photoOfficeID?.toInt() ?? 0, element.photoOfficeName ?? "", i.toString()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DropdownField(
|
|
|
|
|
(DropValue value) => adVM.updatePhotoOfficeSelectedId(SelectionModel(selectedId: value.id, selectedOption: value.value, itemPrice: value.subValue)),
|
|
|
|
|
// here the item price is the index of the selected option
|
|
|
|
|
list: vehicleCitiesDrop,
|
|
|
|
|
dropdownValue: adVM.photoOfficeSelectedId.selectedId != -1 ? DropValue(adVM.photoOfficeSelectedId.selectedId, adVM.photoOfficeSelectedId.selectedOption, "") : null,
|
|
|
|
|
hint: "Select Office",
|
|
|
|
|
errorValue: adVM.photoOfficeSelectedId.errorValue,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
return DropdownField(
|
|
|
|
|
(DropValue value) => adVM.updatePhotoOfficeSelectedId(SelectionModel(selectedId: value.id, selectedOption: value.value, itemPrice: value.subValue)),
|
|
|
|
|
// here the item price is the index of the selected option
|
|
|
|
|
list: vehicleCitiesDrop,
|
|
|
|
|
dropdownValue: adVM.photoOfficeSelectedId.selectedId != -1 ? DropValue(adVM.photoOfficeSelectedId.selectedId, adVM.photoOfficeSelectedId.selectedOption, "") : null,
|
|
|
|
|
hint: LocaleKeys.selectOffice.tr(),
|
|
|
|
|
errorValue: adVM.photoOfficeSelectedId.errorValue,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
if (adVM.photoOfficeSelectedId.selectedId != -1) ...[
|
|
|
|
|
9.height,
|
|
|
|
|
CustomCalenderAppointmentWidget(
|
|
|
|
|
@ -621,7 +620,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
("Available Slots").toText(fontSize: 14, isBold: true),
|
|
|
|
|
LocaleKeys.availableSlots.tr().toText(fontSize: 14, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
5.height,
|
|
|
|
|
@ -640,7 +639,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Book and Pay",
|
|
|
|
|
title: LocaleKeys.bookAndPay.tr(),
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
adVM.onAdSSBookAppointmentPressed(context, adDetailsModel: adDetailsModel, adsSpecialServiceID: 1); //1 for photography Service
|
|
|
|
|
@ -665,37 +664,37 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
enableDrag: true,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return InfoBottomSheet(
|
|
|
|
|
title: "Reserve Ad".toText(fontSize: 24, isBold: true),
|
|
|
|
|
title: LocaleKeys.reserveAd.tr().toText(fontSize: 24, isBold: true),
|
|
|
|
|
description: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Reservation Amounts".toText(fontSize: 16, isBold: true),
|
|
|
|
|
LocaleKeys.reservationAmounts.tr().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),
|
|
|
|
|
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
"Below Amount that you will pay later".toText(fontSize: 12),
|
|
|
|
|
LocaleKeys.belowAmountPayLater.tr().toText(fontSize: 12),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Car Price".toText(fontSize: 16, isBold: true),
|
|
|
|
|
LocaleKeys.carPrice.tr().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),
|
|
|
|
|
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
@ -703,56 +702,56 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Tax".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
LocaleKeys.tax.tr().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),
|
|
|
|
|
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 0),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(),
|
|
|
|
|
"Special Services".toText(fontSize: 16, isBold: true),
|
|
|
|
|
LocaleKeys.specialService.tr().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),
|
|
|
|
|
LocaleKeys.carInsuranceService.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor, fontWeight: FontWeight.w500),
|
|
|
|
|
LocaleKeys.toBeDecided.tr().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),
|
|
|
|
|
LocaleKeys.registrationCarPlates.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
LocaleKeys.toBeDecided.tr().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),
|
|
|
|
|
LocaleKeys.homeDeliveryService.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
|
LocaleKeys.toBeDecided.tr().toText(fontSize: 12, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
"Special service charges will be added based on desired insurance and delivery Location".toText(fontSize: 12),
|
|
|
|
|
LocaleKeys.specialServicechargesInsuranceDeliveryLocation.tr().toText(fontSize: 12),
|
|
|
|
|
30.height,
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
"Total Amount ".toText(fontSize: 16, isBold: true),
|
|
|
|
|
LocaleKeys.totalAmount.tr().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),
|
|
|
|
|
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
@ -761,7 +760,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Estimated".toText(fontSize: 10, isBold: true),
|
|
|
|
|
LocaleKeys.estimated.tr().toText(fontSize: 10, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
44.height,
|
|
|
|
|
@ -774,11 +773,11 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
size: 19,
|
|
|
|
|
).paddingOnly(bottom: 2),
|
|
|
|
|
3.width,
|
|
|
|
|
"Some services are mandatory while reserving the Ad.".toText(
|
|
|
|
|
color: MyColors.adPendingStatusColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
LocaleKeys.servicesReservingAd.tr().toText(
|
|
|
|
|
color: MyColors.adPendingStatusColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
15.height,
|
|
|
|
|
@ -787,7 +786,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Complete Reservation",
|
|
|
|
|
title: LocaleKeys.completeReservation.tr(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
navigateWithName(context, AppRoutes.paymentMethodsView);
|
|
|
|
|
@ -843,7 +842,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
isFilled: false,
|
|
|
|
|
borderColor: MyColors.darkPrimaryColor,
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Book ${photoSpecialServiceModel.name}",
|
|
|
|
|
title: (LocaleKeys.book.tr() + " ${photoSpecialServiceModel.name}"),
|
|
|
|
|
txtColor: MyColors.darkPrimaryColor,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
onBookPhotographyServiceClicked(context, adDetailsModel: adDetailsModel);
|
|
|
|
|
@ -862,7 +861,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
backgroundColor: payButtonStatus ? MyColors.grey98Color.withOpacity(0.3) : MyColors.darkPrimaryColor,
|
|
|
|
|
txtColor: payButtonStatus ? MyColors.lightTextColor : MyColors.white,
|
|
|
|
|
isBold: false,
|
|
|
|
|
title: "Pay Now",
|
|
|
|
|
title: LocaleKeys.payNow.tr(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
if (photoSpecialServiceModel == null) {
|
|
|
|
|
navigateWithName(context, AppRoutes.paymentMethodsView, arguments: PaymentTypes.ads);
|
|
|
|
|
@ -886,7 +885,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Mark As Sold",
|
|
|
|
|
title: LocaleKeys.markAsSold.tr(),
|
|
|
|
|
isBold: false,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
adVM.markAdAsSold(context, adId: adDetailsModel.id!);
|
|
|
|
|
@ -903,17 +902,17 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
isFilled: false,
|
|
|
|
|
borderColor: MyColors.redColor,
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Deactivate Ad",
|
|
|
|
|
title: LocaleKeys.deactivateAd.tr(),
|
|
|
|
|
txtColor: MyColors.redColor,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
return actionConfirmationBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
title: "Do you want to the Deactivate this Ad?".toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
subtitle: "We will stop showing this ad to the buyers.",
|
|
|
|
|
title: LocaleKeys.doWantDeactivateAd.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
subtitle: LocaleKeys.stoptheBuyers.tr(),
|
|
|
|
|
actionButtonYes: Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Yes",
|
|
|
|
|
title: LocaleKeys.yes.tr(),
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
@ -926,7 +925,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
isFilled: false,
|
|
|
|
|
borderColor: MyColors.darkPrimaryColor,
|
|
|
|
|
title: "No",
|
|
|
|
|
title: LocaleKeys.no.tr(),
|
|
|
|
|
txtColor: MyColors.darkPrimaryColor,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
@ -951,12 +950,9 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
enableDrag: true,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return InfoBottomSheet(
|
|
|
|
|
title: "Cancel Reservation".toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
title: LocaleKeys.cancelReservation.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
description: Padding(
|
|
|
|
|
padding: EdgeInsets.only(bottom: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.viewInsets
|
|
|
|
|
.bottom),
|
|
|
|
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
|
child: Consumer<AdVM>(
|
|
|
|
|
builder: (BuildContext context, AdVM adVM, Widget? child) {
|
|
|
|
|
return Column(
|
|
|
|
|
@ -971,26 +967,26 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
value: adVM.reservationCancelReason,
|
|
|
|
|
errorValue: adVM.reservationCancelError,
|
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
|
hint: "Reason for cancellation",
|
|
|
|
|
hint: LocaleKeys.reasonForCancellation.tr(),
|
|
|
|
|
onChanged: (v) => adVM.updateReservationCancelReason(v),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
25.height,
|
|
|
|
|
ShowFillButton(
|
|
|
|
|
title: "Submit",
|
|
|
|
|
title: LocaleKeys.submit.tr(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
bool status = adVM.validateReservationCancelReason();
|
|
|
|
|
if (status) {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
return actionConfirmationBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
title: "Do you want to cancel the reservation?".toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
subtitle: "Your ad reservation will be cancelled and this ad will be again visible to everyone to buy.",
|
|
|
|
|
title: LocaleKeys.doWantCancelReservation.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
subtitle: LocaleKeys.yourAdVisibletoBuy.tr(),
|
|
|
|
|
actionButtonYes: Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Yes",
|
|
|
|
|
title: LocaleKeys.yes.tr(),
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
@ -1003,7 +999,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
isFilled: false,
|
|
|
|
|
borderColor: MyColors.darkPrimaryColor,
|
|
|
|
|
title: "No",
|
|
|
|
|
title: LocaleKeys.no.tr(),
|
|
|
|
|
txtColor: MyColors.darkPrimaryColor,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
@ -1036,7 +1032,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
isFilled: false,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Cancel Reservation",
|
|
|
|
|
title: LocaleKeys.cancelReservation.tr(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
buildCancelReservationBottomSheet(context, adDetails: adDetails);
|
|
|
|
|
}),
|
|
|
|
|
@ -1054,7 +1050,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
backgroundColor: MyColors.darkPrimaryColor,
|
|
|
|
|
txtColor: MyColors.white,
|
|
|
|
|
isBold: false,
|
|
|
|
|
title: "Complete Deal",
|
|
|
|
|
title: LocaleKeys.completeDeal.tr(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
buildCompleteDealBottomSheet(context, adDetails: adDetails);
|
|
|
|
|
}),
|
|
|
|
|
@ -1070,12 +1066,9 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
enableDrag: true,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return InfoBottomSheet(
|
|
|
|
|
title: "Upload Bank Receipt".toText(fontSize: 26, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
title: LocaleKeys.uploadBankReceipt.tr().toText(fontSize: 26, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
description: Padding(
|
|
|
|
|
padding: EdgeInsets.only(bottom: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.viewInsets
|
|
|
|
|
.bottom),
|
|
|
|
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
|
child: Consumer<AdVM>(
|
|
|
|
|
builder: (BuildContext context, AdVM adVM, Widget? child) {
|
|
|
|
|
return Column(
|
|
|
|
|
@ -1090,13 +1083,13 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
value: adVM.completeDealNotesForAdmin,
|
|
|
|
|
errorValue: "",
|
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
|
hint: "Notes For Admin",
|
|
|
|
|
hint: LocaleKeys.notesForAdmin.tr(),
|
|
|
|
|
onChanged: (v) => adVM.updateCompleteDealNotesForAdmin(v),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
15.height,
|
|
|
|
|
"Attach File".toText(fontSize: 20, isBold: true, letterSpacing: -0.5),
|
|
|
|
|
LocaleKeys.attachFile.tr().toText(fontSize: 20, isBold: true, letterSpacing: -0.5),
|
|
|
|
|
if (adVM.pickedReceiptPdfFiles.isNotEmpty) ...[
|
|
|
|
|
16.height,
|
|
|
|
|
PickedFilesContainer(
|
|
|
|
|
@ -1107,31 +1100,30 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
},
|
|
|
|
|
isPdf: true,
|
|
|
|
|
),
|
|
|
|
|
] else
|
|
|
|
|
...[
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: 90,
|
|
|
|
|
width: 90,
|
|
|
|
|
decoration: BoxDecoration(color: MyColors.greyButtonColor, border: Border.all(width: 2, color: MyColors.greyAddBorderColor)),
|
|
|
|
|
margin: const EdgeInsets.all(8),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 24,
|
|
|
|
|
width: 24,
|
|
|
|
|
decoration: const BoxDecoration(shape: BoxShape.circle, color: MyColors.darkTextColor),
|
|
|
|
|
child: const Icon(Icons.add, color: MyColors.white),
|
|
|
|
|
),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
context.read<AdVM>().pickPdfReceiptFile(context);
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
] else ...[
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: 90,
|
|
|
|
|
width: 90,
|
|
|
|
|
decoration: BoxDecoration(color: MyColors.greyButtonColor, border: Border.all(width: 2, color: MyColors.greyAddBorderColor)),
|
|
|
|
|
margin: const EdgeInsets.all(8),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 24,
|
|
|
|
|
width: 24,
|
|
|
|
|
decoration: const BoxDecoration(shape: BoxShape.circle, color: MyColors.darkTextColor),
|
|
|
|
|
child: const Icon(Icons.add, color: MyColors.white),
|
|
|
|
|
),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
context.read<AdVM>().pickPdfReceiptFile(context);
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
15.height,
|
|
|
|
|
ShowFillButton(
|
|
|
|
|
title: "Submit",
|
|
|
|
|
title: LocaleKeys.submit.tr(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
//Upload Attachment
|
|
|
|
|
},
|
|
|
|
|
@ -1154,17 +1146,17 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Extend Ad",
|
|
|
|
|
title: LocaleKeys.extendAd.tr(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
final AdVM adVM = context.read<AdVM>();
|
|
|
|
|
return actionConfirmationBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
title: "Do you want to update the Ad Details?".toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
subtitle: "You can change the ad duration and details before extending the ad.",
|
|
|
|
|
title: LocaleKeys.updateAdDetails.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
subtitle: LocaleKeys.durationExtendingAd.tr(),
|
|
|
|
|
actionButtonYes: Expanded(
|
|
|
|
|
child: ShowFillButton(
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: "Yes",
|
|
|
|
|
title: LocaleKeys.yes.tr(),
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
@ -1180,7 +1172,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
isFilled: false,
|
|
|
|
|
borderColor: MyColors.darkPrimaryColor,
|
|
|
|
|
title: "No",
|
|
|
|
|
title: LocaleKeys.no.tr(),
|
|
|
|
|
txtColor: MyColors.darkPrimaryColor,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
@ -1203,31 +1195,31 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
Widget reservedAdActions(context, {required AdDetailsModel adDetailsModel, required AdVM adVM}) {
|
|
|
|
|
switch (adDetailsModel.adReserveStatus) {
|
|
|
|
|
case AdReserveStatus.defaultStatus:
|
|
|
|
|
return pendingForReviewAction(pendingText: "Waiting for Admins Response");
|
|
|
|
|
return pendingForReviewAction(pendingText: LocaleKeys.waitingAdminsResponse.tr());
|
|
|
|
|
|
|
|
|
|
case AdReserveStatus.reserved:
|
|
|
|
|
return cancelReservationAction(context, adDetails: adDetailsModel);
|
|
|
|
|
|
|
|
|
|
case AdReserveStatus.cancelledByOwner:
|
|
|
|
|
return pendingForReviewAction(pendingText: "Cancelled by Owner");
|
|
|
|
|
return pendingForReviewAction(pendingText: LocaleKeys.cancelledByOwner.tr());
|
|
|
|
|
|
|
|
|
|
case AdReserveStatus.cancelledByAdmin:
|
|
|
|
|
return pendingForReviewAction(pendingText: "Cancelled by Admin");
|
|
|
|
|
return pendingForReviewAction(pendingText: LocaleKeys.cancelledByAdmin.tr());
|
|
|
|
|
|
|
|
|
|
case AdReserveStatus.timeOver:
|
|
|
|
|
return pendingForReviewAction(pendingText: "Reservation Time Over");
|
|
|
|
|
return pendingForReviewAction(pendingText: LocaleKeys.reservationTimeOver.tr());
|
|
|
|
|
|
|
|
|
|
case AdReserveStatus.dealDone:
|
|
|
|
|
if (adVM.adsBankDetailsModel != null) {
|
|
|
|
|
return completeDealAction(context, adDetails: adDetailsModel);
|
|
|
|
|
}
|
|
|
|
|
return pendingForReviewAction(pendingText: "Waiting for Admins Response");
|
|
|
|
|
return pendingForReviewAction(pendingText: LocaleKeys.waitingAdminsResponse.tr());
|
|
|
|
|
|
|
|
|
|
case AdReserveStatus.fullPaymentVerified:
|
|
|
|
|
return pendingForReviewAction(pendingText: "Payment Verified");
|
|
|
|
|
return pendingForReviewAction(pendingText: LocaleKeys.paymentVerified.tr());
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return pendingForReviewAction(pendingText: "Waiting for Admins Response");
|
|
|
|
|
return pendingForReviewAction(pendingText: LocaleKeys.waitingAdminsResponse.tr());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1248,16 +1240,16 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
|
|
|
|
|
case AdPostStatus.buyingService:
|
|
|
|
|
case AdPostStatus.reserveCancel:
|
|
|
|
|
case AdPostStatus.rejected:
|
|
|
|
|
return pendingForReviewAction(pendingText: "Rejected form admin");
|
|
|
|
|
return pendingForReviewAction(pendingText: LocaleKeys.rejectedFormAdmin.tr());
|
|
|
|
|
case AdPostStatus.cancelled:
|
|
|
|
|
case AdPostStatus.pendingForPost:
|
|
|
|
|
return pendingForReviewAction(pendingText: "Waiting for admin to post");
|
|
|
|
|
return pendingForReviewAction(pendingText: LocaleKeys.waitingAdminPost.tr());
|
|
|
|
|
|
|
|
|
|
case AdPostStatus.pendingForReview:
|
|
|
|
|
return pendingForReviewAction(pendingText: "Waiting for Admins Approval");
|
|
|
|
|
return pendingForReviewAction(pendingText: LocaleKeys.waitingAdminsApproval.tr());
|
|
|
|
|
|
|
|
|
|
case AdPostStatus.sold:
|
|
|
|
|
return pendingForReviewAction(pendingText: "Sold");
|
|
|
|
|
return pendingForReviewAction(pendingText: LocaleKeys.sold.tr());
|
|
|
|
|
|
|
|
|
|
case AdPostStatus.expired:
|
|
|
|
|
return expiredAdAction(context);
|
|
|
|
|
|