From aad7b199daaf7ebb1ad09c5f4ec3ec4b5874e09c Mon Sep 17 00:00:00 2001 From: Faiz Hashmi Date: Wed, 16 Oct 2024 15:10:07 +0300 Subject: [PATCH] fixed Things before QA --- lib/view_models/dashboard_view_model.dart | 2 +- .../add_new_service_appointment_page.dart | 16 +- lib/views/appoinments/appointment_page.dart | 5 +- .../appoinments/update_appointment_page.dart | 71 +++--- .../dashboard/fragments/home_fragment.dart | 38 +-- .../settings/branch/branch_detail_page.dart | 62 ++--- .../settings/branch/define_branch_view.dart | 55 +--- .../settings/schedule/add_schedules_page.dart | 3 +- .../schedule/schedules_list_page.dart | 38 ++- .../schedule/widgets/chips_picker_item.dart | 19 +- .../schedule/widgets/select_days_sheet.dart | 2 +- .../widgets/select_services_sheet.dart | 5 +- .../settings/services/create_item_page.dart | 47 ++-- .../services/create_services_page2.dart | 234 ------------------ .../services/create_services_page3.dart | 20 +- .../widget/all_subscriptions_card.dart | 8 +- .../widget/my_subscriptions_card.dart | 6 +- 17 files changed, 175 insertions(+), 456 deletions(-) delete mode 100644 lib/views/settings/services/create_services_page2.dart diff --git a/lib/view_models/dashboard_view_model.dart b/lib/view_models/dashboard_view_model.dart index ccccfa7..03b3266 100644 --- a/lib/view_models/dashboard_view_model.dart +++ b/lib/view_models/dashboard_view_model.dart @@ -36,7 +36,7 @@ class DashboardVM extends BaseVM { int selectedNavbarBarIndex = 2; - void onNavbarTapped(int index) { + void onNavbarTapped(int index) async { logger.i(AppState().getDeviceToken); selectedNavbarBarIndex = index; notifyListeners(); diff --git a/lib/views/appoinments/add_new_service_appointment_page.dart b/lib/views/appoinments/add_new_service_appointment_page.dart index 103d12c..abbc34b 100644 --- a/lib/views/appoinments/add_new_service_appointment_page.dart +++ b/lib/views/appoinments/add_new_service_appointment_page.dart @@ -183,11 +183,14 @@ class _AddNewServiceAppointmentPageState extends State 0) { + if (pickedItems != null && pickedItems!.isNotEmpty) { List items = []; pickedItems?.forEach((element) { items.add(element.id); diff --git a/lib/views/appoinments/appointment_page.dart b/lib/views/appoinments/appointment_page.dart index 15335db..0f5247a 100644 --- a/lib/views/appoinments/appointment_page.dart +++ b/lib/views/appoinments/appointment_page.dart @@ -140,7 +140,10 @@ class _AppointmentPageState extends State { } Widget progressWidget(BuildContext context, AppointmentsVM appointmentsVM) { - double percent = appointmentsVM.appointmentSlots!.occupiedSlots / appointmentsVM.appointmentSlots!.totalSlots; + double percent = 0.0; + if (appointmentsVM.appointmentSlots != null) { + percent = appointmentsVM.appointmentSlots!.occupiedSlots / appointmentsVM.appointmentSlots!.totalSlots; + } return Column( children: [ Row( diff --git a/lib/views/appoinments/update_appointment_page.dart b/lib/views/appoinments/update_appointment_page.dart index 375f400..7a2acf4 100644 --- a/lib/views/appoinments/update_appointment_page.dart +++ b/lib/views/appoinments/update_appointment_page.dart @@ -1,6 +1,7 @@ import 'package:car_provider_app/config/provider_routes.dart'; import 'package:car_provider_app/views/appoinments/widget/sheets.dart'; import 'package:car_provider_app/views/dashboard/widget/general_appointment_widget.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/dependency_injection.dart'; @@ -35,7 +36,6 @@ class UpdateAppointmentPage extends StatelessWidget { child: Consumer(builder: (BuildContext context, AppointmentsVM appointmentsVM, Widget? child) { appointmentListModel = appointmentsVM.myFilteredAppointments2[appointmentsVM.selectedAppointmentIndex].customerAppointmentList![appointmentsVM.selectedAppointmentSubIndex]; if (appointmentsVM.state == ViewState.busy) { - return const Center(child: CircularProgressIndicator()); } else { print(appointmentListModel.appointmentPaymentStatusEnum); @@ -53,7 +53,9 @@ class UpdateAppointmentPage extends StatelessWidget { onTap: () {}, ), 21.height, - if (appointmentListModel.appointmentStatusEnum != AppointmentStatusEnum.confirmed) ...[ + if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.confirmed || + appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.arrived || + appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.workStarted) ...[ ShowFillButton( title: ("+ ${LocaleKeys.addNewService.tr()}"), txtColor: MyColors.darkPrimaryColor, @@ -66,17 +68,20 @@ class UpdateAppointmentPage extends StatelessWidget { ); }, ), - ] + ], ], ), ), - if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.cancelled) "Appointment is Canceled".toText(), + if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.cancelled) ...[ + Utils.buildStatusContainer("Appointment Cancelled").paddingAll(10), + ], if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.booked) - Column( + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - showPayNowButton(context, appointmentsVM), - 12.height, - showCancelButton(context, appointmentsVM), + Expanded(child: showPayNowButton(context, appointmentsVM)), + 12.width, + Expanded(child: showCancelButton(context, appointmentsVM)), ], ).paddingAll(21), @@ -90,20 +95,18 @@ class UpdateAppointmentPage extends StatelessWidget { if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.arrived && (appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payPartial || appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.defaultStatus)) - Column( + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - showPayNowButton(context, appointmentsVM), - 12.height, - showPayLaterButton(context, appointmentsVM), + Expanded(child: showPayNowButton(context, appointmentsVM)), + 12.width, + Expanded(child: showPayLaterButton(context, appointmentsVM)), ], ).paddingAll(21), if ((appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.arrived || appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.workStarted) && appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payNow) - - buildStatusContainer(text: LocaleKeys.waitingPaymentfromtheCustomer.tr()).paddingAll(10), - - // LocaleKeys.waitingPaymentfromtheCustomer.tr().toText().paddingAll(21), + Utils.buildStatusContainer(LocaleKeys.waitingPaymentfromtheCustomer.tr()).paddingAll(10), if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.arrived && (appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.paid || appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payLater)) @@ -114,11 +117,12 @@ class UpdateAppointmentPage extends StatelessWidget { ).paddingAll(21), if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.workStarted && appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payPartial) - Column( + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - showPayLaterButton(context, appointmentsVM), - 12.height, - showPayNowButton(context, appointmentsVM), + Expanded(child: showPayNowButton(context, appointmentsVM)), + 12.width, + Expanded(child: showPayLaterButton(context, appointmentsVM)), ], ).paddingAll(21), // "Show Pay Now".toText(), @@ -133,8 +137,11 @@ class UpdateAppointmentPage extends StatelessWidget { if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.workStarted && appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payLater) showPayNowButton(context, appointmentsVM).paddingAll(21), - if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.visitCompleted) LocaleKeys.appointmentisCompleted.tr().toText().paddingAll(21), + if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.visitCompleted) ...[ + Utils.buildStatusContainer(LocaleKeys.appointmentisCompleted.tr()).paddingAll(10), + ], + //TODO: THIS NEEDS TO BE CHECKED. IMPORTANT // Padding( // padding: const EdgeInsets.all(21.0), // child: Column( @@ -182,7 +189,7 @@ class UpdateAppointmentPage extends StatelessWidget { maxWidth: double.infinity, onPressed: () async { Utils.showLoading(context); - await appointmentsVM.updateAppointmentStatus({"appointmentID": appointmentListModel.id.toString(), "appointmentStatusID": 7}); + await appointmentsVM.updateAppointmentStatus(appointmentId: appointmentListModel.id!, appointmentStatusEnum: AppointmentStatusEnum.workStarted); Utils.hideLoading(context); // showMyBottomSheet( // context, @@ -214,7 +221,7 @@ class UpdateAppointmentPage extends StatelessWidget { maxWidth: double.infinity, onPressed: () async { Utils.showLoading(context); - await appointmentsVM.updateAppointmentStatus({"appointmentID": appointmentListModel.id.toString(), "appointmentStatusID": 3}); + await appointmentsVM.updateAppointmentStatus(appointmentId: appointmentListModel.id!, appointmentStatusEnum: AppointmentStatusEnum.arrived); _updateAppointment(context, appointmentListModel.branchId ?? 0); Utils.hideLoading(context); }, @@ -234,29 +241,13 @@ class UpdateAppointmentPage extends StatelessWidget { ); } - Widget buildStatusContainer({required String text}) { - return Center( - child: text.toString().toText( - color: MyColors.adPendingStatusColor, - fontSize: 14, - // isItalic: true, - ), - ).toContainer( - marginAll: 10, - paddingAll: 10, - borderRadius: 8, - width: double.infinity, - backgroundColor: MyColors.adPendingStatusColor.withOpacity(0.16), - ); - } - Widget showCompleteButton(BuildContext context, AppointmentsVM appointmentsVM) { return ShowFillButton( title: LocaleKeys.complete.tr(), maxWidth: double.infinity, onPressed: () async { Utils.showLoading(context); - await appointmentsVM.updateAppointmentStatus({"appointmentID": appointmentListModel.id.toString(), "appointmentStatusID": 8}); + await appointmentsVM.updateAppointmentStatus(appointmentId: appointmentListModel.id!, appointmentStatusEnum: AppointmentStatusEnum.visitCompleted); _updateAppointment(context, appointmentListModel.branchId ?? 0); Utils.hideLoading(context); }, diff --git a/lib/views/dashboard/fragments/home_fragment.dart b/lib/views/dashboard/fragments/home_fragment.dart index 481606e..07d9a76 100644 --- a/lib/views/dashboard/fragments/home_fragment.dart +++ b/lib/views/dashboard/fragments/home_fragment.dart @@ -34,25 +34,25 @@ class HomeFragment extends StatelessWidget { leadingWidth: 100, toolbarHeight: 59, onTap: () => navigateWithName(context, AppRoutes.settingOptionsLanguages), - actions: [ - IconButton( - onPressed: () => context.read().onRefresh(context), - icon: const b.Badge( - badgeContent: Text( - '3', - style: TextStyle( - fontSize: 10, - color: Colors.white, - ), - ), - badgeStyle: b.BadgeStyle( - badgeColor: MyColors.primaryColor, - padding: EdgeInsets.all(5), - ), - child: Icon(Icons.notifications_active), - ), - ), - 10.width, + actions: const [ + // IconButton( + // onPressed: () {}, + // icon: const b.Badge( + // badgeContent: Text( + // '3', + // style: TextStyle( + // fontSize: 10, + // color: Colors.white, + // ), + // ), + // badgeStyle: b.BadgeStyle( + // badgeColor: MyColors.primaryColor, + // padding: EdgeInsets.all(5), + // ), + // child: Icon(Icons.notifications_active), + // ), + // ), + // 10.width, ], ), body: SizedBox( diff --git a/lib/views/settings/branch/branch_detail_page.dart b/lib/views/settings/branch/branch_detail_page.dart index 879c9bb..2c04c14 100644 --- a/lib/views/settings/branch/branch_detail_page.dart +++ b/lib/views/settings/branch/branch_detail_page.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:car_provider_app/config/provider_routes.dart'; import 'package:car_provider_app/views/settings/branch/dealer/widget/assign_dealer_user_sheet.dart'; import 'package:mc_common_app/generated/locale_keys.g.dart'; +import 'package:mc_common_app/utils/utils.dart'; import 'package:mc_common_app/view_models/service_view_model.dart'; import 'package:car_provider_app/views/settings/services/services_list_page.dart'; import 'package:easy_localization/easy_localization.dart'; @@ -12,7 +13,6 @@ import 'package:mc_common_app/classes/consts.dart'; import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/models/provider_branches_models/branch_detail_model.dart'; -import 'package:mc_common_app/models/provider_branches_models/profile/categroy.dart'; import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/navigator.dart'; @@ -26,20 +26,20 @@ import 'package:provider/provider.dart'; class BranchDetailPage extends StatelessWidget { final BranchDetailModel branchData; - BranchDetailPage(this.branchData, {super.key}); - + const BranchDetailPage(this.branchData, {super.key}); getBranchUsers(BuildContext context) { scheduleMicrotask(() { - context.read().getAllProviderDealers( - {"ServiceProviderBranchID": branchData.id.toString(), "ServiceProviderID": AppState().getUser.data?.userInfo?.providerId.toString() ?? ""}, - ); + if (context.read().allProviderDealersList.isNotEmpty) { + context.read().getAllProviderDealers( + {"ServiceProviderBranchID": branchData.id.toString(), "ServiceProviderID": AppState().getUser.data?.userInfo?.providerId.toString() ?? ""}, + ); + } + context.read().filterUserBranchCategories(); }); } - - bool validation(BuildContext context) { bool isValid = false; for (var element in context.read().allProviderDealersList) { @@ -69,6 +69,17 @@ class BranchDetailPage extends StatelessWidget { ); } + Widget pendingApprovalAction({required String pendingText}) { + return Center( + child: pendingText.toText(color: MyColors.lightTextColor, fontSize: 15), + ).toContainer( + paddingAll: 15, + borderRadius: 8, + width: double.infinity, + backgroundColor: MyColors.grey98Color.withOpacity(0.1), + ); + } + Widget buildFooterActionWidget(BuildContext context) { Widget actionWidget = const SizedBox(); if (AppState().userType == UserType.providerDealer && branchData.branchStatus == BranchStatusEnum.approvedOrActive) { @@ -93,23 +104,9 @@ class BranchDetailPage extends StatelessWidget { }, ); } else if (branchData.branchStatus == BranchStatusEnum.pending) { - actionWidget = ShowFillButton( - title: "Pending Approval", - maxWidth: double.infinity, - isDisabled: true, - onPressed: () {}, - ); + actionWidget = pendingApprovalAction(pendingText: "Approval Pending"); } else if (branchData.branchStatus == BranchStatusEnum.deactivated) { - actionWidget = ShowFillButton( - title: "Activate Now", - maxWidth: double.infinity, - backgroundColor: MyColors.darkPrimaryColor, - borderColor: MyColors.darkPrimaryColor, - txtColor: MyColors.white, - fontSize: 15, - isFilled: true, - onPressed: () {}, - ); + actionWidget = pendingApprovalAction(pendingText: "Activate Now"); } else if (branchData.branchStatus == BranchStatusEnum.rejected) { actionWidget = Column( children: [ @@ -181,9 +178,7 @@ class BranchDetailPage extends StatelessWidget { child: ListView.builder( itemBuilder: (context, index) { return Container( - child: (EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" - ? vmodel.categories[pIndex].services![index].serviceDescriptionN.toString() - : vmodel.categories[pIndex].services![index].serviceDescription.toString()) + child: (EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" ? vmodel.categories[pIndex].services![index].serviceDescriptionN.toString() : vmodel.categories[pIndex].services![index].serviceDescription.toString()) .toText( fontSize: 12, color: MyColors.lightTextColor, @@ -289,6 +284,10 @@ class BranchDetailPage extends StatelessWidget { ) .margin(right: 5), ).onPress(() { + if (branchData.branchStatus == BranchStatusEnum.pending || branchData.branchStatus == BranchStatusEnum.rejected) { + Utils.showToast("Please wait for the branch verification."); + return; + } navigateWithName(context, ProviderAppRoutes.schedulesList, arguments: branchData.id.toString()); }), Row( @@ -298,23 +297,28 @@ class BranchDetailPage extends StatelessWidget { const Icon( Icons.add, color: Colors.white, + size: 18, ).toContainer( borderRadius: 100, paddingAll: 2, backgroundColor: MyColors.darkIconColor, ), 8.width, - LocaleKeys.addNewService.tr().toText(fontSize: 13, color: MyColors.lightTextColor, letterSpacing: -0.52), + LocaleKeys.addNewService.tr().toText(fontSize: 15, color: MyColors.lightTextColor, letterSpacing: -0.52), ], ) .toContainer( borderRadius: 0, backgroundColor: MyColors.darkWhiteColor, width: double.infinity, - paddingAll: 20, + paddingAll: 25, margin: const EdgeInsets.only(left: 20, right: 20, top: 20), ) .onPress(() { + if (branchData.branchStatus == BranchStatusEnum.pending || branchData.branchStatus == BranchStatusEnum.rejected) { + Utils.showToast("Please wait for the branch verification."); + return; + } navigateWithName( context, ProviderAppRoutes.createServices3, diff --git a/lib/views/settings/branch/define_branch_view.dart b/lib/views/settings/branch/define_branch_view.dart index 3b68e2b..f385a1e 100644 --- a/lib/views/settings/branch/define_branch_view.dart +++ b/lib/views/settings/branch/define_branch_view.dart @@ -175,49 +175,6 @@ class _DefineBranchViewState extends State { }, ), 12.height, - // InkWell( - // onTap: () { - // navigateTo( - // context, - // PickLocationPage( - // onPickAddress: (double latitude, double longitude, String address) { - // serviceVM.latitude = latitude; - // serviceVM.longitude = longitude; - // serviceVM.address = address; - // serviceVM.setState(ViewState.idle); - // }, - // ), - // ); - // }, - // child: Container( - // width: double.infinity, - // height: 45, - // decoration: BoxDecoration( - // color: Colors.transparent, - // border: Border.all(color: MyColors.darkPrimaryColor, width: 2), - // borderRadius: const BorderRadius.all(Radius.circular(8)), - // ), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // const Icon( - // Icons.place_outlined, - // size: 18, - // color: MyColors.darkPrimaryColor, - // ), - // 8.width, - // Text( - // LocaleKeys.pickAddress.tr(), - // style: const TextStyle( - // color: MyColors.darkPrimaryColor, - // ), - // ), - // ], - // ), - // ), - // ), - // 12.height, DottedRectContainer( onTap: () => serviceVM.pickMultipleImages(), text: LocaleKeys.attachImage.tr(), @@ -285,12 +242,12 @@ class _DefineBranchViewState extends State { await serviceVM.onUpdateBranchPressed( context: context, branchID: widget.branchData!.id ?? 0, - branchName: widget.branchData!.branchName ?? "", - branchDesc: widget.branchData!.branchDescription ?? "", - openTime: widget.branchData!.openTime ?? "", - closedTime: widget.branchData!.closeTime ?? "", - cityID: widget.branchData!.cityId ?? 0, - address: widget.branchData!.address ?? "", + branchName: serviceVM.branchName, + branchDesc: serviceVM.branchDescription, + openTime: serviceVM.openTime, + closedTime: serviceVM.closedTime, + cityID: serviceVM.cityId, + address: serviceVM.address, latitude: widget.branchData!.latitude ?? "0", longitude: widget.branchData!.longitude ?? "0", ); diff --git a/lib/views/settings/schedule/add_schedules_page.dart b/lib/views/settings/schedule/add_schedules_page.dart index 9faa2ee..5c87d44 100644 --- a/lib/views/settings/schedule/add_schedules_page.dart +++ b/lib/views/settings/schedule/add_schedules_page.dart @@ -246,7 +246,7 @@ class _AddSchedulesPageState extends State { ShowFillButton( title: LocaleKeys.create.tr(), maxWidth: double.infinity, - margin: const EdgeInsets.all(20), + margin: const EdgeInsets.symmetric(horizontal: 20), onPressed: () { if (validation(model)) { if (scheduleData.id != null) { @@ -333,7 +333,6 @@ class _AddSchedulesPageState extends State { "serviceGroupDescription": "string", }; - GenericRespModel servicesResponse = await model.addServicesInSchedule(map1); Utils.hideLoading(context); if (servicesResponse.messageStatus == 1) { diff --git a/lib/views/settings/schedule/schedules_list_page.dart b/lib/views/settings/schedule/schedules_list_page.dart index 20ee67a..fa71967 100644 --- a/lib/views/settings/schedule/schedules_list_page.dart +++ b/lib/views/settings/schedule/schedules_list_page.dart @@ -5,7 +5,6 @@ import 'package:mc_common_app/classes/consts.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/appointments_models/schedule_model.dart'; import 'package:mc_common_app/models/general_models/generic_resp_model.dart'; import 'package:mc_common_app/theme/colors.dart'; @@ -20,9 +19,9 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:easy_localization/easy_localization.dart'; class SchedulesListPage extends StatefulWidget { - String? branchId; + final String? branchId; - SchedulesListPage(this.branchId, {Key? key}) : super(key: key); + const SchedulesListPage(this.branchId, {Key? key}) : super(key: key); @override State createState() => _SchedulesListPageState(); @@ -65,7 +64,6 @@ class _SchedulesListPageState extends State { Expanded( child: value.schedule!.data![index].scheduleName.toString().toText( fontSize: 16, - isBold: true, ), ), IconButton( @@ -95,26 +93,22 @@ class _SchedulesListPageState extends State { }), ], ), + 8.height, + showItem("${LocaleKeys.startDate.tr()}:", DateHelper.formatAsDayMonthYear(value.schedule!.data![index].fromDate)), + showItem("${LocaleKeys.endDate.tr()}:", DateHelper.formatAsDayMonthYear(value.schedule!.data![index].toDate)), + showItem("${LocaleKeys.shiftStartTime.tr()}:", value.schedule!.data![index].startTime ?? ""), + showItem("${LocaleKeys.shiftEndTime.tr()}:", value.schedule!.data![index].endTime ?? ""), + showItem("${LocaleKeys.slotsTime.tr()}:", "${value.schedule!.data![index].slotDurationMinute} Mins"), + showItem("${LocaleKeys.appointmentPerSlot.tr()}:", value.schedule!.data![index].perSlotAppointment.toString()), + showItem("${LocaleKeys.offDays.tr()}:", offDays(value.schedule!.data![index])), 12.height, - showItem("Start Date:", DateHelper.formatAsDayMonthYear(value.schedule!.data![index].fromDate)), - showItem("End Date:", DateHelper.formatAsDayMonthYear(value.schedule!.data![index].toDate)), - showItem("Off Days:", DateHelper.formatAsDayMonthYear(value.schedule!.data![index].fromDate)), - showItem("Shift Start Time:", value.schedule!.data![index].startTime ?? ""), - showItem("Shift End Time:", value.schedule!.data![index].endTime ?? ""), - showItem("Slots Time:", "${value.schedule!.data![index].slotDurationMinute} Mins"), - showItem("Appointments Per Slot:", value.schedule!.data![index].perSlotAppointment.toString()), - showItem("Off Days", offDays(value.schedule!.data![index])), - 12.height, - "Services:".toText(fontSize: 12, isBold: true, color: MyColors.lightTextColor), + "${LocaleKeys.services.tr()}:".toText(fontSize: 12, color: MyColors.lightTextColor), Column( crossAxisAlignment: CrossAxisAlignment.start, children: value.schedule!.data![index].scheduleServices! .map( (element) => Container( - child: element.serviceDescription.toString().toText( - fontSize: 12, - isBold: true, - ), + child: element.serviceDescription.toString().toText(fontSize: 12), ), ) .toList(), @@ -132,7 +126,7 @@ class _SchedulesListPageState extends State { ), ), ShowFillButton( - title: "Create Schedule", + title: LocaleKeys.createSchedule.tr(), maxWidth: double.infinity, margin: const EdgeInsets.all(20), onPressed: () { @@ -150,7 +144,7 @@ class _SchedulesListPageState extends State { for (int i = 0; i < scheduleData.weeklyOffDays!.length; i++) { offDays = offDays + initDaysList[scheduleData.weeklyOffDays![i].dayNumber! - 1].title; if (i != scheduleData.weeklyOffDays!.length - 1) { - offDays = offDays + " , "; + offDays = "$offDays , "; } } return offDays; @@ -159,9 +153,9 @@ class _SchedulesListPageState extends State { Widget showItem(String title, String value) { return Row( children: [ - title.toText(fontSize: 12, isBold: true, color: MyColors.lightTextColor), + title.toText(fontSize: 12, color: MyColors.lightTextColor), 4.width, - value.toText(fontSize: 12, isBold: true), + value.toText(fontSize: 12), ], ); } diff --git a/lib/views/settings/schedule/widgets/chips_picker_item.dart b/lib/views/settings/schedule/widgets/chips_picker_item.dart index e7515e2..d6e1eaa 100644 --- a/lib/views/settings/schedule/widgets/chips_picker_item.dart +++ b/lib/views/settings/schedule/widgets/chips_picker_item.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:mc_common_app/classes/consts.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'; @@ -14,17 +15,17 @@ class PickerItem { } class ChipsPickerItem extends StatelessWidget { - String hint; - List itemsList; - Function onClick; + final String hint; + final List itemsList; + final Function onClick; - ChipsPickerItem({Key? key, required this.hint, required this.itemsList, required this.onClick}) : super(key: key); + const ChipsPickerItem({Key? key, required this.hint, required this.itemsList, required this.onClick}) : super(key: key); @override Widget build(BuildContext context) { return Row( children: [ - if (itemsList.isEmpty) Expanded(child: hint.toText(fontSize: 9.sp, color: borderColor)), + if (itemsList.isEmpty) Expanded(child: hint.toText(fontSize: 14, color: borderColor)), if (itemsList.isNotEmpty) Expanded( child: ListView( @@ -61,9 +62,12 @@ class ChipsPickerItem extends StatelessWidget { Widget showItem(String title, {bool isNeedToShowIcon = true}) { return Container( + padding: const EdgeInsets.symmetric(horizontal: 6), + height: double.infinity, + color: MyColors.chipColor, child: Row( children: [ - title.toText(fontSize: 12), + title.toText(fontSize: 14, fontWeight: MyFonts.Medium), if (isNeedToShowIcon) 4.width, if (isNeedToShowIcon) const Icon( @@ -79,9 +83,6 @@ class ChipsPickerItem extends StatelessWidget { ), ], ), - padding: const EdgeInsets.symmetric(horizontal: 6), - height: double.infinity, - color: MyColors.chipColor, ); } } diff --git a/lib/views/settings/schedule/widgets/select_days_sheet.dart b/lib/views/settings/schedule/widgets/select_days_sheet.dart index 38bbd77..2165207 100644 --- a/lib/views/settings/schedule/widgets/select_days_sheet.dart +++ b/lib/views/settings/schedule/widgets/select_days_sheet.dart @@ -71,7 +71,7 @@ class _SelectDaysSheetState extends State { ), 12.width, Expanded( - child: list[index].title.toText(), + child: list[index].title.toText(fontSize: 16), ), ], ); diff --git a/lib/views/settings/schedule/widgets/select_services_sheet.dart b/lib/views/settings/schedule/widgets/select_services_sheet.dart index a4b1cdf..95c72b6 100644 --- a/lib/views/settings/schedule/widgets/select_services_sheet.dart +++ b/lib/views/settings/schedule/widgets/select_services_sheet.dart @@ -11,7 +11,6 @@ import 'package:mc_common_app/widgets/txt_field.dart'; import 'package:provider/provider.dart'; import 'package:easy_localization/easy_localization.dart'; - class SelectServicesSheet extends StatelessWidget { Function onSelectServices; @@ -73,7 +72,7 @@ class SelectServicesSheet extends StatelessWidget { ), 12.width, Expanded( - child: model.servicesList![index].description!.toText(), + child: model.servicesList![index].description!.toText(fontSize: 16), ), ], ); @@ -100,7 +99,7 @@ class SelectServicesSheet extends StatelessWidget { onSelectServices(); Navigator.pop(context); }, - ) + ).paddingOnly(bottom: 20) ], ), ); diff --git a/lib/views/settings/services/create_item_page.dart b/lib/views/settings/services/create_item_page.dart index c483101..526b13e 100644 --- a/lib/views/settings/services/create_item_page.dart +++ b/lib/views/settings/services/create_item_page.dart @@ -8,8 +8,6 @@ import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/models/general_models/generic_resp_model.dart'; import 'package:mc_common_app/models/services_models/item_model.dart'; -import 'package:mc_common_app/theme/colors.dart'; -import 'package:mc_common_app/utils/app_permission_handler.dart'; import 'package:mc_common_app/utils/date_helper.dart'; import 'package:mc_common_app/utils/navigator.dart'; import 'package:mc_common_app/utils/utils.dart'; @@ -21,7 +19,6 @@ import 'package:mc_common_app/widgets/checkbox_with_title_desc.dart'; import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:mc_common_app/widgets/txt_field.dart'; -import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:easy_localization/easy_localization.dart'; @@ -40,18 +37,16 @@ class _CreateItemPageState extends State { bool isDefaultValudDone = false; File? file; - ItemsVM? model; + ItemsVM? itemsVM; ItemData? itemData; setDefaultData() { name = itemData!.name; description = itemData!.description; price = itemData!.price; - print(itemData!.manufactureDate); //TODO: need to discuss with zahoor year and picture if (itemData!.manufactureDate != null) year = DateHelper.formatAsYearMonthDay(DateHelper.parseStringToDate(itemData!.manufactureDate ?? DateTime.now().toString())); - // itemImage=itemData. isAppointmentAvailable = itemData!.isAllowAppointment ?? false; isWorkshopAppointmentAvailable = itemData!.isAppointmentCompanyLoc ?? false; @@ -61,12 +56,12 @@ class _CreateItemPageState extends State { @override Widget build(BuildContext context) { - model ??= context.read(); + itemsVM ??= context.read(); itemData ??= ModalRoute.of(context)!.settings.arguments as ItemData; if (!isDefaultValudDone) setDefaultData(); return Scaffold( - appBar: const CustomAppBar( - title: "Add Items", + appBar: CustomAppBar( + title: LocaleKeys.addItems.tr(), ), body: Container( width: double.infinity, @@ -79,7 +74,7 @@ class _CreateItemPageState extends State { child: Column( children: [ TxtField( - hint: "Item Name", + hint: LocaleKeys.itemName.tr(), value: name, onChanged: (v) { name = v; @@ -87,7 +82,7 @@ class _CreateItemPageState extends State { ), 12.height, TxtField( - hint: "Item Description", + hint: LocaleKeys.itemDescription.tr(), value: description, onChanged: (v) { description = v; @@ -95,7 +90,7 @@ class _CreateItemPageState extends State { ), 12.height, TxtField( - hint: "Item Price", + hint: LocaleKeys.itemPrice.tr(), value: price, keyboardType: TextInputType.number, onChanged: (v) { @@ -104,7 +99,7 @@ class _CreateItemPageState extends State { ), 12.height, TxtField( - hint: "Manufacture Year", + hint: LocaleKeys.manufacturedOn.tr(), value: year, keyboardType: TextInputType.number, isNeedClickAll: true, @@ -129,7 +124,7 @@ class _CreateItemPageState extends State { isReview: false, isFromNetwork: false, onAddFilePressed: () async { - file = await model!.pickSingleFile(context); + file = await itemsVM!.pickSingleFile(context); setState(() {}); }, ), @@ -137,7 +132,7 @@ class _CreateItemPageState extends State { 10.height, DottedRectContainer( onTap: () async { - file = await model!.pickSingleFile(context); + file = await itemsVM!.pickSingleFile(context); setState(() {}); }, text: LocaleKeys.attachImage.tr(), @@ -146,8 +141,8 @@ class _CreateItemPageState extends State { 20.height, CheckBoxWithTitleDescription( isSelected: isAppointmentAvailable, - title: 'Available for appointment', - description: 'This option will allow customer to book appointment for these services', + title: LocaleKeys.availableforAppointment.tr(), + description: LocaleKeys.bookAppointmentForServices.tr(), onSelection: (bool v) { setState(() { isAppointmentAvailable = v; @@ -159,8 +154,8 @@ class _CreateItemPageState extends State { if (isAppointmentAvailable) CheckBoxWithTitleDescription( isSelected: isWorkshopAppointmentAvailable, - title: 'Allow Workshop service', - description: 'This option will show to customer that you can avail this service on workshop or not.', + title: LocaleKeys.allowingWorkshopService.tr(), + description: LocaleKeys.showServiceAvailability.tr(), onSelection: (bool v) { setState(() { isWorkshopAppointmentAvailable = v; @@ -171,8 +166,8 @@ class _CreateItemPageState extends State { if (isAppointmentAvailable) CheckBoxWithTitleDescription( isSelected: isHomeAppointmentAvailable, - title: 'Allow home services', - description: 'This option will allow customer to book appointment at their desired location', + title: LocaleKeys.allowingHomeService.tr(), + description: LocaleKeys.bookAppointmentAtLocation.tr(), onSelection: (bool v) { setState(() { isHomeAppointmentAvailable = v; @@ -189,7 +184,7 @@ class _CreateItemPageState extends State { maxWidth: double.infinity, onPressed: () async { if (validation()) { - var attachedFile = await Utils.convertFileToBase64(file!); + var attachedFile = Utils.convertFileToBase64(file!); if (!(itemData?.isUpdateOrSelected ?? false)) { Map map = { "name": name, @@ -205,10 +200,10 @@ class _CreateItemPageState extends State { "isAppointmentCustomerLoc": isHomeAppointmentAvailable }; Utils.showLoading(context); - GenericRespModel mResponse = await model!.createServiceItem(map); + GenericRespModel mResponse = await itemsVM!.createServiceItem(map); Utils.hideLoading(context); if (mResponse.messageStatus == 1) { - model!.getServiceItems(itemData!.serviceProviderServiceId ?? 0); + itemsVM!.getServiceItems(itemData!.serviceProviderServiceId ?? 0); } Utils.showToast(mResponse.message ?? ""); pop(context); @@ -228,10 +223,10 @@ class _CreateItemPageState extends State { "isAppointmentCustomerLoc": isHomeAppointmentAvailable }; Utils.showLoading(context); - GenericRespModel mResponse = await model!.updateServiceItem(map); + GenericRespModel mResponse = await itemsVM!.updateServiceItem(map); Utils.hideLoading(context); if (mResponse.messageStatus == 1) { - model!.getServiceItems(itemData!.serviceProviderServiceId ?? 0); + itemsVM!.getServiceItems(itemData!.serviceProviderServiceId ?? 0); } Utils.showToast(mResponse.message ?? ""); pop(context); diff --git a/lib/views/settings/services/create_services_page2.dart b/lib/views/settings/services/create_services_page2.dart deleted file mode 100644 index 97b9ff3..0000000 --- a/lib/views/settings/services/create_services_page2.dart +++ /dev/null @@ -1,234 +0,0 @@ -// import 'package:car_provider_app/common/widget/checkbox_with_title_desc.dart'; -// import 'package:mc_common_app/view_models/service_view_model.dart'; -// import 'package:easy_localization/easy_localization.dart'; -// -// import 'package:flutter/material.dart'; -// -// import 'package:car_provider_app/generated/locale_keys.g.dart'; -// -// import 'package:car_provider_app/view_models/branch_view_model.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/string_extensions.dart'; -// import 'package:mc_common_app/models/m_response.dart'; -// import 'package:mc_common_app/models/model/branch2.dart'; -// import 'package:mc_common_app/theme/colors.dart'; -// import 'package:mc_common_app/utils/enums.dart'; -// import 'package:mc_common_app/utils/navigator.dart'; -// import 'package:mc_common_app/utils/utils.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/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'; -// -// class CreateServicesPage2 extends StatelessWidget { -// ServiceProviderBranch? serviceProviderBranch; -// -// CreateServicesPage2(this.serviceProviderBranch, {Key? key}) : super(key: key); -// bool isAppointmentAvailable = false; -// bool isHomeAppointmentAvailable = false; -// int serviceRage = 0; -// int chargersPerKm = 0; -// -// @override -// Widget build(BuildContext context) { -// ServiceVM branchVM = context.read(); -// -// // if (serviceProviderBranch != null) { -// // branchVM.categoryDropList.clear(); -// // branchVM.serviceId = -1; -// // branchVM.fetchBranchCategory(EasyLocalization.of(context)?.currentLocale?.countryCode ?? "SA"); -// // } -// // print(AppState().getUser.data!.accessToken); -// -// return Scaffold( -// appBar: CustomAppBar(title: LocaleKeys.defineServices.tr()), -// body: SizedBox( -// width: double.infinity, -// height: double.infinity, -// child: Consumer( -// builder: (context, model, _) { -// return Column( -// children: [ -// Expanded( -// child: SingleChildScrollView( -// child: Padding( -// padding: const EdgeInsets.all(20.0), -// child: Column( -// children: [ -// Text( -// serviceProviderBranch!.branchName ?? "N/A", -// style: const TextStyle( -// fontSize: 12, -// fontWeight: FontWeight.bold, -// ), -// ).toContainer( -// padding: const EdgeInsets.only(left: 8, right: 8, bottom: 12, top: 12), -// backgroundColor: MyColors.textFieldColor, -// borderRadius: 0, -// width: double.infinity, -// ), -// 12.height, -// (model.category != null) -// ? DropdownField( -// (DropValue value) { -// model.categoryId = value.id; -// model.services = null; -// model.serviceId = -1; -// isAppointmentAvailable = false; -// isHomeAppointmentAvailable = false; -// model.fetchServicesByCategoryId(); -// -// // model.setState(ViewState.idle); -// }, -// list: model.categoryDropList, -// hint: LocaleKeys.selectServiceCategory.tr(), -// ) -// : const CircularProgressIndicator(), -// 12.height, -// (model.services != null) -// ? DropdownField( -// (DropValue value) { -// model.serviceId = value.id; -// isAppointmentAvailable = false; -// isHomeAppointmentAvailable = false; -// model.setState(ViewState.idle); -// }, -// list: model.servicesDropList, -// hint: LocaleKeys.defineServices.tr(), -// ) -// : model.categoryId == -1 -// ? Container() -// : const CircularProgressIndicator(), -// 20.height, -// if (model.serviceId != -1) -// Column( -// children: [ -// CheckBoxWithTitleDescription( -// isSelected: isAppointmentAvailable, -// title: 'Available for appointment', -// description: 'This option will allow customer to book appointment for these services', -// onSelection: (bool v) { -// isAppointmentAvailable = v; -// model.setState(ViewState.idle); -// }, -// ), -// 20.height, -// CheckBoxWithTitleDescription( -// isSelected: isHomeAppointmentAvailable, -// title: 'Allow home services', -// description: 'This option will allow customer to book appointment at their desired location', -// onSelection: (bool v) { -// isHomeAppointmentAvailable = v; -// model.setState(ViewState.idle); -// }, -// ), -// 20.height, -// if (isHomeAppointmentAvailable) -// Column( -// children: [ -// TxtField( -// hint: "Home Services Range", -// keyboardType: TextInputType.number, -// postfixWidget: Row( -// mainAxisSize: MainAxisSize.min, -// crossAxisAlignment: CrossAxisAlignment.center, -// mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// "KM".toText(color: MyColors.lightTextColor), -// ], -// ), -// onChanged: (v) { -// if (v.isNotEmpty) { -// serviceRage = int.parse(v); -// } else { -// serviceRage = 0; -// } -// }, -// ), -// 12.height, -// TxtField( -// hint: "Charges per Kilometer", -// keyboardType: TextInputType.number, -// onChanged: (v) { -// if (v.isNotEmpty) { -// chargersPerKm = int.parse(v); -// } else { -// chargersPerKm = 0; -// } -// }, -// ), -// ], -// ), -// ], -// ), -// ], -// ), -// ), -// ), -// ), -// if (model.serviceId != -1) -// ShowFillButton( -// title: LocaleKeys.save.tr(), -// maxWidth: double.infinity, -// margin: const EdgeInsets.all(20), -// onPressed: () { -// createService(context, model); -// }, -// ), -// ], -// ); -// }, -// ), -// ), -// ); -// } -// -// bool checkServicesSelection(BranchVM model) { -// bool isServiceSelected = false; -// try { -// for (var element in model.services!.data!) { -// if (element.isSelected ?? false) isServiceSelected = true; -// } -// } catch (e) { -// isServiceSelected = false; -// } -// -// return isServiceSelected; -// } -// -// createService(BuildContext context, BranchVM model) async { -// List> map = []; -// model.services!.data?.forEach((element) { -// if (model.serviceId == element.id) { -// element.isSelected = true; -// } else { -// element.isSelected = false; -// } -// }); -// -// for (int i = 0; i < model.services!.data!.length; i++) { -// if (model.services!.data![i].isSelected ?? false) { -// var postParams = { -// // "id": services!.data![i].id, -// "providerBranchID": model.branchId, -// "serviceID": model.services!.data![i].id, -// "isAllowAppointment": isAppointmentAvailable, -// "isActive": true, -// "customerLocationRange": serviceRage, -// "rangePricePerKm": chargersPerKm -// }; -// map.add(postParams); -// } -// } -// // print(map); -// Utils.showLoading(context); -// MResponse mResponse = await model.createService(map); -// model.getBranchAndServices(); -// Utils.hideLoading(context); -// Utils.showToast(mResponse.message ?? ""); -// } -// } diff --git a/lib/views/settings/services/create_services_page3.dart b/lib/views/settings/services/create_services_page3.dart index 17235fe..097b149 100644 --- a/lib/views/settings/services/create_services_page3.dart +++ b/lib/views/settings/services/create_services_page3.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'package:mc_common_app/classes/app_state.dart'; import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/models/general_models/generic_resp_model.dart'; import 'package:mc_common_app/utils/navigator.dart'; @@ -33,7 +32,7 @@ class _CreateServicesPage3State extends State { bool isAppointmentAvailable = false; bool isHomeAppointmentAvailable = false; int serviceRage = 0; - String chargersPerKm = "0"; + String chargersPerKm = ""; int? categoryId; int? serviceId = -1; DropValue? category; @@ -53,7 +52,7 @@ class _CreateServicesPage3State extends State { if (serviceRage > 0) { isHomeAppointmentAvailable = true; } - chargersPerKm = widget.branchModel?.serviceProviderService?.rangePricePerKm ?? "0"; + chargersPerKm = widget.branchModel?.serviceProviderService?.rangePricePerKm ?? ""; serviceId = widget.branchModel?.serviceProviderService?.serviceId ?? -1; } }); @@ -200,14 +199,22 @@ class _CreateServicesPage3State extends State { TxtField( hint: "Charges per Kilometer", keyboardType: TextInputType.number, - value: chargersPerKm == "0.0" ? null : chargersPerKm, + value: chargersPerKm == "" ? null : chargersPerKm, onChanged: (v) { if (v.isNotEmpty) { chargersPerKm = v; } else { - chargersPerKm = "0"; + chargersPerKm = ""; } }, + postfixWidget: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor), + ], + ), ), ], ), @@ -222,7 +229,7 @@ class _CreateServicesPage3State extends State { ShowFillButton( title: LocaleKeys.save.tr(), maxWidth: double.infinity, - margin: const EdgeInsets.all(20), + margin: const EdgeInsets.symmetric(horizontal: 20), onPressed: () { if (widget.branchModel!.serviceProviderService != null) { updateService(context, model); @@ -287,6 +294,5 @@ class _CreateServicesPage3State extends State { Utils.hideLoading(context); Utils.showToast(mResponse.message ?? ""); pop(context); - } } diff --git a/lib/views/subscriptions/widget/all_subscriptions_card.dart b/lib/views/subscriptions/widget/all_subscriptions_card.dart index 7371cb4..b181241 100644 --- a/lib/views/subscriptions/widget/all_subscriptions_card.dart +++ b/lib/views/subscriptions/widget/all_subscriptions_card.dart @@ -78,9 +78,9 @@ class AllSubscriptionsCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, children: [ - subscription.price.toString().toText(fontSize: 29, isBold: true, color: textColor, letterSpacing: -1.77), + subscription.price.toString().toText(fontSize: 29, isBold: true, color: textColor, letterSpacing: -1.77, height: 1), 2.width, - "${subscription.currency}/Month".toText(color: MyColors.lightTextColor, fontSize: 16, letterSpacing: -0.64), + "${subscription.currency ?? ""}/Month".toText(color: MyColors.lightTextColor, fontSize: 16, letterSpacing: -0.64).paddingOnly(bottom: 2), ], ), ), @@ -89,9 +89,7 @@ class AllSubscriptionsCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - (subscription.subscriptionTypeEnum == SubscriptionTypeEnum.current && subscription.isRenewable!) - ? "Renew".toText() - : (subscription.subscriptionTypeEnum)!.getStringSubscriptionTypeEnum().toText(), + (subscription.subscriptionTypeEnum == SubscriptionTypeEnum.current && subscription.isRenewable!) ? "Renew".toText() : (subscription.subscriptionTypeEnum)!.getStringSubscriptionTypeEnum().toText(), 6.width, const Icon( Icons.arrow_forward, diff --git a/lib/views/subscriptions/widget/my_subscriptions_card.dart b/lib/views/subscriptions/widget/my_subscriptions_card.dart index 60897a0..eb6a258 100644 --- a/lib/views/subscriptions/widget/my_subscriptions_card.dart +++ b/lib/views/subscriptions/widget/my_subscriptions_card.dart @@ -19,8 +19,7 @@ class MySubscriptionsCard extends StatelessWidget { Function onUpgradeSubscriptionClick; bool isMainPage; - MySubscriptionsCard(this.pvm, {Key? key, this.isSubscribed = false, this.backgroundColor, required this.onRenewSubscriptionClick, required this.onUpgradeSubscriptionClick, this.isMainPage = true}) - : super(key: key); + MySubscriptionsCard(this.pvm, {Key? key, this.isSubscribed = false, this.backgroundColor, required this.onRenewSubscriptionClick, required this.onUpgradeSubscriptionClick, this.isMainPage = true}) : super(key: key); @override Widget build(BuildContext context) { @@ -102,8 +101,7 @@ class MySubscriptionsCard extends StatelessWidget { Row( children: [ 6.width, - "Renew".toText( - color: MyColors.primaryColor, fontSize: 14, letterSpacing: -0.56, textDecoration: TextDecoration.underline, decorationColor: MyColors.primaryColor, fontWeight: MyFonts.Medium), + "Renew".toText(color: MyColors.primaryColor, fontSize: 14, letterSpacing: -0.56, textDecoration: TextDecoration.underline, decorationColor: MyColors.primaryColor, fontWeight: MyFonts.Medium), ], ).onPress(() { onRenewSubscriptionClick();