Merge branch 'aamir_dev' into faiz_development_common

# Conflicts:
#	assets/langs/ar-SA.json
#	assets/langs/en-US.json
#	lib/generated/codegen_loader.g.dart
#	lib/generated/locale_keys.g.dart
#	lib/main.dart
#	lib/views/user/login_with_password_page.dart
master_new_changes
Faiz Hashmi 1 year ago
commit 9457b0b412

@ -186,7 +186,7 @@
"updateBranch": "تحديث فرع",
"branches": "الفروع",
"requests": "الطلبات",
"noBranchFound": "لم يتم العثور على فرع",
"noBranchFound" : "لم يتم العثور على فرع",
"onlyProviderApp": "نأسف هذا التطبيق فقط لمقدمي الخدمات",
"pickAddress": "اختر العنوان",
"pickLocation": "اختر الموقع",
@ -202,19 +202,19 @@
"completeProfile2": "اكمل الملف الشخصي 2/3",
"completeProfile3": "اكمل الملف الشخصي 3/3",
"provider": "مزود",
"noRequeststoShow": "لا توجد طلبات للعرض",
"noRequeststoShow" : "لا توجد طلبات للعرض",
"myBranches": "فروعي",
"mergeAppointments": "دمج المواعيد",
"addService": "أضف الخدمة",
"selectServicestoAdd": "حدد الخدمات التي تريد إضافتها",
"mergeAppointments" : "دمج المواعيد",
"addService" : "أضف الخدمة",
"selectServicestoAdd" : "حدد الخدمات التي تريد إضافتها",
"noServiceFound": "لم يتم العثور على الخدمة",
"selectItems": "اختيار العناصر",
"noItemSelectedYet": "لم يتم تحديد أي عنصر بعد",
"totalAdditionalAmount": "إجمالي المبلغ الإضافي",
"sar": "ريال سعودي",
"cancel": "يلغي",
"add": "يضيف",
"itemsAddedSuccessfully": "تمت إضافة العناصر بنجاح",
"selectItems" : "اختيار العناصر",
"noItemSelectedYet" : "لم يتم تحديد أي عنصر بعد",
"totalAdditionalAmount" : "إجمالي المبلغ الإضافي",
"sar" : "ريال سعودي",
"cancel" : "يلغي",
"add" : "يضيف",
"itemsAddedSuccessfully" : "تمت إضافة العناصر بنجاح",
"pleaseSelectItems": "يرجى اختيار العناصر",
"totalAmount": "المبلغ الإجمالي",
"searchItems": "البحث عن العناصر",
@ -568,6 +568,15 @@
"customer": "العميل",
"amountVAR": "كمية",
"accept": "قبول",
"amountVAR": "كمية",
"nowVar": "الآن",
"whendoyouWanttoUpgrade": "متى تريد الترقية",
"yourSubscriptionUpgradeAffectingFrom": "سيتم ترقية اشتراكك الآن. ساري المفعول من",
"upgradeAfterCurrentExpiry": "الترقية بعد انتهاء الاشتراك الحالي",
"yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom": "سيتم ترقية اشتراكك بعد انتهاء اشتراكك الحالي. ساري المفعول من",
"upgradeVar": "ترقية",
"whendoyouWanttoRenew" : "متى تريد التجديد",
"renewVar" : "تجديد",
"requestAlreadyInProgress": "هذا الطلب قيد التقدم بالفعل.",
"acceptOfferConfirmation": "هل تريد قبول هذا العرض؟",
"acceptOfferConfirmationMessage": "سيتم قبول هذا العرض وستدفع المبلغ المطلوب للمشتري في وقت معين وإلا سيتم إلغاء هذا العرض."

