Request Module Completed
parent
55363e4e9f
commit
f290f2e04f
@ -0,0 +1,70 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mc_common_app/classes/app_state.dart';
|
||||||
|
import 'package:mc_common_app/config/routes.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/theme/colors.dart';
|
||||||
|
import 'package:mc_common_app/utils/dialogs_and_bottomsheets.dart';
|
||||||
|
import 'package:mc_common_app/utils/enums.dart';
|
||||||
|
import 'package:mc_common_app/utils/navigator.dart';
|
||||||
|
import 'package:mc_common_app/view_models/chat_view_model.dart';
|
||||||
|
import 'package:mc_common_app/view_models/dashboard_view_model_customer.dart';
|
||||||
|
import 'package:mc_common_app/view_models/requests_view_model.dart';
|
||||||
|
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
||||||
|
import 'package:mc_common_app/widgets/checkbox_with_title_desc.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
void dealCompletedConfirmationBottomSheet({required BuildContext mainContext, required RequestStatusEnum requestStatusEnum, required int requestId}) {
|
||||||
|
final requestVM = mainContext.read<RequestsVM>();
|
||||||
|
return actionConfirmationBottomSheet(
|
||||||
|
isOnlyOneButton: true,
|
||||||
|
context: mainContext,
|
||||||
|
title: LocaleKeys.doYouWantToCompleteThisDeal.tr().toText(fontSize: 26, isBold: true, letterSpacing: -1.44),
|
||||||
|
subtitle: AppState().currentAppType == AppType.provider ? LocaleKeys.providerCompletingDealMeansThat.tr() : LocaleKeys.customerCompletingDealMeansThat.tr(),
|
||||||
|
confirmationWidget: Consumer(builder: (BuildContext context, ChatVM chatVM, Widget? child) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: CircleCheckBoxWithTitle(
|
||||||
|
isChecked: chatVM.acknowledgePaymentToMowaterStatus,
|
||||||
|
title: LocaleKeys.acknowledgePaymentToMowater.tr(),
|
||||||
|
onSelected: () {
|
||||||
|
chatVM.updateAcknowledgePaymentToMowaterStatus(!chatVM.acknowledgePaymentToMowaterStatus);
|
||||||
|
},
|
||||||
|
selectedColor: MyColors.darkPrimaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
actionButtonYes: Consumer(builder: (BuildContext context, ChatVM chatVM, Widget? child) {
|
||||||
|
return Expanded(
|
||||||
|
child: ShowFillButton(
|
||||||
|
maxHeight: 55,
|
||||||
|
isDisabled: !chatVM.acknowledgePaymentToMowaterStatus,
|
||||||
|
title: LocaleKeys.submit.tr(),
|
||||||
|
fontSize: 15,
|
||||||
|
onPressed: () async {
|
||||||
|
Navigator.pop(context);
|
||||||
|
bool status = await requestVM.onActionRequestTapped(context: mainContext, requestStatusEnum: requestStatusEnum, requestId: requestId);
|
||||||
|
if (status) {
|
||||||
|
chatVM.updateAcknowledgePaymentToMowaterStatus(false);
|
||||||
|
mainContext.read<DashboardVmCustomer>().onNavbarTapped(4);
|
||||||
|
navigateReplaceWithName(mainContext, AppRoutes.dashboard);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
actionButtonNo: Expanded(
|
||||||
|
child: ShowFillButton(
|
||||||
|
maxHeight: 55,
|
||||||
|
title: LocaleKeys.no.tr(),
|
||||||
|
fontSize: 15,
|
||||||
|
onPressed: () => Navigator.pop(mainContext),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,82 +0,0 @@
|
|||||||
import 'package:mc_common_app/classes/app_state.dart';
|
|
||||||
import 'package:mc_common_app/config/routes.dart';
|
|
||||||
import 'package:mc_common_app/generated/locale_keys.g.dart';
|
|
||||||
import 'package:mc_common_app/utils/navigator.dart';
|
|
||||||
import 'package:mc_common_app/view_models/requests_view_model.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:mc_common_app/extensions/int_extensions.dart';
|
|
||||||
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
||||||
import 'package:mc_common_app/theme/colors.dart';
|
|
||||||
import 'package:mc_common_app/utils/enums.dart';
|
|
||||||
import 'package:mc_common_app/views/requests/widget/request_item.dart';
|
|
||||||
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
|
||||||
import 'package:mc_common_app/widgets/common_widgets/categories_list.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
|
|
||||||
class MyRequestsFragment extends StatelessWidget {
|
|
||||||
const MyRequestsFragment({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: CustomAppBar(
|
|
||||||
title: LocaleKeys.myRequests.tr(),
|
|
||||||
isRemoveBackButton: true,
|
|
||||||
|
|
||||||
),
|
|
||||||
body: Container(
|
|
||||||
color: MyColors.backgroundColor,
|
|
||||||
width: double.infinity,
|
|
||||||
height: double.infinity,
|
|
||||||
child: Consumer(builder: (BuildContext context, RequestsVM requestsVM, Widget? child) {
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
16.height,
|
|
||||||
FiltersList(
|
|
||||||
filterList: requestsVM.requestsTypeFilterOptions,
|
|
||||||
onFilterTapped: (index, selectedFilterId) {
|
|
||||||
requestsVM.applyFilterOnRequestsVM(requestsTypeEnum: selectedFilterId.toRequestTypeStatusEnum());
|
|
||||||
},
|
|
||||||
),
|
|
||||||
8.height,
|
|
||||||
Expanded(
|
|
||||||
child: RefreshIndicator(
|
|
||||||
onRefresh: () async => await requestsVM.getRequests(isNeedToRebuild: true, appType: AppType.provider),
|
|
||||||
child: requestsVM.state == ViewState.busy
|
|
||||||
? const Center(child: CircularProgressIndicator())
|
|
||||||
: requestsVM.myFilteredRequests.isEmpty
|
|
||||||
? Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
LocaleKeys.noRequeststoShow.tr().toText(fontSize: 16, color: MyColors.lightTextColor),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: ListView.separated(
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
return RequestItem(request: requestsVM.myFilteredRequests[index], appType: AppState().currentAppType, requestIndex: index);
|
|
||||||
},
|
|
||||||
separatorBuilder: (context, index) {
|
|
||||||
return 16.height;
|
|
||||||
},
|
|
||||||
itemCount: requestsVM.myFilteredRequests.length,
|
|
||||||
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 8),
|
|
||||||
),
|
|
||||||
))
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
floatingActionButton: AppState().currentAppType == AppType.customer
|
|
||||||
? FloatingActionButton(
|
|
||||||
onPressed: () => navigateWithName(context, AppRoutes.createRequestPage),
|
|
||||||
backgroundColor: MyColors.darkPrimaryColor,
|
|
||||||
child: const Icon(
|
|
||||||
Icons.add,
|
|
||||||
color: MyColors.white,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,156 @@
|
|||||||
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:mc_common_app/classes/app_state.dart';
|
||||||
|
import 'package:mc_common_app/classes/consts.dart';
|
||||||
|
import 'package:mc_common_app/config/routes.dart';
|
||||||
|
import 'package:mc_common_app/generated/locale_keys.g.dart';
|
||||||
|
import 'package:mc_common_app/models/requests_models/request_model.dart';
|
||||||
|
import 'package:mc_common_app/utils/dialogs_and_bottomsheets.dart';
|
||||||
|
import 'package:mc_common_app/utils/navigator.dart';
|
||||||
|
import 'package:mc_common_app/view_models/requests_view_model.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
||||||
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mc_common_app/theme/colors.dart';
|
||||||
|
import 'package:mc_common_app/utils/enums.dart';
|
||||||
|
import 'package:mc_common_app/views/requests/widget/request_item.dart';
|
||||||
|
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/categories_list.dart';
|
||||||
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
|
||||||
|
class MyRequestsFragment extends StatelessWidget {
|
||||||
|
const MyRequestsFragment({super.key});
|
||||||
|
|
||||||
|
void cancelRequestBottomSheet(BuildContext context, int requestId) {
|
||||||
|
return actionConfirmationBottomSheet(
|
||||||
|
context: context,
|
||||||
|
title: LocaleKeys.cancelRequestPrompt.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
||||||
|
subtitle: LocaleKeys.requestPermanentlyCancelled.tr(),
|
||||||
|
actionButtonYes: Expanded(
|
||||||
|
child: ShowFillButton(
|
||||||
|
maxHeight: 55,
|
||||||
|
title: LocaleKeys.yes.tr(),
|
||||||
|
fontSize: 15,
|
||||||
|
onPressed: () async {
|
||||||
|
Navigator.pop(context);
|
||||||
|
|
||||||
|
final requestVM = context.read<RequestsVM>();
|
||||||
|
|
||||||
|
bool status = await requestVM.onActionRequestTapped(context: context, requestStatusEnum: RequestStatusEnum.cancelled, requestId: requestId);
|
||||||
|
if (status) {
|
||||||
|
await requestVM.getRequests(isNeedToRebuild: true, appType: AppType.provider);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actionButtonNo: Expanded(
|
||||||
|
child: ShowFillButton(
|
||||||
|
maxHeight: 55,
|
||||||
|
isFilled: false,
|
||||||
|
borderColor: MyColors.darkPrimaryColor,
|
||||||
|
title: LocaleKeys.no.tr(),
|
||||||
|
txtColor: MyColors.darkPrimaryColor,
|
||||||
|
fontSize: 15,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool shouldDismiss(RequestStatusEnum requestStatusEnum) {
|
||||||
|
if (AppState().currentAppType == AppType.provider) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestStatusEnum == RequestStatusEnum.pending || requestStatusEnum == RequestStatusEnum.submitted) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: CustomAppBar(
|
||||||
|
title: LocaleKeys.myRequests.tr(),
|
||||||
|
isRemoveBackButton: true,
|
||||||
|
),
|
||||||
|
body: Container(
|
||||||
|
color: MyColors.backgroundColor,
|
||||||
|
width: double.infinity,
|
||||||
|
height: double.infinity,
|
||||||
|
child: Consumer(builder: (BuildContext context, RequestsVM requestsVM, Widget? child) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
16.height,
|
||||||
|
FiltersList(
|
||||||
|
filterList: requestsVM.requestsTypeFilterOptions,
|
||||||
|
onFilterTapped: (index, selectedFilterId) {
|
||||||
|
requestsVM.applyFilterOnRequestsVM(requestsTypeEnum: selectedFilterId.toRequestTypeStatusEnum());
|
||||||
|
},
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
Expanded(
|
||||||
|
child: RefreshIndicator(
|
||||||
|
onRefresh: () async => await requestsVM.getRequests(isNeedToRebuild: true, appType: AppType.provider),
|
||||||
|
child: requestsVM.state == ViewState.busy
|
||||||
|
? const Center(child: CircularProgressIndicator())
|
||||||
|
: requestsVM.myFilteredRequests.isEmpty
|
||||||
|
? Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
LocaleKeys.noRequeststoShow.tr().toText(fontSize: 16, color: MyColors.lightTextColor),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: ListView.separated(
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Dismissible(
|
||||||
|
key: Key(index.toString()),
|
||||||
|
background: const SizedBox(),
|
||||||
|
secondaryBackground: Container(
|
||||||
|
color: const Color(0xFFDD0505),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
LocaleKeys.cancel.tr().toText(fontSize: 15, fontWeight: MyFonts.Medium, height: 23 / 25, color: MyColors.white).margin(right: 23),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
dragStartBehavior: DragStartBehavior.start,
|
||||||
|
direction: shouldDismiss(requestsVM.myFilteredRequests[index].requestStatus) ? DismissDirection.endToStart : DismissDirection.none,
|
||||||
|
confirmDismiss: (DismissDirection direction) async {
|
||||||
|
cancelRequestBottomSheet(context, requestsVM.myFilteredRequests[index].id);
|
||||||
|
},
|
||||||
|
child: RequestItem(request: requestsVM.myFilteredRequests[index], appType: AppState().currentAppType, requestIndex: index),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (context, index) {
|
||||||
|
return 16.height;
|
||||||
|
},
|
||||||
|
itemCount: requestsVM.myFilteredRequests.length,
|
||||||
|
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 8),
|
||||||
|
),
|
||||||
|
))
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
floatingActionButton: AppState().currentAppType == AppType.customer
|
||||||
|
? FloatingActionButton(
|
||||||
|
onPressed: () => navigateWithName(context, AppRoutes.createRequestPage),
|
||||||
|
backgroundColor: MyColors.darkPrimaryColor,
|
||||||
|
child: const Icon(
|
||||||
|
Icons.add,
|
||||||
|
color: MyColors.white,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,197 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mc_common_app/classes/app_state.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/models/user_models/user.dart';
|
||||||
|
import 'package:mc_common_app/utils/date_helper.dart';
|
||||||
|
import 'package:mc_common_app/utils/enums.dart';
|
||||||
|
import 'package:mc_common_app/utils/navigator.dart';
|
||||||
|
import 'package:mc_common_app/view_models/requests_view_model.dart';
|
||||||
|
import 'package:mc_common_app/views/advertisement/ad_creation_steps/ad_review_containers.dart';
|
||||||
|
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
||||||
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class ReviewRequestOffer extends StatelessWidget {
|
||||||
|
const ReviewRequestOffer({super.key});
|
||||||
|
|
||||||
|
Widget buildPersonalInformation() {
|
||||||
|
UserInfo userInfo = AppState().getUser.data!.userInfo!;
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
LocaleKeys.personalInformation.tr().toText(fontSize: 18),
|
||||||
|
MyAssets.icEdit.buildSvg().onPress(() {}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 5,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SingleDetailWidget(text: "${userInfo.firstName ?? ""} ${userInfo.lastName ?? ""}", type: LocaleKeys.name.tr()),
|
||||||
|
16.height,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 5,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SingleDetailWidget(text: userInfo.email ?? "", type: "${LocaleKeys.email.tr()} / ${LocaleKeys.phone.tr()}"),
|
||||||
|
16.height,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildLocationInformation(BuildContext context) {
|
||||||
|
// final requestVM = context.read<RequestsVM>();
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
LocaleKeys.locationInformation.tr().toText(fontSize: 18),
|
||||||
|
MyAssets.icEdit.buildSvg().onPress(() {}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SingleDetailWidget(text: "${"Will get from API"} }", type: LocaleKeys.location.tr()),
|
||||||
|
16.height,
|
||||||
|
SingleDetailWidget(text: "N/A", type: "${LocaleKeys.email.tr()} / ${LocaleKeys.additionalAddressDetails.tr()}"),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildServiceInformation(BuildContext context) {
|
||||||
|
final requestVM = context.read<RequestsVM>();
|
||||||
|
|
||||||
|
String formattedDate = "";
|
||||||
|
if (requestVM.acceptedRequestOffer!.manufacturedOn != null) {
|
||||||
|
formattedDate = DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(requestVM.acceptedRequestOffer!.manufacturedOn.toString() ?? "")));
|
||||||
|
}
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
LocaleKeys.serviceInformation.tr().toText(fontSize: 18),
|
||||||
|
MyAssets.icEdit.buildSvg().onPress(() {}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 6,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SingleDetailWidget(text: requestVM.currentSelectedRequest!.vehicleTypeName, type: LocaleKeys.vehicleType.tr()),
|
||||||
|
16.height,
|
||||||
|
SingleDetailWidget(text: '${requestVM.currentSelectedRequest!.model} ${requestVM.currentSelectedRequest!.year}', type: LocaleKeys.model.tr()),
|
||||||
|
if (requestVM.acceptedRequestOffer!.manufacturedById != null) ...[
|
||||||
|
16.height,
|
||||||
|
SingleDetailWidget(text: (requestVM.acceptedRequestOffer!.manufacturedById ?? "").toString(), type: LocaleKeys.manufacturedBy.tr()),
|
||||||
|
],
|
||||||
|
16.height,
|
||||||
|
SingleDetailWidget(text: "${requestVM.acceptedRequestOffer!.price.toString()} SAR", type: LocaleKeys.offerPrice.tr()),
|
||||||
|
16.height,
|
||||||
|
SingleDetailWidget(text: requestVM.acceptedRequestOfferProviderName ?? "", type: LocaleKeys.providerName.tr()),
|
||||||
|
16.height,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 5,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SingleDetailWidget(text: requestVM.currentSelectedRequest!.brand, type: LocaleKeys.vehicleBrand.tr()),
|
||||||
|
16.height,
|
||||||
|
SingleDetailWidget(text: requestVM.acceptedRequestOffer!.serviceItemName ?? "", type: LocaleKeys.serviceName.tr()),
|
||||||
|
if (formattedDate.isNotEmpty) ...[
|
||||||
|
16.height,
|
||||||
|
SingleDetailWidget(text: formattedDate, type: LocaleKeys.manufacturedOn.tr()),
|
||||||
|
],
|
||||||
|
16.height,
|
||||||
|
SingleDetailWidget(text: "${requestVM.currentSelectedRequest!.price.toString()} SAR", type: LocaleKeys.totalPrice.tr()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SingleDetailWidget(text: requestVM.currentSelectedRequest!.description, type: LocaleKeys.description.tr()),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: CustomAppBar(
|
||||||
|
title: LocaleKeys.offerSummary.tr(),
|
||||||
|
isRemoveBackButton: false,
|
||||||
|
isDrawerEnabled: false,
|
||||||
|
onBackButtonTapped: () => Navigator.pop(context),
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
10.height,
|
||||||
|
buildPersonalInformation().toWhiteContainer(width: double.infinity, allPading: 12, margin: const EdgeInsets.symmetric(horizontal: 21, vertical: 4)),
|
||||||
|
10.height,
|
||||||
|
buildLocationInformation(context).toWhiteContainer(width: double.infinity, allPading: 12, margin: const EdgeInsets.symmetric(horizontal: 21, vertical: 4)),
|
||||||
|
10.height,
|
||||||
|
buildServiceInformation(context).toWhiteContainer(width: double.infinity, allPading: 12, margin: const EdgeInsets.symmetric(horizontal: 21, vertical: 4)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
).expand(),
|
||||||
|
ShowFillButton(
|
||||||
|
maxWidth: double.infinity,
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 10, horizontal: 21),
|
||||||
|
maxHeight: 55,
|
||||||
|
title: LocaleKeys.payNow.tr(),
|
||||||
|
isBold: false,
|
||||||
|
onPressed: () {
|
||||||
|
// context.read<PaymentVM>().updateRequestId(id: requestVM.currentSelectedRequest!.id);
|
||||||
|
navigateWithName(context, AppRoutes.paymentMethodsView, arguments: PaymentTypes.request);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue