subscription & profile

master_new_changes
Aamir.Muhammad 1 year ago
parent b4a3819c36
commit 9a8a21e41b

@ -567,7 +567,17 @@
"logOut": "تسجيل الخروج",
"customer": "العميل",
"accept": "قبول",
"amountVAR": "كمية"
"amountVAR": "كمية",
"nowVar": "الآن",
"whendoyouWanttoUpgrade": "متى تريد الترقية",
"yourSubscriptionUpgradeAffectingFrom": "سيتم ترقية اشتراكك الآن. ساري المفعول من",
"upgradeAfterCurrentExpiry": "الترقية بعد انتهاء الاشتراك الحالي",
"yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom": "سيتم ترقية اشتراكك بعد انتهاء اشتراكك الحالي. ساري المفعول من",
"upgradeVar": "ترقية",
"whendoyouWanttoRenew" : "متى تريد التجديد",
"renewVar" : "تجديد"

@ -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",
@ -568,5 +568,13 @@
"logOut": "Log Out",
"customer": "Customer",
"accept": "Accept",
"amountVAR": "Amount"
"amountVAR": "Amount",
"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"
}

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

@ -583,7 +583,15 @@ class CodegenLoader extends AssetLoader{
"logOut": "تسجيل الخروج",
"customer": "العميل",
"accept": "قبول",
"amountVAR": "كمية"
"amountVAR": "كمية",
"nowVar": "الآن",
"whendoyouWanttoUpgrade": "متى تريد الترقية",
"yourSubscriptionUpgradeAffectingFrom": "سيتم ترقية اشتراكك الآن. ساري المفعول من",
"upgradeAfterCurrentExpiry": "الترقية بعد انتهاء الاشتراك الحالي",
"yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom": "سيتم ترقية اشتراكك بعد انتهاء اشتراكك الحالي. ساري المفعول من",
"upgradeVar": "ترقية",
"whendoyouWanttoRenew": "متى تريد التجديد",
"renewVar": "تجديد"
};
static const Map<String,dynamic> en_US = {
"firstTimeLogIn": "First Time Log In",
@ -991,7 +999,7 @@ static const Map<String,dynamic> en_US = {
"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",
@ -1155,7 +1163,15 @@ static const Map<String,dynamic> en_US = {
"logOut": "Log Out",
"customer": "Customer",
"accept": "Accept",
"amountVAR": "Amount"
"amountVAR": "Amount",
"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"
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};
}

@ -547,5 +547,13 @@ abstract class LocaleKeys {
static const customer = 'customer';
static const accept = 'accept';
static const amountVAR = 'amountVAR';
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';
}

@ -13,14 +13,17 @@ import 'package:sizer/sizer.dart';
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;
return super.createHttpClient(context)
..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
}
}
@ -64,11 +67,9 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, constraints) {
return Sizer(
builder: (
BuildContext context,
Orientation orientation,
DeviceType deviceType,
) {
builder: (BuildContext context,
Orientation orientation,
DeviceType deviceType,) {
List<LocalizationsDelegate<dynamic>> delegates = context.localizationDelegates;
// AppState().setPostParamsModel(
// PostParamsModel(
@ -79,7 +80,10 @@ class MyApp extends StatelessWidget {
// key: navigatorKey,
navigatorKey: navigatorKey,
theme: AppTheme.getTheme(
isArabic: EasyLocalization.of(context)?.locale.languageCode == "ar",
isArabic: EasyLocalization
.of(context)
?.locale
.languageCode == "ar",
),
debugShowCheckedModeBanner: false,
localizationsDelegates: delegates,

@ -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;
}

@ -78,15 +78,7 @@ enum PaymentMethods {
tamara,
}
enum PaymentTypes {
subscription,
appointment,
adReserve,
ads,
request,
extendAds,
partialAppointment
}
enum PaymentTypes { subscription, appointment, adReserve, ads, request, extendAds, partialAppointment }
enum AdCreationSteps {
vehicleDetails,
@ -199,3 +191,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: [

@ -49,10 +49,19 @@ class _LoginWithPasswordState extends State<LoginWithPassword> {
userVM = Provider.of(context, listen: false);
context.read<UserVM>().getAvailBio();
if (AppState().currentAppType == AppType.provider) {
// phoneNum = "966530896018";
// password = "Amir@1234";
phoneNum = "966569755630";
password = "Amir12345@";
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",
}
getCountryList();

Loading…
Cancel
Save