@ -404,7 +404,7 @@
"passwordAcceptableStrong": "Your password is acceptable but not strong",
"passwordIsStrong": "Your password is strong",
"passwordVeryStrong": "Your password is very strong",
"onlyProviderApp": "Sorry, Only Customer's can log in this app",
"onlyProviderApp": "Sorry, Only Providers can log in this app",
"selectDuration": "Select Duration",
"daysVar": "Days",
"adCharges": "Ad Charges",
@ -423,93 +423,93 @@
"reserveAd": "Reserve Ad",
"reservationAmount": "Reservation Amount",
"belowAmountPayLater": "Below Amount that you will pay later",
"carPrice": "Car Price",
"vatExcluded": "VAT Excluded",
"carInsuranceService": "Car insurance Service",
"toBeDecided": "To be Decided",
"registrationCarPlates": "Registration & Car Plates",
"homeDeliveryService": "Home Delivery Service",
"specialServicechargesInsuranceDeliveryLocation": "Special service charges will be added based on desired insurance and delivery Location",
"estimated": "Estimated",
"servicesReservingAd": "Some services are mandatory while reserving Ad",
"completeReservation": "Complete Reservation",
"contact": "Contact",
"setDateandTime": "Set Date and Time",
"selectOffice": "Select Office",
"availableSlots": "Available Slots",
"bookAndPay": "Book and Pay",
"reservationAmounts": "Reservation Amounts",
"tax": "Tax",
"carPrice":"Car Price",
"vatExcluded":"VAT Excluded",
"carInsuranceService":"Car insurance Service",
"toBeDecided":"To be Decided",
"registrationCarPlates":"Registration & Car Plates",
"homeDeliveryService":"Home Delivery Service",
"specialServicechargesInsuranceDeliveryLocation":"Special service charges will be added based on desired insurance and delivery Location",
"estimated":"Estimated",
"servicesReservingAd":"Some services are mandatory while reserving Ad",
"completeReservation":"Complete Reservation",
"contact":"Contact",
"setDateandTime":"Set Date and Time",
"selectOffice":"Select Office",
"availableSlots":"Available Slots",
"bookAndPay":"Book and Pay",
"reservationAmounts":"Reservation Amounts",
"tax":"Tax",
"adsFilter": "Ads Filter",
"searchByCity": "Search By City",
"selectCity": "Select City",
"searchByBrandName": "Search By Brand Name",
"selectVehicleBrand": "Select Vehicle Brand",
"searchByVehicleYear": "Search By Vehicle Year",
"selectYear": "Select Year",
"searchByAdOwner": "Search By Ad Owner",
"selectOwner": "Select Owner",
"search": "Search",
"clearFilters": "Clear Filters",
"book": "Book",
"markAsSold": "Mark As Sold",
"deactivateAd": "Deactivate Ad",
"doWantDeactivateAd": "Do you want to the Deactivate this Ad?",
"stoptheBuyers": "We will stop showing this ad to the buyers",
"cancelReservation": "Cancel Reservation",
"reasonForCancellation": "Reason for Cancellation",
"doWantCancelReservation": "Do you want to cancel the reservation",
"yourAdVisibletoBuy.": "Your ad reservation will be cancelled and this ad will be again visible to everyone to buy",
"completeDeal": "Complete Deal",
"uploadBankReceipt": "Upload Bank Receipt",
"notesForAdmin": "Notes For Admin",
"extendAd": "Extend Ad",
"updateAdDetails": "Do you want to update the Ad Details",
"durationExtendingAd": "You can change the ad duration and details before extending the ad",
"waitingAdminsResponse": "Waiting for Admins Response",
"cancelledByOwner": "Cancelled by Owner",
"cancelledByAdmin": "Cancelled by Admin",
"reservationTimeOver": "Reservation Time Over",
"paymentVerified": "Payment Verified",
"rejectedFormAdmin": "Rejected form Admin",
"waitingAdminPost": "Waiting for admin to post",
"waitingAdminsApproval": "Waiting for Admins Approval",
"sold": "Sold",
"noAdsShow": "No Ads to show",
"damagePartList": "Damage Part List",
"searchPart": "Search Part",
"addSpecialService": "Add Special Service",
"vehicleVar": "Vehicle",
"detailsVar": "Details",
"damageVar": "Damage",
"searchByCity":"Search By City",
"selectCity":"Select City",
"searchByBrandName":"Search By Brand Name",
"selectVehicleBrand":"Select Vehicle Brand",
"searchByVehicleYear":"Search By Vehicle Year",
"selectYear":"Select Year",
"searchByAdOwner":"Search By Ad Owner",
"selectOwner":"Select Owner",
"search":"Search",
"clearFilters":"Clear Filters",
"book":"Book",
"markAsSold":"Mark As Sold",
"deactivateAd":"Deactivate Ad",
"doWantDeactivateAd":"Do you want to the Deactivate this Ad?",
"stoptheBuyers":"We will stop showing this ad to the buyers",
"cancelReservation":"Cancel Reservation",
"reasonForCancellation":"Reason for Cancellation",
"doWantCancelReservation":"Do you want to cancel the reservation",
"yourAdVisibletoBuy.":"Your ad reservation will be cancelled and this ad will be again visible to everyone to buy",
"completeDeal":"Complete Deal",
"uploadBankReceipt":"Upload Bank Receipt",
"notesForAdmin":"Notes For Admin",
"extendAd":"Extend Ad",
"updateAdDetails":"Do you want to update the Ad Details",
"durationExtendingAd":"You can change the ad duration and details before extending the ad",
"waitingAdminsResponse":"Waiting for Admins Response",
"cancelledByOwner":"Cancelled by Owner",
"cancelledByAdmin":"Cancelled by Admin",
"reservationTimeOver":"Reservation Time Over",
"paymentVerified":"Payment Verified",
"rejectedFormAdmin":"Rejected form Admin",
"waitingAdminPost":"Waiting for admin to post",
"waitingAdminsApproval":"Waiting for Admins Approval",
"sold":"Sold",
"noAdsShow":"No Ads to show",
"damagePartList":"Damage Part List",
"searchPart":"Search Part",
"addSpecialService":"Add Special Service",
"vehicleVar":"Vehicle",
"detailsVar":"Details",
"damageVar":"Damage",
"partsVar": "Parts",
"additional": "Additional",
"review": "Review",
"additional":"Additional",
"review":"Review",
"adVar": "Ad",
"updateAd": "Update Ad",
"createAd": "Create Ad",
"next": "Next",
"submitAd": "Submit Ad",
"selectAdType": "Select Ad Type",
"validUntilSubscriptionExpiration": "Valid Until Subscription Expiration",
"adsRemaining ": "Ads Remaining",
"youLeftAdsGivenSubscription": "You have left with 05 out of 50 ads given in the subscription.",
"updateSubscription": "Update Subscription",
"workInProgress": "Work In Progress",
"visitCompleted": "Visit Completed",
"youWantCancelAppointment": "Do you want to cancel this appointment?",
"appointmentCancelledCannotUndoAction": "Your appointment will be cancelled and you cannot undo this action.",
"appointment": "Appointment",
"rescheduleAppointment": "Reschedule Appointment",
"payforAppointment": "Pay for Appointment",
"appointmentsFilter": "Appointments Filter",
"searchByProvider": "Search By Provider",
"selectProvider": "Select Provider",
"searchByBranch": "Search By Branch",
"searchByCategory": "Search By Category",
"selectCategory": "Select Category",
"searchByService": "Search By Service",
"selectServices": "Select Services",
"updateAd":"Update Ad",
"createAd":"Create Ad",
"next":"Next",
"submitAd":"Submit Ad",
"selectAdType":"Select Ad Type",
"validUntilSubscriptionExpiration":"Valid Until Subscription Expiration",
"adsRemainingVar ":"Ads Remaining",
"youLeftAdsGivenSubscription":"You have left with 05 out of 50 ads given in the subscription.",
"updateSubscription":"Update Subscription",
"workInProgress":"Work In Progress",
"visitCompleted":"Visit Completed",
"youWantCancelAppointment":"Do you want to cancel this appointment?",
"appointmentCancelledCannotUndoAction":"Your appointment will be cancelled and you cannot undo this action.",
"appointment":"Appointment",
"rescheduleAppointment":"Reschedule Appointment",
"payforAppointment":"Pay for Appointment",
"appointmentsFilter":"Appointments Filter",
"searchByProvider":"Search By Provider",
"selectProvider":"Select Provider",
"searchByBranch":"Search By Branch",
"searchByCategory":"Search By Category",
"selectCategory":"Select Category",
"searchByService":"Search By Service",
"selectServices":"Select Services",
"modifyPackage": "Modify Package",
"schedule": "Schedule",
"serviceLocation": "Service Location:",
@ -527,13 +527,13 @@
"dateAndTime": "Date and Time",
"timeLocation": "Time & Location",
"serviceCharges": "Service Charges",
"locationCharges": "Location Charges",
"locationCharges" : "Location Charges",
"payableNow": "Payable Now",
"remainingAmount": "Remaining Amount",
"branchesFilter": "Branches Filter",
"searchByDistance": "Search By Distance",
"searchByDistance": "Search By Distance",
"searchByMinimumRatings": "Search By Minimum Ratings",
"chat": "Chat",
"chat": "Chat",
"noRequestsShow": "No Requests to show.",
"typeMessageHere": "Type your message here..",
"reject": "Reject",
@ -561,6 +561,8 @@
"termPrivacy": "Term & Privacy",
"inviteFriends": "Invite Friends",
"more": "More",
"language" :"Language",
"mySubscriptions": "My Subscription",
"subscriptions": "Subscriptions",
"defineLicenses": "Define Licenses",
"logOut": "Log Out",
@ -570,4 +572,13 @@
"requestAlreadyInProgress": "This request is already in progress.",
"acceptOfferConfirmation": "Do you want to accept this offer?",
"acceptOfferConfirmationMessage": "This offer will be accepted and you will pay the requested amount to the buyer in given time or else this offer will be cancelled."
"nowVar": "Now",
"whendoyouWanttoUpgrade": "When do you want to upgrade",
"yourSubscriptionUpgradeAffectingFrom": "Your subscription will upgrade now. Affecting from",
"upgradeAfterCurrentExpiry": "Upgrade after current expiry",
"yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom": "Your subscription will upgrade after you current subscription will end. Affecting from",
"upgradeVar": "Upgrade",
"whendoyouWanttoRenew" : "When do you want to renew",
"renewVar" : "Renew",
}

