Fixed Bugs

pull/3/head
FaizHashmi 2 months ago
parent fcb4d8650c
commit 2cbfcfda3f

@ -76,7 +76,7 @@ class _AppointmentPageState extends State<AppointmentPage> {
smallSize: 20, smallSize: 20,
backgroundColor: MyColors.darkPrimaryColor, backgroundColor: MyColors.darkPrimaryColor,
label: Text('${appointmentsVM.appointmentFiltersCounter}'), label: Text('${appointmentsVM.appointmentFiltersCounter}'),
child: MyAssets.searchIcon.buildSvg(), child: MyAssets.searchIcon.buildSvg(height: 22, width: 22),
), ),
).onPress(() { ).onPress(() {
navigateWithName(context, AppRoutes.appoinmentSearchFilterPage); navigateWithName(context, AppRoutes.appoinmentSearchFilterPage);

@ -100,216 +100,213 @@ class GeneralAppointmentWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (isSelectable) Row(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
child: const SizedBox( children: [
width: 14, if (isSelectable)
height: 14, SizedBox(
).toContainer( child: const SizedBox(
borderRadius: 24, width: 14,
marginAll: 4, height: 14,
paddingAll: 0, ).toContainer(
backgroundColor: (appointmentListModel.isSelected ?? false) ? MyColors.primaryColor : MyColors.greyButtonColor, borderRadius: 24,
), marginAll: 4,
).toContainer( paddingAll: 0,
borderRadius: 24, backgroundColor: (appointmentListModel.isSelected ?? false) ? MyColors.primaryColor : MyColors.greyButtonColor,
isEnabledBorder: true, ),
paddingAll: 0, ).toContainer(
borderWidget: 3, borderRadius: 24,
borderColor: MyColors.primaryColor, isEnabledBorder: true,
), paddingAll: 0,
if (isSelectable) 12.width, borderWidget: 3,
Expanded( borderColor: MyColors.primaryColor,
child: Column( ),
mainAxisAlignment: MainAxisAlignment.start, if (isSelectable) 12.width,
crossAxisAlignment: CrossAxisAlignment.start, Expanded(
children: [ child: Column(
if (isNeedToShowMergeStatus)
LocaleKeys.merged.tr().toText(color: MyColors.white).toContainer(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 3),
borderRadius: 12,
backgroundColor: MyColors.greenColor,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( if (isNeedToShowMergeStatus)
child: Column( LocaleKeys.merged.tr().toText(color: MyColors.white).toContainer(
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 3),
mainAxisAlignment: MainAxisAlignment.start, borderRadius: 12,
children: [ backgroundColor: MyColors.greenColor,
(appointmentListModel.branchName ?? "").toText(
fontSize: 12,
color: MyColors.darkTextColor,
isBold: true,
), ),
(appointmentListModel.customerName ?? "").toText(color: MyColors.black, isBold: true, fontSize: 16), Row(
Row( crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"${LocaleKeys.phone.tr()}:".toText( (appointmentListModel.branchName ?? "").toText(
color: MyColors.lightTextColor, fontSize: 12,
color: MyColors.darkTextColor,
isBold: true,
), ),
2.width, (appointmentListModel.customerName ?? "").toText(color: MyColors.black, isBold: true, fontSize: 16),
appointmentListModel.customerMobileNum.toString().toText( Row(
fontSize: 12, children: [
"${LocaleKeys.phone.tr()}:".toText(
color: MyColors.lightTextColor,
),
2.width,
Expanded(
child: appointmentListModel.customerMobileNum.toString().toText(
fontSize: 12,
),
), ),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"${LocaleKeys.time.tr()}:".toText(
color: MyColors.lightTextColor,
),
4.width,
Expanded(child: (appointmentListModel.duration ?? "").toText(fontSize: 8))
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"${LocaleKeys.date.tr()}:".toText(
color: MyColors.lightTextColor,
),
4.width,
Expanded(child: appointmentListModel.appointmentDate!.toFormattedDateWithoutTime().toText(fontSize: 8))
],
),
Row(
children: [
"${LocaleKeys.delivery.tr()}: ".toText(color: MyColors.lightTextColor),
2.width,
Expanded(
child: (appointmentListModel.appointmentTypeEnum == AppointmentTypeEnum.home ? LocaleKeys.home.tr() : LocaleKeys.workshop.tr()).toText(
fontSize: 12,
),
),
],
),
Row(
children: [
"${LocaleKeys.createdOn.tr()}: ".toText(color: MyColors.lightTextColor),
2.width,
Expanded(child: appointmentListModel.appointmentCreatedOn!.toFormattedDateWithoutTime().toText(fontSize: 8))
],
),
if (isFromUpdateAppointmentPage) ...[
if (appointmentListModel.appointmentAddress != null && appointmentListModel.appointmentAddress!.isNotEmpty) ...[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"${LocaleKeys.address.tr()}: ".toText(color: MyColors.lightTextColor),
2.width,
Expanded(child: (appointmentListModel.appointmentAddress ?? "").toText(fontSize: 8))
],
),
],
Row(
children: [
"${LocaleKeys.paymentType.tr()}: ".toText(color: MyColors.lightTextColor),
2.width,
Expanded(child: (appointmentListModel.paymentType ?? "").toText(fontSize: 8)),
],
),
LocaleKeys.openMapLocation
.tr()
.toText(
isUnderLine: true,
color: MyColors.darkPrimaryColor,
fontSize: 10,
)
.onPress(() async {
double latitude, longitude = 0.0;
latitude = double.parse(appointmentListModel.appointmentLatitude!);
longitude = double.parse(appointmentListModel.appointmentLongitude!);
await Utils.openLocationInMaps(latitude: latitude, longitude: longitude);
}),
]
], ],
), ),
Row( ),
mainAxisAlignment: MainAxisAlignment.start, if (!isNeedTotalPayment)
crossAxisAlignment: CrossAxisAlignment.start, if (appointmentListModel.customerAppointmentList != null && appointmentListModel.customerAppointmentList!.length > 1)
children: [ "${appointmentListModel.customerAppointmentList!.length - 1}+ appts".toText(fontSize: 8).toContainer(
"${LocaleKeys.time.tr()}:".toText( borderRadius: 15,
backgroundColor: MyColors.lightGreyEAColor,
padding: const EdgeInsets.symmetric(
vertical: 4,
horizontal: 8,
),
),
if (isNeedToShowAppointmentStatus)
(appointmentListModel.appointmentStatusEnum!.getAppointmentNameFromEnum()).toText(color: MyColors.white).toContainer(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 3),
borderRadius: 12,
backgroundColor: MyColors.primaryColor,
),
],
),
],
),
),
],
),
8.height,
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...buildServicesFromAppointment(appointmentListModel: appointmentListModel),
if (isNeedTotalPayment)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
18.height,
LocaleKeys.totalAmount.tr().toText(
fontSize: 12,
color: MyColors.lightTextColor, color: MyColors.lightTextColor,
), ),
4.width,
Flexible(child: (appointmentListModel.duration ?? "").toText(fontSize: 8))
],
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
"${LocaleKeys.date.tr()}:".toText( appointmentListModel.totalAmount.toString().toText(fontSize: 16, isBold: true),
color: MyColors.lightTextColor, 2.width,
), LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor),
4.width,
Flexible(child: appointmentListModel.appointmentDate!.toFormattedDateWithoutTime().toText(fontSize: 8))
], ],
), ),
Row( 2.height,
children: [ LocaleKeys.remainingAmount.tr().toText(
"${LocaleKeys.serviceDeliveryType.tr()}: ".toText(color: MyColors.lightTextColor),
2.width,
(appointmentListModel.appointmentTypeEnum == AppointmentTypeEnum.home ? LocaleKeys.home.tr() : LocaleKeys.workshop.tr()).toText(
fontSize: 12, fontSize: 12,
color: MyColors.lightTextColor,
), ),
],
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
"${LocaleKeys.createdOn.tr()}: ".toText(color: MyColors.lightTextColor), appointmentListModel.remainingAmount.toString().toText(fontSize: 16, isBold: true),
2.width, 2.width,
Flexible(child: appointmentListModel.appointmentCreatedOn!.toFormattedDateWithoutTime().toText(fontSize: 8)) LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor),
],
),
if (isFromUpdateAppointmentPage) ...[
if (appointmentListModel.appointmentAddress != null && appointmentListModel.appointmentAddress!.isNotEmpty) ...[
Row(
children: [
"${LocaleKeys.address.tr()}: ".toText(color: MyColors.lightTextColor),
2.width,
Flexible(child: (appointmentListModel.appointmentAddress ?? "").toText(fontSize: 8))
],
),
], ],
Row(
children: [
"${LocaleKeys.paymentType.tr()}: ".toText(color: MyColors.lightTextColor),
2.width,
(appointmentListModel.paymentType ?? "").toText(fontSize: 8),
],
),
LocaleKeys.openMapLocation
.tr()
.toText(
isUnderLine: true,
color: MyColors.darkPrimaryColor,
fontSize: 10,
)
.onPress(() async {
double latitude, longitude = 0.0;
latitude = double.parse(appointmentListModel.appointmentLatitude!);
longitude = double.parse(appointmentListModel.appointmentLongitude!);
await Utils.openLocationInMaps(latitude: latitude, longitude: longitude);
}),
]
],
),
),
if (!isNeedTotalPayment)
if (appointmentListModel.customerAppointmentList != null && appointmentListModel.customerAppointmentList!.length > 1)
"${appointmentListModel.customerAppointmentList!.length - 1}+ Appointments".toText(fontSize: 8).toContainer(
borderRadius: 15,
backgroundColor: MyColors.lightGreyEAColor,
padding: const EdgeInsets.symmetric(
vertical: 6,
horizontal: 12,
),
),
if (isNeedToShowAppointmentStatus)
(appointmentListModel.appointmentStatusEnum!.getAppointmentNameFromEnum()).toText(color: MyColors.white).toContainer(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 3),
borderRadius: 12,
backgroundColor: MyColors.primaryColor,
), ),
],
),
8.height,
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: Column(
children: [
...buildServicesFromAppointment(appointmentListModel: appointmentListModel),
if (isNeedTotalPayment)
Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
18.height,
LocaleKeys.totalAmount.tr().toText(
fontSize: 12,
color: MyColors.lightTextColor,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
appointmentListModel.totalAmount.toString().toText(fontSize: 16, isBold: true),
2.width,
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor),
],
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
2.height,
LocaleKeys.remainingAmount.tr().toText(
fontSize: 12,
color: MyColors.lightTextColor,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
appointmentListModel.remainingAmount.toString().toText(fontSize: 16, isBold: true),
2.width,
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor),
],
),
],
),
],
)
], ],
), )
),
if (!isNeedToShowItems) const Icon(Icons.arrow_forward),
], ],
), ),
], ),
), if (!isNeedToShowItems) const Icon(Icons.arrow_forward),
) ],
),
], ],
).toWhiteContainer(width: double.infinity, allPading: 12, onTap: onTap); ).toWhiteContainer(width: double.infinity, allPading: 12, onTap: onTap);
} }
@ -361,3 +358,94 @@ class GeneralAppointmentWidget extends StatelessWidget {
); );
} }
} }
// https://ms.hmg.com/api/ServiceProviders/ServiceProviderBranchDetail_Get?ID=1061&ServiceCategoryIDs=4
// {ID: 1061, ServiceCategoryIDs: [4]}
// {
// "messageStatus": 1,
// "totalItemsCount": 1,
// "data": [
// {
// "id": 1061,
// "serviceProviderID": 14,
// "serviceProviderName": "James Bond",
// "branchName": "Sawaidi Branch",
// "branchDescription": "This is Swaidi Branch",
// "cityID": 1,
// "cityName": "Riyadh",
// "address": "Riyadh, KSA",
// "latitude": "37.541014800226456",
// "longitude": "-122.36278831958771",
// "distanceKM": 12811.22,
// "openTime": "12:00",
// "closeTime": "22:45",
// "branchStatus": 3,
// "branchStatusText": "ApprovedOrActive",
// "branchRateAvg": 0.0,
// "serviceProviderServices": [
// {
// "serviceProviderServiceID": 1212,
// "providerServiceDescription": null,
// "categoryID": 4,
// "categoryName": "Care and Protection",
// "serviceID": 16,
// "serviceDescription": "film body protection",
// "serviceDescriptionN": "فلم حماية الدهان",
// "serviceStatus": 1,
// "statusText": null,
// "isAllowAppointment": true,
// "isAllowAppointmentHome": true,
// "customerLocationRange": 10,
// "rangePricePerKm": 15.0,
// "itemsCount": 1
// }
// ],
// "serviceProviderBranchImage": [
// {
// "id": 136,
// "imageName": "image_picker_929CDE1A-800C-4EFE-AC48-7060BB338D77-69034-00003ADB833C597D.jpg",
// "imageUrl": "https://ms.hmg.com/api/serviceProviders/ServiceProviderBranchImage?imageName=61aa8beb-99b0-4876-b47a-08dce8674a2c_50243415.png&sp=Provider_14&serviceProviderBranch=ServiceProviderBranch_1061",
// "imageStr": null,
// "serviceProviderBranchID": 1061,
// "serviceProviderBranch": null,
// "isActive": true,
// "createdBy": 101,
// "createdOn": "2024-12-16T14:47:48.6633333",
// "modifiedBy": null,
// "modifiedOn": null
// },
// {
// "id": 137,
// "imageName": "image_picker_EBF6BA32-3E4E-4AAE-BC2C-1B136A1C32B3-69034-00003ADB7C82E00F.jpg",
// "imageUrl": "https://ms.hmg.com/api/serviceProviders/ServiceProviderBranchImage?imageName=61aa8beb-99b0-4876-b47a-08dce8674a2c_51856527.png&sp=Provider_14&serviceProviderBranch=ServiceProviderBranch_1061",
// "imageStr": null,
// "serviceProviderBranchID": 1061,
// "serviceProviderBranch": null,
// "isActive": true,
// "createdBy": 101,
// "createdOn": "2024-12-16T14:47:48.6866667",
// "modifiedBy": null,
// "modifiedOn": null
// },
// {
// "id": 138,
// "imageName": "image_picker_168879D6-4707-4D0E-ACDA-0C956BD2AC4A-69034-00003AE6922D39CF.jpg",
// "imageUrl": "https://ms.hmg.com/api/serviceProviders/ServiceProviderBranchImage?imageName=61aa8beb-99b0-4876-b47a-08dce8674a2c_61115226.png&sp=Provider_14&serviceProviderBranch=ServiceProviderBranch_1061",
// "imageStr": null,
// "serviceProviderBranchID": 1061,
// "serviceProviderBranch": null,
// "isActive": true,
// "createdBy": 101,
// "createdOn": "2024-12-16T14:47:48.7066667",
// "modifiedBy": null,
// "modifiedOn": null
// }
// ]
// }
// ],
// "message": "Success"
// }

