|
|
|
@ -33,16 +33,17 @@ import 'package:smooth_corner/smooth_corner.dart';
|
|
|
|
class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
ImmediateLiveCarePaymentDetails({super.key});
|
|
|
|
ImmediateLiveCarePaymentDetails({super.key});
|
|
|
|
|
|
|
|
|
|
|
|
late ImmediateLiveCareViewModel immediateLiveCareViewModel;
|
|
|
|
// late ImmediateLiveCareViewModel immediateLiveCareViewModel;
|
|
|
|
late AppState appState;
|
|
|
|
late AppState appState;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
immediateLiveCareViewModel = Provider.of<ImmediateLiveCareViewModel>(context, listen: false);
|
|
|
|
// immediateLiveCareViewModel = Provider.of<ImmediateLiveCareViewModel>(context, listen: false);
|
|
|
|
appState = getIt.get<AppState>();
|
|
|
|
appState = getIt.get<AppState>();
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: AppColors.scaffoldBgColor,
|
|
|
|
backgroundColor: AppColors.scaffoldBgColor,
|
|
|
|
body: Column(
|
|
|
|
body: Consumer<ImmediateLiveCareViewModel>(builder: (context, immediateLiveCareVM, child) {
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: CollapsingListView(
|
|
|
|
child: CollapsingListView(
|
|
|
|
@ -84,7 +85,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
AppCustomChipWidget(labelText: "${appState.getAuthenticatedUser()!.age} ${LocaleKeys.yearsOld.tr(context: context)}"),
|
|
|
|
AppCustomChipWidget(labelText: "${appState.getAuthenticatedUser()!.age} ${LocaleKeys.yearsOld.tr(context: context)}"),
|
|
|
|
AppCustomChipWidget(
|
|
|
|
AppCustomChipWidget(
|
|
|
|
labelText:
|
|
|
|
labelText:
|
|
|
|
"${LocaleKeys.clinic.tr()}: ${(appState.isArabic() ? immediateLiveCareViewModel.immediateLiveCareSelectedClinic.serviceNameN : immediateLiveCareViewModel.immediateLiveCareSelectedClinic.serviceName)!}"),
|
|
|
|
"${LocaleKeys.clinic.tr()}: ${(appState.isArabic() ? immediateLiveCareVM.immediateLiveCareSelectedClinic.serviceNameN : immediateLiveCareVM.immediateLiveCareSelectedClinic.serviceName)!}"),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -112,7 +113,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.livecare_clinic_icon, width: 32.h, height: 32.h, fit: BoxFit.contain),
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.livecare_clinic_icon, width: 32.h, height: 32.h, fit: BoxFit.contain),
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
getLiveCareType(context, immediateLiveCareViewModel.liveCareSelectedCallType).toText16(isBold: true),
|
|
|
|
getLiveCareType(context, immediateLiveCareVM.liveCareSelectedCallType).toText16(isBold: true),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.edit_icon, width: 24.h, height: 24.h, fit: BoxFit.contain),
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.edit_icon, width: 24.h, height: 24.h, fit: BoxFit.contain),
|
|
|
|
@ -120,8 +121,8 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
).onPress(() {
|
|
|
|
).onPress(() {
|
|
|
|
showCommonBottomSheetWithoutHeight(context, child: SelectLiveCareCallType(immediateLiveCareViewModel: immediateLiveCareViewModel), callBackFunc: () async {
|
|
|
|
showCommonBottomSheetWithoutHeight(context, child: SelectLiveCareCallType(immediateLiveCareViewModel: immediateLiveCareVM), callBackFunc: () async {
|
|
|
|
debugPrint("Selected Call Type: ${immediateLiveCareViewModel.liveCareSelectedCallType}");
|
|
|
|
debugPrint("Selected Call Type: ${immediateLiveCareVM.liveCareSelectedCallType}");
|
|
|
|
}, title: LocaleKeys.selectLiveCareCallType.tr(context: context), isCloseButtonVisible: true, isFullScreen: false);
|
|
|
|
}, title: LocaleKeys.selectLiveCareCallType.tr(context: context), isCloseButtonVisible: true, isFullScreen: false);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
@ -140,7 +141,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.isCash ?? true)
|
|
|
|
(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.isCash ?? true)
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
height: 50.h,
|
|
|
|
height: 50.h,
|
|
|
|
decoration: ShapeDecoration(
|
|
|
|
decoration: ShapeDecoration(
|
|
|
|
@ -183,8 +184,8 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true),
|
|
|
|
LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true),
|
|
|
|
Utils.getPaymentAmountWithSymbol(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.amount!.toText16(isBold: true), AppColors.blackColor, 13,
|
|
|
|
Utils.getPaymentAmountWithSymbol(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.amount!.toText16(isBold: true), AppColors.blackColor, 13,
|
|
|
|
isSaudiCurrency: immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar"),
|
|
|
|
isSaudiCurrency: immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar"),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
@ -192,8 +193,8 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor),
|
|
|
|
LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor),
|
|
|
|
Utils.getPaymentAmountWithSymbol(
|
|
|
|
Utils.getPaymentAmountWithSymbol(
|
|
|
|
immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.tax!.toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13,
|
|
|
|
immediateLiveCareVM.liveCareImmediateAppointmentFeesList.tax!.toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13,
|
|
|
|
isSaudiCurrency: immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar"),
|
|
|
|
isSaudiCurrency: immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar"),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
SizedBox(height: 17.h),
|
|
|
|
SizedBox(height: 17.h),
|
|
|
|
@ -201,11 +202,11 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SizedBox(width: 150.h, child: Utils.getPaymentMethods()),
|
|
|
|
SizedBox(width: 150.h, child: Utils.getPaymentMethods()),
|
|
|
|
Utils.getPaymentAmountWithSymbol(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total!.toText24(isBold: true), AppColors.blackColor, 17,
|
|
|
|
Utils.getPaymentAmountWithSymbol(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total!.toText24(isBold: true), AppColors.blackColor, 17,
|
|
|
|
isSaudiCurrency: immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar"),
|
|
|
|
isSaudiCurrency: immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar"),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total == "0" || immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total == "0.0")
|
|
|
|
(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0" || immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0.0")
|
|
|
|
? CustomButton(
|
|
|
|
? CustomButton(
|
|
|
|
text: LocaleKeys.confirmLiveCare.tr(context: context),
|
|
|
|
text: LocaleKeys.confirmLiveCare.tr(context: context),
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
@ -213,10 +214,12 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
if (val) {
|
|
|
|
if (val) {
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.confirmingLiveCareRequest.tr(context: context));
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.confirmingLiveCareRequest.tr(context: context));
|
|
|
|
|
|
|
|
|
|
|
|
await immediateLiveCareViewModel.addNewCallRequestForImmediateLiveCare("${appState.getAuthenticatedUser()!.patientId}${DateTime.now().millisecondsSinceEpoch}");
|
|
|
|
await immediateLiveCareVM.addNewCallRequestForImmediateLiveCare("${appState.getAuthenticatedUser()!.patientId}${DateTime
|
|
|
|
await immediateLiveCareViewModel.getPatientLiveCareHistory();
|
|
|
|
.now()
|
|
|
|
|
|
|
|
.millisecondsSinceEpoch}");
|
|
|
|
|
|
|
|
await immediateLiveCareVM.getPatientLiveCareHistory();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
if (immediateLiveCareViewModel.patientHasPendingLiveCareRequest) {
|
|
|
|
if (immediateLiveCareVM.patientHasPendingLiveCareRequest) {
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
CustomPageRoute(
|
|
|
|
CustomPageRoute(
|
|
|
|
@ -316,7 +319,8 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|