@ -98,6 +98,9 @@ class AppRoutes {
static const providerLicensePage = "/providerLicensePage";
//Provider User Page
static const dealerUser = "/dealerUser";
//Chat
static const String chatView = "/chatView";

File diff suppressed because it is too large Load Diff

@ -547,6 +547,14 @@ abstract class LocaleKeys {
static const customer = 'customer';
static const amountVAR = 'amountVAR';
static const accept = 'accept';
static const nowVar = 'nowVar';
static const whendoyouWanttoUpgrade = 'whendoyouWanttoUpgrade';
static const yourSubscriptionUpgradeAffectingFrom = 'yourSubscriptionUpgradeAffectingFrom';
static const upgradeAfterCurrentExpiry = 'upgradeAfterCurrentExpiry';
static const yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom = 'yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom';
static const upgradeVar = 'upgradeVar';
static const whendoyouWanttoRenew = 'whendoyouWanttoRenew';
static const renewVar = 'renewVar';
static const requestAlreadyInProgress = 'requestAlreadyInProgress';
static const acceptOfferConfirmation = 'acceptOfferConfirmation';
static const acceptOfferConfirmationMessage = 'acceptOfferConfirmationMessage';

@ -10,52 +10,87 @@ import 'package:provider/single_child_widget.dart';
import 'package:sizer/sizer.dart';
//testing push
final navigatorKey = GlobalKey<NavigatorState>();
Logger logger = Logger(
// printer: PrettyPrinter(lineLength: 0, methodCount: 0,),
printer: PrettyPrinter(printEmojis: false, colors: true,printTime: false),
);
class MyHttpOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext? context) {
return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
}
}
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized();
// AppState().setPostParamsInitConfig();
HttpOverrides.global = MyHttpOverrides();
runApp(
EasyLocalization(
supportedLocales: const <Locale>[
Locale('en', 'US'),
Locale('ar', 'SA'),
],
path: 'resources',
// assetLoader: const CodegenLoader(),
child: MultiProvider(
providers: const <SingleChildWidget>[
// ChangeNotifierProvider<LoginProviderModel>(
// create: (_) => LoginProviderModel(),
// ),
],
child: const MyApp(),
),
),
);
}
// todo terminal command to genertate translation files
// flutter pub run easy_localization:generate --source-dir ./assets/langs
// todo terminal command to genertate translation keys
// flutter pub run easy_localization:generate --source-dir ./assets/langs -f keys -o locale_keys.g.dart
// command to generate languages data from json
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, constraints) {
return Sizer(
builder: (
BuildContext context,
Orientation orientation,
DeviceType deviceType,
) {
List<LocalizationsDelegate<dynamic>> delegates = context.localizationDelegates;
// AppState().setPostParamsModel(
// PostParamsModel(
// languageID: EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2,
// ),
// );
return MaterialApp(
// key: navigatorKey,
navigatorKey: navigatorKey,
theme: AppTheme.getTheme(
isArabic: EasyLocalization.of(context)?.locale.languageCode == "ar",
),
debugShowCheckedModeBanner: false,
localizationsDelegates: delegates,
supportedLocales: context.supportedLocales,
locale: context.locale,
);
},
);
});
}
}
);
//
// class MyHttpOverrides extends HttpOverrides {
// @override
// HttpClient createHttpClient(SecurityContext? context) {
// return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
// }
// }
//
// Future<void> main() async {
// WidgetsFlutterBinding.ensureInitialized();
//
// await EasyLocalization.ensureInitialized();
// // AppState().setPostParamsInitConfig();
// HttpOverrides.global = MyHttpOverrides();
//
// runApp(
// EasyLocalization(
// supportedLocales: const <Locale>[
// Locale('en', 'US'),
// Locale('ar', 'SA'),
// ],
// path: 'resources',
// // assetLoader: const CodegenLoader(),
// child: MultiProvider(
// providers: const <SingleChildWidget>[
// // ChangeNotifierProvider<LoginProviderModel>(
// // create: (_) => LoginProviderModel(),
// // ),
// ],
// child: const MyApp(),
// ),
// ),
// );
// }
//
// // todo terminal command to genertate translation files
// // flutter pub run easy_localization:generate --source-dir ./assets/langs
// // todo terminal command to genertate translation keys
// // flutter pub run easy_localization:generate --source-dir ./assets/langs -f keys -o locale_keys.g.dart
// // command to generate languages data from json
//
// class MyApp extends StatelessWidget {
// const MyApp({super.key});
//