@ -74,7 +74,7 @@ class _SubscriptionsPageState extends State<SubscriptionsPage> {
subcriptionsVM.tempSubscriptions[index], subcriptionsVM.tempSubscriptions[index],
isSubscribed: subcriptionsVM.tempSubscriptions[index].isSubscribed ?? false, isSubscribed: subcriptionsVM.tempSubscriptions[index].isSubscribed ?? false,
onRenewSubscriptionClick: () async { onRenewSubscriptionClick: () async {
GenericRespModel response = await subcriptionsVM.createSubscriptionOrder(subcriptionsVM.tempSubscriptions[index].id ?? 0, true, true); GenericRespModel response = await subcriptionsVM.createSubscriptionOrder(subscriptionId: subcriptionsVM.tempSubscriptions[index].id ?? 0, isStartNow: true, isRenew: true);
if (response.data != null) { if (response.data != null) {
context.read<PaymentVM>().updateOrderProviderSubscriptionId(id: response.data ?? 0); context.read<PaymentVM>().updateOrderProviderSubscriptionId(id: response.data ?? 0);
navigateWithName(context, AppRoutes.paymentMethodsView, arguments: PaymentTypes.subscription); navigateWithName(context, AppRoutes.paymentMethodsView, arguments: PaymentTypes.subscription);

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mc_common_app/classes/app_state.dart'; import 'package:mc_common_app/classes/app_state.dart';
import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/int_extensions.dart';
@ -50,7 +49,8 @@ class _DowngradeDataSheetState extends State<DowngradeDataSheet> {
isBold: true, isBold: true,
), ),
8.height, 8.height,
"To select this subscription you need to deactivate your branches and users as this package only supports 1 branch and 2 users per branch. You can reactivate these branches later after upgrading the package".toText( "To select this subscription you need to deactivate your branches and users as this package only supports 1 branch and 2 users per branch. You can reactivate these branches later after upgrading the package"
.toText(
fontSize: 14, fontSize: 14,
color: MyColors.textColor, color: MyColors.textColor,
), ),
@ -102,10 +102,10 @@ class _DowngradeDataSheetState extends State<DowngradeDataSheet> {
onTempContinue: () async { onTempContinue: () async {
Utils.showLoading(context); Utils.showLoading(context);
GenericRespModel response = await model.payForSubscription( GenericRespModel response = await model.payForSubscription(
widget.subscription.id!, subscriptionId: widget.subscription.id!,
true, isStartNow: true,
false, isRenew: false,
widget.subscription.price.toString(), amount: widget.subscription.price.toString(),
isDegrade: true, isDegrade: true,
listOfBranches: listOfBranches, listOfBranches: listOfBranches,
listOfUsers: listOfUsers, listOfUsers: listOfUsers,

@ -81,7 +81,7 @@ class _UpgradePackageSheetState extends State<UpgradePackageSheet> {
packageItem( packageItem(
LocaleKeys.nowVar.tr(), LocaleKeys.nowVar.tr(),
("${LocaleKeys.yourSubscriptionUpgradeAffectingFrom.tr()} ${widget.subscription.dateEnd == null ? DateFormat('d MMMM yyyy', context.locale.toString()).format(DateTime.now()) : DateFormat('d MMMM yyyy', context.locale.toString()).format(DateHelper.parseStringToDate(DateHelper.formatDateT(widget.subscription.dateEnd!)))}"), ("${LocaleKeys.yourSubscriptionUpgradeAffectingFrom.tr()} ${widget.subscription.dateEnd == null ? DateFormat('d MMMM yyyy', context.locale.toString()).format(DateTime.now()) : DateFormat('d MMMM yyyy', context.locale.toString()).format(DateHelper.parseStringToDate(DateHelper.formatDateT(widget.subscription.dateEnd!)))}"),
// ("${LocaleKeys.yourSubscriptionUpgradeAffectingFrom.tr()} ${widget.subscription.dateEnd == null ? DateHelper.formatAsDayMonthYear(DateTime.now()) : DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(widget.subscription.dateEnd!)))}"), // ("${LocaleKeys.yourSubscriptionUpgradeAffectingFrom.tr()} ${widget.subscription.dateEnd == null ? DateHelper.formatAsDayMonthYear(DateTime.now()) : DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(widget.subscription.dateEnd!)))}"),
double.parse(model.newPrice).toStringAsFixed(2), double.parse(model.newPrice).toStringAsFixed(2),
isNowSelected, isNowSelected,
).onPress(() { ).onPress(() {
@ -95,7 +95,7 @@ class _UpgradePackageSheetState extends State<UpgradePackageSheet> {
packageItem( packageItem(
LocaleKeys.upgradeAfterCurrentExpiry.tr(), LocaleKeys.upgradeAfterCurrentExpiry.tr(),
("${LocaleKeys.yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom.tr()} ${AppState().getproviderSubscription.first.dateEnd == null ? "" : AppState().getproviderSubscription.first.dateEnd == null ? DateFormat('d MMMM yyyy', context.locale.toString()).format(DateTime.now()) : DateFormat('d MMMM yyyy', context.locale.toString()).format(DateHelper.parseStringToDate(DateHelper.formatDateT(AppState().getproviderSubscription.first.dateEnd!)))}"), ("${LocaleKeys.yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom.tr()} ${AppState().getproviderSubscription.first.dateEnd == null ? "" : AppState().getproviderSubscription.first.dateEnd == null ? DateFormat('d MMMM yyyy', context.locale.toString()).format(DateTime.now()) : DateFormat('d MMMM yyyy', context.locale.toString()).format(DateHelper.parseStringToDate(DateHelper.formatDateT(AppState().getproviderSubscription.first.dateEnd!)))}"),
// ("${LocaleKeys.yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom.tr()} ${AppState().getproviderSubscription.first.dateEnd == null ? "" : AppState().getproviderSubscription.first.dateEnd == null ? DateHelper.formatAsDayMonthYear(DateTime.now()) : DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(AppState().getproviderSubscription.first.dateEnd!)))}"), // ("${LocaleKeys.yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom.tr()} ${AppState().getproviderSubscription.first.dateEnd == null ? "" : AppState().getproviderSubscription.first.dateEnd == null ? DateHelper.formatAsDayMonthYear(DateTime.now()) : DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(AppState().getproviderSubscription.first.dateEnd!)))}"),
widget.subscription.price.toString(), widget.subscription.price.toString(),
isNowSelected ? false : true, isNowSelected ? false : true,
).onPress(() { ).onPress(() {
@ -112,7 +112,7 @@ class _UpgradePackageSheetState extends State<UpgradePackageSheet> {
onPressed: () async { onPressed: () async {
if (widget.isRenew) { if (widget.isRenew) {
Utils.showLoading(context); Utils.showLoading(context);
GenericRespModel response = await model.createSubscriptionOrder(widget.subscription.id ?? 0, true, true); GenericRespModel response = await model.createSubscriptionOrder(subscriptionId: widget.subscription.id ?? 0, isStartNow: true, isRenew: true);
Utils.hideLoading(context); Utils.hideLoading(context);
if (response.data != null) { if (response.data != null) {
context.read<PaymentVM>().updateOrderProviderSubscriptionId(id: response.data ?? 0); context.read<PaymentVM>().updateOrderProviderSubscriptionId(id: response.data ?? 0);
@ -125,7 +125,7 @@ class _UpgradePackageSheetState extends State<UpgradePackageSheet> {
paymentType: PaymentTypes.subscription, paymentType: PaymentTypes.subscription,
onTempContinue: () async { onTempContinue: () async {
Utils.showLoading(context); Utils.showLoading(context);
GenericRespModel mResponse = await model.payForSubscription(widget.subscription.id!, isNowSelected, false, price); GenericRespModel mResponse = await model.payForSubscription(subscriptionId: widget.subscription.id!, isStartNow: isNowSelected, isRenew: false, amount: price);
Utils.hideLoading(context); Utils.hideLoading(context);
if (mResponse.messageStatus == 1) { if (mResponse.messageStatus == 1) {
context.read<PaymentVM>().updateOrderProviderSubscriptionId(id: mResponse.data); context.read<PaymentVM>().updateOrderProviderSubscriptionId(id: mResponse.data);
@ -209,3 +209,5 @@ class _UpgradePackageSheetState extends State<UpgradePackageSheet> {
); );
} }
} }

Loading…
Cancel
Save