CMA 246, 247

aamir_dev
Aamir 12 months ago
parent d4ebcf998f
commit 7ab3caa364

@ -55,6 +55,8 @@ abstract class UserRepo {
Future<GenericRespModel> changePassword(String currentPassword, String newPassword);
//Future<GenericRespModel> updateUserInfo(String firstName, String lastName);
Future<ChangeMobileRespModel> changeMobileNoOTPRequest(countryID, String mobileNo, String password);
Future<ConfirmMobileRespModel> changeMobileNo(String userToken, String userOTP);
@ -254,6 +256,13 @@ class UserRepoImp implements UserRepo {
return await injector.get<ApiClient>().postJsonForObject((json) => ConfirmEmailRespModel.fromJson(json), ApiConsts.ChangeEmail, postParams, token: t);
}
// @override
// Future<GenericRespModel> updateUserInfo(String firstName, String lastName) async {
// var postParams = {"userID": "${AppState().getUser.data!.userInfo!.id}", "firstName": "${firstName}", "lastName": "${lastName}", "genderID": 0, "cityID": 0};
// String t = AppState().getUser.data!.accessToken ?? "";
// return await injector.get<ApiClient>().postJsonForObject((json) => GenericRespModel.fromJson(json), ApiConsts.update, postParams, token: t);
// }
@override
Future<VerifyEmailRespModel> emailVerify(String email, String userID) async {
var postParams = {

@ -164,6 +164,19 @@ class UserVM extends BaseVM {
}
}
// Future<void> userDetailsUpdate(BuildContext context, String firstName, String lastName) async {
// Utils.showLoading(context);
// GenericRespModel res = await userRepo.changePassword(currentPassword, newPassword);
// Utils.hideLoading(context);
// if (res.messageStatus == 1) {
// Utils.showToast(LocaleKeys.passwordIsUpdated.tr());
//
// Navigator.of(context).pushNamedAndRemoveUntil(AppRoutes.profileView, (Route<dynamic> route) => true);
// } else {
// Utils.showToast(res.message ?? "");
// }
// }
Future<void> performCompleteProfile(
BuildContext context, {
required String password,
@ -634,8 +647,6 @@ class UserVM extends BaseVM {
notifyListeners();
}
String encodeBase64Image(File file) {
List<int> imageBytes = file.readAsBytesSync();
print(imageBytes);

@ -54,8 +54,12 @@ class _ProfileScreenState extends State<ProfileScreen> {
if (mySubscription!.id == 1) {
freeTrialName = mySubscription!.name ?? "";
} else {
startDate = (mySubscription!.dateStart != null && mySubscription!.dateStart!.isNotEmpty) ? DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(mySubscription!.dateStart!))) : "";
endDate = (mySubscription!.dateEnd != null && mySubscription!.dateEnd!.isNotEmpty) ? DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(mySubscription!.dateEnd!))) : "";
startDate = (mySubscription!.dateStart != null && mySubscription!.dateStart!.isNotEmpty)
? DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(mySubscription!.dateStart!)))
: "";
endDate = (mySubscription!.dateEnd != null && mySubscription!.dateEnd!.isNotEmpty)
? DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(mySubscription!.dateEnd!)))
: "";
}
}
return Stack(
@ -101,13 +105,34 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: ListView(
children: [
60.height,
"${AppState().getUser.data!.userInfo!.firstName} ${AppState().getUser.data!.userInfo!.lastName ?? ""}".toText(fontSize: 20).paddingOnly(left: 25),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"${AppState().getUser.data!.userInfo!.firstName} ${AppState().getUser.data!.userInfo!.lastName ?? ""}".toText(fontSize: 20).paddingOnly(left: 25),
Container(
height: 40,
width: 40,
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(color: MyColors.white, shape: BoxShape.circle, border: Border.all(color: MyColors.darkTextColor, width: 0.1)),
child: MyAssets.icEdit.buildSvg(),
).onPress(
() async {
await model.updateUserImage(context);
},
),
],
).margin(left: 0, top: 0, right: 24, bottom: 0).onPress(() {
print("Change User Name Here");
}),
Column(
children: [
if (AppState().currentAppType == AppType.provider && mySubscription != null) ...[
CustomProfileOptionsTile(
titleText: LocaleKeys.mySubscription.tr(),
subtitleText: freeTrialName.isNotEmpty ? freeTrialName : "${startDate.isNotEmpty ? "${LocaleKeys.startDate.tr()}: $startDate" : ""} ${endDate.isNotEmpty ? "${LocaleKeys.expiresOn.tr()}: $endDate" : ""}",
subtitleText: freeTrialName.isNotEmpty
? freeTrialName
: "${startDate.isNotEmpty ? "${LocaleKeys.startDate.tr()}: $startDate" : ""} ${endDate.isNotEmpty ? "${LocaleKeys.expiresOn.tr()}: $endDate" : ""}",
needBorderBelow: true,
needEditButton: false,
onTap: () {},
@ -196,7 +221,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
decoration: BoxDecoration(color: MyColors.white, shape: BoxShape.circle, border: Border.all(color: MyColors.darkTextColor, width: 0.1)),
child: MyAssets.icEdit.buildSvg(),
).onPress(
() async {
() async {
await model.updateUserImage(context);
},
),

Loading…
Cancel
Save