@ -117,6 +117,8 @@ class UserInfo {
AppState().userType = UserType.providerDealer;
} else if (json["roleID"] == 6) {
AppState().userType = UserType.providerIndividual;
} else if (json["roleID"] == 7) {
AppState().userType = UserType.providerIndividual;
} else {
AppState().userType = UserType.customer;
}

@ -202,3 +202,9 @@ enum SubscriptionTypeEnum {
upgrade,
downgrade,
}
enum SubscriptionActionTypeEnum {
ads,
users,
branches,
}

@ -53,75 +53,62 @@ class PaymentVM extends ChangeNotifier {
notifyListeners();
}
Future<void> onContinuePressed(BuildContext context,
{required PaymentTypes paymentType}) async {
Future<void> onContinuePressed(BuildContext context, {required PaymentTypes paymentType}) async {
switch (selectedPaymentMethod) {
case PaymentMethods.mada:
// TODO: Handle this case.
// TODO: Handle this case.
break;
case PaymentMethods.visa:
await onVisaCardSelected(context, paymentType);
break;
case PaymentMethods.applePay:
// TODO: Handle this case.
// TODO: Handle this case.
break;
case PaymentMethods.masterCard:
// TODO: Handle this case.
// TODO: Handle this case.
break;
case PaymentMethods.tamara:
// TODO: Handle this case.
// TODO: Handle this case.
break;
}
return;
}
Future<void> onAdsPaymentSuccess(
{required BuildContext context,
required int currentAdId,
required int paymentTypeId}) async {
Future<void> onAdsPaymentSuccess({required BuildContext context, required int currentAdId, required int paymentTypeId}) async {
Utils.showLoading(context);
PayOrderDetailRespModel payOrderDetailRespModel = await paymentRepo
.getPayOrderDetails(paymentId: paymentTypeId, adId: currentAdId);
PayOrderDetailRespModel payOrderDetailRespModel = await paymentRepo.getPayOrderDetails(paymentId: paymentTypeId, adId: currentAdId);
await Future.delayed(const Duration(seconds: 2));
Utils.hideLoading(context);
log("payOrderDetailRespModel: ${payOrderDetailRespModel.toString()}");
if (payOrderDetailRespModel.isPaid == null ||
!payOrderDetailRespModel.isPaid!) {
if (payOrderDetailRespModel.isPaid == null || !payOrderDetailRespModel.isPaid!) {
Utils.showToast(LocaleKeys.paymentFailed.tr());
return;
}
if (payOrderDetailRespModel.isPaid != null &&
payOrderDetailRespModel.isPaid!) {
if (payOrderDetailRespModel.isPaid != null && payOrderDetailRespModel.isPaid!) {
Utils.showToast(LocaleKeys.paymentSuccessful.tr());
navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard);
}
}
Future<void> onAppointmentPaymentSuccess(
{required BuildContext context,
required int currentAdId,
required int paymentTypeId}) async {
Future<void> onAppointmentPaymentSuccess({required BuildContext context, required int currentAdId, required int paymentTypeId}) async {
Utils.showLoading(context);
//TODO: CONFIRM FROM ZAHOOR THAT WILL THIS METHOD WORK FOR APPOINTMENT
PayOrderDetailRespModel payOrderDetailRespModel = await paymentRepo
.getPayOrderDetails(paymentId: paymentTypeId, adId: currentAdId);
PayOrderDetailRespModel payOrderDetailRespModel = await paymentRepo.getPayOrderDetails(paymentId: paymentTypeId, adId: currentAdId);
await Future.delayed(const Duration(seconds: 2));
Utils.hideLoading(context);
log("payOrderDetailRespModel: ${payOrderDetailRespModel.toString()}");
if (payOrderDetailRespModel.isPaid == null ||
!payOrderDetailRespModel.isPaid!) {
if (payOrderDetailRespModel.isPaid == null || !payOrderDetailRespModel.isPaid!) {
Utils.showToast(LocaleKeys.paymentFailed.tr());
return;
}
if (payOrderDetailRespModel.isPaid != null &&
payOrderDetailRespModel.isPaid!) {
if (payOrderDetailRespModel.isPaid != null && payOrderDetailRespModel.isPaid!) {
Utils.showToast(LocaleKeys.paymentSuccessful.tr());
navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard);
}
@ -143,9 +130,7 @@ class PaymentVM extends ChangeNotifier {
}
}
Future<void> placeThePayment(
{required PaymentTypes paymentTypeEnum,
required BuildContext context}) async {
Future<void> placeThePayment({required PaymentTypes paymentTypeEnum, required BuildContext context}) async {
await paymentService.placePayment(
// This will be request ID for request payment || ad ID for Ad Related Payment || OrderProviderSubscriptionID for SubscriptionPayment
id: getIdTypeByPaymentType(paymentTypeEnum),
@ -155,23 +140,23 @@ class PaymentVM extends ChangeNotifier {
Utils.showToast(LocaleKeys.paymentFailed.tr());
switch (paymentTypeEnum) {
case PaymentTypes.subscription:
// TODO: Handle this case.
// TODO: Handle this case.
break;
case PaymentTypes.appointment:
// TODO: Handle this case.
// TODO: Handle this case.
log("Appointment Payment has been Failed!!");
break;
case PaymentTypes.adReserve:
// TODO: Handle this case.
// TODO: Handle this case.
break;
case PaymentTypes.ads:
// TODO: Handle this case.
// TODO: Handle this case.
break;
case PaymentTypes.request:
// TODO: Handle this case.
// TODO: Handle this case.
break;
case PaymentTypes.extendAds:
// TODO: Handle this case.
// TODO: Handle this case.
break;
case PaymentTypes.partialAppointment:
log("Partial Appointment Payment has been Failed!!");
@ -193,10 +178,7 @@ class PaymentVM extends ChangeNotifier {
case PaymentTypes.adReserve:
case PaymentTypes.ads:
case PaymentTypes.extendAds:
await onAdsPaymentSuccess(
context: context,
paymentTypeId: paymentTypeEnum.getIdFromPaymentTypesEnum(),
currentAdId: currentAdId);
await onAdsPaymentSuccess(context: context, paymentTypeId: paymentTypeEnum.getIdFromPaymentTypesEnum(), currentAdId: currentAdId);
break;
case PaymentTypes.partialAppointment:
log("Partial Appointment Payment has been Succeeded");
@ -207,15 +189,19 @@ class PaymentVM extends ChangeNotifier {
}
onSubscriptionSuccess(BuildContext context) {
pop(context);
pop(context);
pop(context);
context.read<SubscriptionsVM>().getMySubscriptions(
AppState().getUser.data?.userInfo?.providerId.toString() ?? "");
// pop(context);
// pop(context);
// pop(context);
// context.read<SubscriptionsVM>().getMySubscriptions(AppState().getUser.data?.userInfo?.providerId.toString() ?? "");
context
.read<SubscriptionsVM>()
.mySubscriptionsBySp = [];
context.read<SubscriptionsVM>().getMySubscriptionsBySP(AppState().getUser.data?.userInfo?.providerId.toString() ?? "");
navigateReplaceWithNameUntilRoute(context, AppRoutes.mySubscriptionsPage);
}
Future<void> onVisaCardSelected(
BuildContext context, PaymentTypes paymentType) async {
Future<void> onVisaCardSelected(BuildContext context, PaymentTypes paymentType) async {
currentPaymentType = paymentType;
switch (currentPaymentType) {
case PaymentTypes.appointment:
@ -224,7 +210,7 @@ class PaymentVM extends ChangeNotifier {
await placeThePayment(context: context, paymentTypeEnum: paymentType);
break;
case PaymentTypes.request:
// TODO: Handle this case.
// TODO: Handle this case.
break;
case PaymentTypes.subscription:
await placeThePayment(context: context, paymentTypeEnum: paymentType);

@ -352,7 +352,7 @@ class UserVM extends BaseVM {
if (verifiedUser.messageStatus == 1) {
User user = User.fromJson(jsonDecode(response2.body));
if (appType == AppType.provider) {
if (user.data!.userInfo!.roleId == 5 || user.data!.userInfo!.roleId == 6) {
if (user.data!.userInfo!.roleId == 5 || user.data!.userInfo!.roleId == 6 || user.data!.userInfo!.roleId == 7) {
AppState().setUser = user;
SharedPrefManager.setUserToken(user.data!.accessToken ?? "");
SharedPrefManager.setUserId(user.data!.userInfo!.userId ?? "");
@ -393,7 +393,7 @@ class UserVM extends BaseVM {
if (verifiedUser.messageStatus == 1) {
User user = User.fromJson(jsonDecode(response2.body));
if (appType == AppType.provider) {
if (user.data!.userInfo!.roleId == 5 || user.data!.userInfo!.roleId == 6) {
if (user.data!.userInfo!.roleId == 5 || user.data!.userInfo!.roleId == 6 || user.data!.userInfo!.roleId == 7 ) {
AppState().setUser = user;
SharedPrefManager.setUserToken(user.data!.accessToken ?? "");
SharedPrefManager.setUserId(user.data!.userInfo!.userId ?? "");

@ -16,9 +16,7 @@ class PaymentMethodsView extends StatelessWidget {
final PaymentTypes paymentType;
final Function? onTempContinue;
const PaymentMethodsView(
{Key? key, required this.paymentType, this.onTempContinue})
: super(key: key);
const PaymentMethodsView({Key? key, required this.paymentType, this.onTempContinue}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -36,46 +34,29 @@ class PaymentMethodsView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
20.height,
LocaleKeys.selectPaymentMethod
.tr()
.toText(fontSize: 18, isBold: true),
LocaleKeys.selectPaymentMethod.tr().toText(fontSize: 18, isBold: true),
15.height,
Consumer(
builder:
(BuildContext context, PaymentVM paymentVm, Widget? child) {
builder: (BuildContext context, PaymentVM paymentVm, Widget? child) {
return Expanded(
child: ListView(
shrinkWrap: true,
children: [
PaymentMethodContainer(
isSelected: paymentVm.selectedPaymentMethod ==
PaymentMethods.mada,
onTap: () => paymentVm
.updateSelectedPaymentMethod(PaymentMethods.mada),
cardAsset: MyAssets.madaPng),
isSelected: paymentVm.selectedPaymentMethod == PaymentMethods.mada, onTap: () => paymentVm.updateSelectedPaymentMethod(PaymentMethods.mada), cardAsset: MyAssets.madaPng),
PaymentMethodContainer(
isSelected: paymentVm.selectedPaymentMethod ==
PaymentMethods.visa,
onTap: () => paymentVm
.updateSelectedPaymentMethod(PaymentMethods.visa),
cardAsset: MyAssets.visaPng),
isSelected: paymentVm.selectedPaymentMethod == PaymentMethods.visa, onTap: () => paymentVm.updateSelectedPaymentMethod(PaymentMethods.visa), cardAsset: MyAssets.visaPng),
PaymentMethodContainer(
isSelected: paymentVm.selectedPaymentMethod ==
PaymentMethods.applePay,
onTap: () => paymentVm.updateSelectedPaymentMethod(
PaymentMethods.applePay),
isSelected: paymentVm.selectedPaymentMethod == PaymentMethods.applePay,
onTap: () => paymentVm.updateSelectedPaymentMethod(PaymentMethods.applePay),
cardAsset: MyAssets.applePayPng),
PaymentMethodContainer(
isSelected: paymentVm.selectedPaymentMethod ==
PaymentMethods.masterCard,
onTap: () => paymentVm.updateSelectedPaymentMethod(
PaymentMethods.masterCard),
isSelected: paymentVm.selectedPaymentMethod == PaymentMethods.masterCard,
onTap: () => paymentVm.updateSelectedPaymentMethod(PaymentMethods.masterCard),
cardAsset: MyAssets.mastercardPng),
PaymentMethodContainer(
isSelected: paymentVm.selectedPaymentMethod ==
PaymentMethods.tamara,
onTap: () => paymentVm.updateSelectedPaymentMethod(
PaymentMethods.tamara),
isSelected: paymentVm.selectedPaymentMethod == PaymentMethods.tamara,
onTap: () => paymentVm.updateSelectedPaymentMethod(PaymentMethods.tamara),
cardAsset: MyAssets.tamaraEngPng),
],
),
@ -93,10 +74,7 @@ class PaymentMethodsView extends StatelessWidget {
isNeedToCallPayment = await onTempContinue!();
}
if (isNeedToCallPayment) {
context.read<PaymentVM>().onContinuePressed(
context,
paymentType: paymentType,
);
context.read<PaymentVM>().onContinuePressed(context, paymentType: paymentType);
}
},
backgroundColor: MyColors.darkPrimaryColor,
@ -114,12 +92,7 @@ class PaymentMethodContainer extends StatelessWidget {
final String cardAsset;
final Function() onTap;
const PaymentMethodContainer(
{Key? key,
required this.isSelected,
required this.cardAsset,
required this.onTap})
: super(key: key);
const PaymentMethodContainer({Key? key, required this.isSelected, required this.cardAsset, required this.onTap}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -132,9 +105,7 @@ class PaymentMethodContainer extends StatelessWidget {
decoration: BoxDecoration(
color: MyColors.white,
borderRadius: BorderRadius.circular(10),
border: Border.all(
color: isSelected ? Colors.green : Colors.transparent,
width: isSelected ? 2.0 : 0.0),
border: Border.all(color: isSelected ? Colors.green : Colors.transparent, width: isSelected ? 2.0 : 0.0),
),
child: Padding(
padding: const EdgeInsets.all(12),
@ -143,11 +114,7 @@ class PaymentMethodContainer extends StatelessWidget {
Container(
width: 24,
height: 24,
decoration: Utils.containerColorRadiusBorderWidth(
isSelected ? MyColors.primaryColor : Colors.transparent,
100,
Colors.grey,
0.5),
decoration: Utils.containerColorRadiusBorderWidth(isSelected ? MyColors.primaryColor : Colors.transparent, 100, Colors.grey, 0.5),
),
12.width,
Container(
@ -157,12 +124,7 @@ class PaymentMethodContainer extends StatelessWidget {
child: Image.asset(cardAsset),
),
Utils.mFlex(1),
isSelected
? Utils.statusContainerChip(
text: "Selected",
padding:
EdgeInsets.symmetric(vertical: 6, horizontal: 10))
: SizedBox(),
isSelected ? Utils.statusContainerChip(text: "Selected", padding: EdgeInsets.symmetric(vertical: 6, horizontal: 10)) : SizedBox(),
],
),
),

@ -35,122 +35,139 @@ class SettingOptionsLanguage extends StatelessWidget {
// ?
Expanded(
child: ListView(
shrinkWrap: true,
padding: EdgeInsets.zero,
children: [
Column(
shrinkWrap: true,
padding: EdgeInsets.zero,
children: [
Column(
children: [
CustomSettingOptionsTile(
leadingWidget: const Icon(Icons.quickreply_outlined, size: 20),
titleText: LocaleKeys.requests.tr(),
needBorderBelow: true,
onTap: () {
context.read<DashboardVmCustomer>().onNavbarTapped(4);
Navigator.pop(context);
}),
CustomSettingOptionsTile(
leadingWidget: const Icon(Icons.settings, size: 20),
titleText: LocaleKeys.settings.tr(),
needBorderBelow: true,
onTap: () {},
//navigateWithName(context, AppRoutes.settingOptionsInviteFriends),
),
CustomSettingOptionsTile(
leadingWidget: const Icon(Icons.question_mark_outlined, size: 20),
titleText: LocaleKeys.help.tr(),
needBorderBelow: true,
onTap: () => navigateWithName(context, AppRoutes.settingOptionsHelp),
),
CustomSettingOptionsTile(
leadingWidget: const Icon(Icons.person, size: 20),
titleText: LocaleKeys.account.tr(),
needBorderBelow: false,
onTap: () {
navigateWithName(context, AppRoutes.profileView);
// context.read<DashboardVmCustomer>().onNavbarTapped(4);
// Navigator.pop(context);
}),
],
).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0),
10.height,
CustomSettingOptionsTile(
leadingWidget: const Icon(Icons.quickreply_outlined, size: 20),
titleText: LocaleKeys.requests.tr(),
needBorderBelow: true,
onTap: () {
context.read<DashboardVmCustomer>().onNavbarTapped(4);
Navigator.pop(context);
}),
CustomSettingOptionsTile(
leadingWidget: const Icon(Icons.settings, size: 20),
titleText: LocaleKeys.settings.tr(),
needBorderBelow: true,
onTap: () {},
//navigateWithName(context, AppRoutes.settingOptionsInviteFriends),
),
CustomSettingOptionsTile(
leadingWidget: const Icon(Icons.question_mark_outlined, size: 20),
titleText: LocaleKeys.help.tr(),
needBorderBelow: true,
onTap: () => navigateWithName(context, AppRoutes.settingOptionsHelp),
),
CustomSettingOptionsTile(
leadingWidget: const Icon(Icons.person, size: 20),
titleText: LocaleKeys.account.tr(),
needBorderBelow: false,
onTap: () {
navigateWithName(context, AppRoutes.profileView);
// context.read<DashboardVmCustomer>().onNavbarTapped(4);
// Navigator.pop(context);
}),
],
).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0),
10.height,
CustomSettingOptionsTile(
leadingWidget: const Icon(Icons.translate, size: 20),
titleText: LocaleKeys.language.tr(),
isForLanguage: true,
onTap: () {
// if (EasyLocalization.of(context)
// ?.currentLocale
// ?.countryCode ==
// "SA") {
// context.setLocale(const Locale("en", "US"));
// } else {
// context.setLocale(const Locale('ar', 'SA'));
// }
leadingWidget: const Icon(Icons.translate, size: 20),
titleText: LocaleKeys.language.tr(),
isForLanguage: true,
onTap: () {
// if (EasyLocalization.of(context)
// ?.currentLocale
// ?.countryCode ==
// "SA") {
// context.setLocale(const Locale("en", "US"));
// } else {
// context.setLocale(const Locale('ar', 'SA'));
// }
context.read<UserVM>().changeLanguage(context);
},
).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0),
10.height,
(AppState().currentAppType == AppType.provider)
? Column(
children: [
CustomSettingOptionsTile(
leadingWidget: SizedBox(
width: 16,
height: 16,
child: SvgPicture.asset(
MyAssets.icStar,
color: MyColors.primaryColor,
),
context.read<UserVM>().changeLanguage(context);
},
).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0),
10.height,
(AppState().currentAppType == AppType.provider)
? Column(
children: [
CustomSettingOptionsTile(
leadingWidget: SizedBox(
width: 16,
height: 16,
child: SvgPicture.asset(
MyAssets.icStar,
color: MyColors.primaryColor,
),
titleText: LocaleKeys.mySubscription.tr(),
subTitle: AppState().getproviderSubscription.first.subscriptionName ?? "Silver",
isForLanguage: false,
needBorderBelow: true,
onTap: () {
navigateWithName(context, AppRoutes.mySubscriptionsPage);
},
),
CustomSettingOptionsTile(
leadingWidget: SizedBox(
width: 16,
height: 16,
child: SvgPicture.asset(
MyAssets.icGroupStar,
// color: MyColors.primaryColor,
),
titleText: LocaleKeys.mySubscription.tr(),
subTitle: AppState().getproviderSubscription.first.subscriptionName ?? "Silver",
isForLanguage: false,
needBorderBelow: true,
onTap: () {
navigateWithName(context, AppRoutes.mySubscriptionsPage);
},
),
CustomSettingOptionsTile(
leadingWidget: SizedBox(
width: 16,
height: 16,
child: SvgPicture.asset(
MyAssets.icGroupStar,
// color: MyColors.primaryColor,
),
titleText: LocaleKeys.subscriptions.tr(),
subTitle: null,
isForLanguage: false,
needBorderBelow: true,
onTap: () {
navigateWithName(context, AppRoutes.subscriptionsPage);
},
),
CustomSettingOptionsTile(
leadingWidget: SizedBox(
width: 16,
height: 16,
child: SvgPicture.asset(
MyAssets.icGroupStar,
// color: MyColors.primaryColor,
),
titleText: LocaleKeys.subscriptions.tr(),
subTitle: null,
isForLanguage: false,
needBorderBelow: true,
onTap: () {
navigateWithName(context, AppRoutes.subscriptionsPage);
},
),
CustomSettingOptionsTile(
leadingWidget: SizedBox(
width: 16,
height: 16,
child: SvgPicture.asset(
MyAssets.icGroupStar,
// color: MyColors.primaryColor,
),
titleText: LocaleKeys.defineLicenses.tr(),
subTitle: null,
isForLanguage: false,
needBorderBelow: false,
onTap: () {
navigateWithName(context, AppRoutes.providerLicensePage);
},
)
],
).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0)
: SizedBox(),
(AppState().currentAppType == AppType.provider) ? 10.height : SizedBox(),
],
)),
),
titleText: LocaleKeys.defineLicenses.tr(),
subTitle: null,
isForLanguage: false,
needBorderBelow: false,
onTap: () {
navigateWithName(context, AppRoutes.providerLicensePage);
},
),
// CustomSettingOptionsTile(
// leadingWidget: SizedBox(
// width: 16,
// height: 16,
// child: SvgPicture.asset(
// MyAssets.providersIcon,
// // color: MyColors.primaryColor,
// ),
// ),
// titleText: "Users",
// subTitle: null,
// isForLanguage: false,
// needBorderBelow: false,
// onTap: () {
// navigateWithName(context, AppRoutes.dealerUser, arguments: AppState().getUser.data!.userInfo!.id.toString());
// },
// )
],
).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0)
: SizedBox(),
(AppState().currentAppType == AppType.provider) ? 10.height : SizedBox(),
],
)),
// : Expanded(
// child: ListView(
// children: [

@ -51,6 +51,17 @@ class _LoginWithPasswordState extends State<LoginWithPassword> {
if (AppState().currentAppType == AppType.provider) {
phoneNum = "966530896018";
password = "Amir@1234";
// phoneNum = "966569755630";
// password = "Amir12345@"; //AAmir Sal
// phoneNum = "966598646795";
// password = "Zahoor@123";
// User Details
// phoneNum = "966554870506";
// password = "Sikander123@"; // "lastName": "sik",
// "email": "sikander@gmail.com",
// phoneNum = "966569755630";
// password = "Amir12345@";
}

Loading…
Cancel
Save