login apis, models & forgot password screen added.

merge-requests/1/merge
Sikander Saleem 3 years ago
parent bf08417bfa
commit f1beefbc46

@ -2,50 +2,53 @@
"mohemm": "Mohemm",
"english": "English",
"arabic": "Arabic",
"login": "Login",
"pleaseEnterLoginDetails": "Please enter the detail below to login",
"username": "Username",
"password": "Password",
"welcomeBack": "Welcome back",
"wouldYouLikeToLoginWithCurrentUsername": "Would you like to login with current Username?",
"lastLoginDetails": "Last Login Details:",
"verificationType": "Verification Type:",
"pleaseVerify": "Please Verify",
"verifyThroughFace": "Verify Through Face",
"verifyThroughFingerprint": "Verify Through Fingerprint",
"verifyThroughSMS": "Verify Through SMS",
"verifyThroughWhatsapp": "Verify Through Whatsapp",
"useAnotherAccount": "Use Another Account",
"pleaseEnterTheVerificationCodeSentTo": "Please enter the verification code sent to ",
"theVerificationCodeWillExpireIn": "The verification code will expire in ",
"goodMorning": "Good Morning",
"markAttendance": "Mark Attendance",
"timeLeftToday": "Time Left Today",
"checkIn": "Check In",
"workList": "Work List",
"leaveBalance": "Leave Balance",
"missingSwipes": "Missing Swipes",
"ticketBalance": "Ticket Balance",
"other": "Other",
"services": "Services",
"viewAllServices": "View All Services",
"monthlyAttendance": "Monthly Attendance",
"workFromHome": "Work From Home",
"ticketRequest": "Ticket Request",
"viewAllOffers": "View All Offers",
"offers": "Offers & ",
"discounts": "Discounts",
"newString": "New",
"setTheNewPassword": "Set the new password",
"typeYourNewPasswordBelow": "Type your new password below",
"confirmPassword": "Confirm Password",
"update": "Update",
"title": "Title",
"home": "Home",
"mySalary": "My Salary",
"createRequest": "Create Request",
"forgotPassword": "Forgot Password",
"itemsForSale": "Items for Sale",
"login": "تسجيل الدخول",
"pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول",
"username": "اسم المستخدم",
"password": "كلمة المرور",
"welcomeBack": "مرحبا بعودتك",
"wouldYouLikeToLoginWithCurrentUsername": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟",
"lastLoginDetails": "تفاصيل تسجيل الدخول الأخير:",
"verificationType": "نوع التحقق:",
"pleaseVerify": "ارجوك تحقق",
"verifyThroughFace": "تحقق من خلال الوجه",
"verifyThroughFingerprint": "تحقق من خلال بصمة الإصبع",
"verifyThroughSMS": "تحقق من خلال الرسائل القصيرة",
"verifyThroughWhatsapp": "تحقق من خلال Whatsapp",
"useAnotherAccount": "استخدم حسابا آخر",
"pleaseEnterTheVerificationCodeSentTo": "الرجاء إدخال رمز التحقق المرسل إلى ",
"theVerificationCodeWillExpireIn": "ستنتهي صلاحية رمز التحقق في ",
"goodMorning": "صباح الخير",
"markAttendance": "علامة الحضور",
"timeLeftToday": "الوقت المتبقي اليوم",
"checkIn": "تحقق في",
"workList": "قائمة العمل",
"leaveBalance": "رصيد الاجازات",
"missingSwipes": "الضربات الشديدة في عداد المفقودين",
"ticketBalance": "رصيد التذكرة",
"other": "آخر",
"services": "خدمات",
"viewAllServices": "عرض جميع الخدمات",
"monthlyAttendance": "الحضور الشهري",
"workFromHome": "العمل من المنزل",
"ticketRequest": "طلب تذكرة",
"viewAllOffers": "مشاهدة جميع العروض",
"offers": "عروض & ",
"discounts": "الخصومات",
"newString": "جديد",
"setTheNewPassword": "قم بتعيين كلمة المرور الجديدة",
"typeYourNewPasswordBelow": "اكتب كلمة المرور الجديدة أدناه",
"confirmPassword": "تأكيد كلمة المرور",
"update": "تحديث",
"title": "عنوان",
"home": "مسكن",
"mySalary": "راتبي",
"createRequest": "إنشاء طلب",
"forgotPassword": "هل نسيت كلمة السر",
"employeeId": "هوية الموظف",
"loginCodeWillSentToMobileNumber": "الرجاء إدخال معرف الموظف الخاص بك ، وسيتم إرسال رمز تسجيل الدخول إلى رقم هاتفك المحمول",
"changePassword": "تغيير كلمة المرور",
"itemsForSale": "سلع للبيع",
"msg": "Hello {} in the {} world ",
"msg_named": "{} are written in the {lang} language",
"clickMe": "Click me",

@ -45,6 +45,9 @@
"mySalary": "My Salary",
"createRequest": "Create Request",
"forgotPassword": "Forgot Password",
"employeeId": "Employee ID",
"loginCodeWillSentToMobileNumber": "Please Enter your Employee ID, A login code will be sent to your mobile number",
"changePassword": "Change Password",
"itemsForSale": "Items for Sale",
"msg": "Hello {} in the {} world ",
"msg_named": "{} are written in the {lang} language",

@ -70,6 +70,7 @@ class ApiClient {
var jsonData = jsonDecode(response.body);
return factoryConstructor(jsonData);
} catch (ex) {
print(ex);
throw APIException(APIException.BAD_RESPONSE_FORMAT, arguments: ex);
}
}
@ -103,7 +104,7 @@ class ApiClient {
var queryString = new Uri(queryParameters: queryParameters).query;
url = url + '?' + queryString;
}
var response = await _post(Uri.parse(url), body: requestBody, headers: _headers).timeout(Duration(seconds: 15));
var response = await _post(Uri.parse(url), body: requestBody, headers: _headers).timeout(Duration(seconds: 60));
if (response.statusCode >= 200 && response.statusCode < 300) {
return response;

@ -1,10 +1,11 @@
import 'dart:async';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/models/basic_member_information_model.dart';
import 'package:mohem_flutter_app/models/check_mobile_app_version_model.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/member_login_list_model.dart';
import 'package:mohem_flutter_app/models/surah_model.dart';
import 'api_client.dart';
@ -16,20 +17,78 @@ class LoginApiClient {
factory LoginApiClient() => _instance;
Future<CheckMobileAppVersionModel> checkMobileAppVersion() async {
String url = "${ApiConsts.rest}CheckMobileAppVersion";
var postParams = {};
String url = "${ApiConsts.utilitiesRest}CheckMobileAppVersion";
Map<String, dynamic> postParams = {};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) => CheckMobileAppVersionModel.fromJson(json), url, postParams);
}
Future<MemberLoginListModel?> memberLogin() async {
String url = "${ApiConsts.rest}MemberLogin";
var postParams = {};
return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json).memberLoginList, url, postParams);
Future<MemberLoginListModel?> memberLogin(String username, String password) async {
String url = "${ApiConsts.erpRest}MemberLogin";
Map<String, dynamic> postParams = {"P_APP_VERSION": "CS", "P_LANGUAGE": "US", "P_PASSWORD": password, "P_USER_NAME": username};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
AppState().postParamsObject?.setLogInTokenID = responseData.logInTokenID;
return responseData.memberLoginList;
}, url, postParams);
}
Future<GenericResponseModel?> mohemmSendActivationCodeByOTPNotificationType() async {
String url = "${ApiConsts.rest}Mohemm_SendActivationCodebyOTPNotificationType";
var postParams = {};
return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json), url, postParams);
Future<BasicMemberInformationModel?> mohemmSendActivationCodeByOTPNotificationType(int isMobileFingerPrint, String? mobileNumber, int optSendType, String? pUserName) async {
String url = "${ApiConsts.erpRest}Mohemm_SendActivationCodebyOTPNotificationType";
Map<String, dynamic> postParams = {"IsMobileFingerPrint": isMobileFingerPrint, "MobileNumber": mobileNumber, "OTP_SendType": optSendType, "P_USER_NAME": pUserName};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json).basicMemberInformation, url, postParams);
}
Future<GenericResponseModel?> checkActivationCode(bool isDeviceNFC, String? mobileNumber, String activationCode, String? pUserName) async {
String url = "${ApiConsts.erpRest}CheckActivationCode";
Map<String, dynamic> postParams = {"isDeviceNFC": isDeviceNFC, "MobileNumber": mobileNumber, "activationCode": activationCode, "P_USER_NAME": pUserName};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
AppState().postParamsObject?.setTokenID = responseData.tokenID;
return responseData;
}, url, postParams);
}
Future<BasicMemberInformationModel?> getBasicUserInformation(String pAppVersion, String pUsername) async {
String url = "${ApiConsts.erpRest}Get_BasicUserInformation";
Map<String, dynamic> postParams = {"P_APP_VERSION": pAppVersion, "P_USER_NAME": pUsername};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json).basicMemberInformation, url, postParams);
}
Future<GenericResponseModel?> sendPublicActivationCode(String? mobileNumber, String? pUsername) async {
String url = "${ApiConsts.erpRest}SendPublicActivationCode";
Map<String, dynamic> postParams = {"MobileNumber": mobileNumber, "P_MOBILE_NUMBER": mobileNumber, "P_USER_NAME": pUsername};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
AppState().postParamsObject?.setLogInTokenID = responseData.logInTokenID;
return responseData;
}, url, postParams);
}
Future<GenericResponseModel?> checkPublicActivationCode(String activationCode, String? pUserName) async {
String url = "${ApiConsts.erpRest}checkPublicActivationCode";
Map<String, dynamic> postParams = {"activationCode": activationCode, "P_USER_NAME": pUserName};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
AppState().setForgetPasswordTokenID = responseData.tokenID;
return responseData;
}, url, postParams);
}
Future<GenericResponseModel?> changePasswordForget(String forgetPasswordTokenID, String pNewPassword, String pConfirmNewPassword, String? pUserName) async {
String url = "${ApiConsts.erpRest}ChangePassword_Forget";
Map<String, dynamic> postParams = {"P_USER_NAME": pUserName, "ForgetPasswordTokenID": forgetPasswordTokenID, "P_Confirm_NEW_PASSWORD": pConfirmNewPassword, "P_NEW_PASSWORD": pNewPassword};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData;
}, url, postParams);
}
}

@ -1,5 +1,5 @@
import 'package:mohem_flutter_app/models/content_info_model.dart';
import 'package:mohem_flutter_app/models/surah_model.dart';
import 'package:mohem_flutter_app/models/member_login_list_model.dart';
import 'package:mohem_flutter_app/models/post_params_model.dart';
class AppState {
static final AppState _instance = AppState._internal();
@ -8,19 +8,29 @@ class AppState {
factory AppState() => _instance;
SurahModel? _surahModel;
String? forgetPasswordTokenID;
SurahModel? get getSurahModel => _surahModel;
set setForgetPasswordTokenID(token) => forgetPasswordTokenID = token;
void setSurahModel(SurahModel _surahModel) {
this._surahModel = _surahModel;
}
String? get getForgetPasswordTokenID => forgetPasswordTokenID;
PostParamsModel? _postParams;
ContentInfoDataModel? _copyRight;
PostParamsModel? get postParamsObject => _postParams;
ContentInfoDataModel? get getContentInfoModel => _copyRight;
Map<String, dynamic> get postParamsJson => _postParams?.toJson() ?? {};
void setContentInfoModel(ContentInfoDataModel _copyRight) {
this._copyRight = _copyRight;
void setPostParamsModel(PostParamsModel _postParams) {
this._postParams = _postParams;
}
String? username;
set setUserName(_username) => username = _username;
MemberLoginListModel? _memberLoginList;
MemberLoginListModel? get memberLoginList => _memberLoginList;
set setMemberLoginListModel(MemberLoginListModel? _memberLoginList) => this._memberLoginList = _memberLoginList;
}

@ -3,7 +3,8 @@ class ApiConsts {
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
static String baseUrlServices = baseUrl + "/services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String rest = baseUrlServices + "Utilities.svc/REST/";
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";
static String erpRest = baseUrlServices + "ERP.svc/REST/";
static String user = baseUrlServices + "api/User/";
}

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
// import 'package:fluttertoast/fluttertoast.dart';
import 'package:mohem_flutter_app/exceptions/api_exception.dart';
@ -9,8 +10,8 @@ class Utils {
static bool get isLoading => _isLoadingVisible;
static void showToast(String message) {
// Fluttertoast.showToast(
// msg: message, toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.BOTTOM, timeInSecForIosWeb: 1, backgroundColor: Colors.black54, textColor: Colors.white, fontSize: 16.0);
Fluttertoast.showToast(
msg: message, toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.BOTTOM, timeInSecForIosWeb: 1, backgroundColor: Colors.black54, textColor: Colors.white, fontSize: 16.0);
}
static dynamic getNotNullValue(List<dynamic> list, int index) {

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/ui/landing/dashboard.dart';
import 'package:mohem_flutter_app/ui/landing/today_attendance_screen.dart';
import 'package:mohem_flutter_app/ui/login/forgot_password_screen.dart';
import 'package:mohem_flutter_app/ui/login/login_screen.dart';
import 'package:mohem_flutter_app/ui/login/new_password_screen.dart';
import 'package:mohem_flutter_app/ui/login/verify_login_screen.dart';
@ -13,6 +14,7 @@ class AppRoutes {
static const String loginVerifyAccount = "/loginVerifyAccount";
static const String login = "/login";
static const String verifyLogin = "/verifyLogin";
static const String forgotPassword = "/forgotPassword";
static const String newPassword = "/newPassword";
static const String loginVerification = "/loginVerification";
static const String dashboard = "/dashboard";
@ -28,6 +30,7 @@ class AppRoutes {
verifyLogin: (context) => VerifyLoginScreen(),
dashboard: (context) => Dashboard(),
newPassword: (context) => NewPasswordScreen(),
forgotPassword: (context) => ForgotPasswordScreen(),
todayAttendance: (context) => TodayAttendanceScreen(),
//Work List

@ -11,7 +11,7 @@ import 'package:mohem_flutter_app/widgets/otp_widget.dart';
class OtpDialog {
final int type;
final int mobileNo;
final int? mobileNo;
final Function(String) onSuccess;
final Function onFailure;
final BuildContext context;
@ -57,10 +57,11 @@ class OtpDialog {
String displayTime = '';
String? _code;
dynamic setState;
bool stopTimer = false;
// static String signature;
displayDialog(BuildContext context) async {
void displayDialog(BuildContext context) async {
return showDialog(
context: context,
barrierColor: Colors.black.withOpacity(0.63),
@ -68,8 +69,8 @@ class OtpDialog {
// projectProvider = Provider.of(context);
return Dialog(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(),
insetPadding: EdgeInsets.only(left: 21, right: 21),
shape: const RoundedRectangleBorder(),
insetPadding: const EdgeInsets.only(left: 21, right: 21),
child: StatefulBuilder(builder: (context, setState) {
if (displayTime == '') {
startTimer(setState);
@ -91,14 +92,13 @@ class OtpDialog {
width: 50,
),
IconButton(
padding: EdgeInsets.zero,
icon: const Icon(Icons.close),
constraints: const BoxConstraints(),
onPressed: () {
Navigator.pop(context);
this.onFailure();
},
)
padding: EdgeInsets.zero,
icon: const Icon(Icons.close),
constraints: const BoxConstraints(),
onPressed: () {
stopTimer = true;
onFailure();
})
],
),
22.height,
@ -150,22 +150,20 @@ class OtpDialog {
InputDecoration buildInputDecoration(BuildContext context) {
return InputDecoration(
counterText: " ",
// ts/images/password_icon.png
// contentPadding: EdgeInsets.only(top: 20, bottom: 20),
enabledBorder: OutlineInputBorder(
enabledBorder: const OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).primaryColor),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
);
@ -181,33 +179,27 @@ class OtpDialog {
// }
// }
checkValue() {
//print(verifyAccountFormValue);
// if (verifyAccountForm?.currentState!.validate()) {
// onSuccess(digit1.text.toString() + digit2.text.toString() + digit3.text.toString() + digit4.text.toString());
// }
}
getSecondsAsDigitalClock(int inputSeconds) {
var sec_num = int.parse(inputSeconds.toString()); // don't forget the second param
var hours = (sec_num / 3600).floor();
var minutes = ((sec_num - hours * 3600) / 60).floor();
var seconds = sec_num - hours * 3600 - minutes * 60;
var minutesString = "";
var secondsString = "";
String getSecondsAsDigitalClock(int inputSeconds) {
int secNum = int.parse(inputSeconds.toString()); // don't forget the second param
int hours = (secNum / 3600).floor();
int minutes = ((secNum - hours * 3600) / 60).floor();
double seconds = secNum - hours * 3600 - minutes * 60;
String minutesString = "";
String secondsString = "";
minutesString = minutes < 10 ? "0" + minutes.toString() : minutes.toString();
secondsString = seconds < 10 ? "0" + seconds.toString() : seconds.toString();
secondsString = seconds < 10 ? "0" + seconds.toStringAsFixed(0) : seconds.toStringAsFixed(0);
return minutesString + ":" + secondsString;
}
startTimer(setState) {
this.remainingTime--;
void startTimer(setState) {
remainingTime--;
if (stopTimer) return;
setState(() {
displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
displayTime = getSecondsAsDigitalClock(remainingTime);
});
timer = Future.delayed(Duration(seconds: 1), () {
if (this.remainingTime > 0) {
timer = Future.delayed(const Duration(seconds: 1), () {
if (remainingTime > 0) {
startTimer(setState);
} else {
Navigator.pop(context);
@ -219,8 +211,9 @@ class OtpDialog {
Navigator.pop(context);
}
_onOtpCallBack(String otpCode, bool? isAutofill) {
void _onOtpCallBack(String otpCode, bool? isAutofill) {
if (otpCode.length == 4) {
stopTimer = true;
onSuccess(otpCode);
}
}

@ -18,50 +18,53 @@ class CodegenLoader extends AssetLoader{
"mohemm": "Mohemm",
"english": "English",
"arabic": "Arabic",
"login": "Login",
"pleaseEnterLoginDetails": "Please enter the detail below to login",
"username": "Username",
"password": "Password",
"welcomeBack": "Welcome back",
"wouldYouLikeToLoginWithCurrentUsername": "Would you like to login with current Username?",
"lastLoginDetails": "Last Login Details:",
"verificationType": "Verification Type:",
"pleaseVerify": "Please Verify",
"verifyThroughFace": "Verify Through Face",
"verifyThroughFingerprint": "Verify Through Fingerprint",
"verifyThroughSMS": "Verify Through SMS",
"verifyThroughWhatsapp": "Verify Through Whatsapp",
"useAnotherAccount": "Use Another Account",
"pleaseEnterTheVerificationCodeSentTo": "Please enter the verification code sent to ",
"theVerificationCodeWillExpireIn": "The verification code will expire in ",
"goodMorning": "Good Morning",
"markAttendance": "Mark Attendance",
"timeLeftToday": "Time Left Today",
"checkIn": "Check In",
"workList": "Work List",
"leaveBalance": "Leave Balance",
"missingSwipes": "Missing Swipes",
"ticketBalance": "Ticket Balance",
"other": "Other",
"services": "Services",
"viewAllServices": "View All Services",
"monthlyAttendance": "Monthly Attendance",
"workFromHome": "Work From Home",
"ticketRequest": "Ticket Request",
"viewAllOffers": "View All Offers",
"offers": "Offers & ",
"discounts": "Discounts",
"newString": "New",
"setTheNewPassword": "Set the new password",
"typeYourNewPasswordBelow": "Type your new password below",
"confirmPassword": "Confirm Password",
"update": "Update",
"title": "Title",
"home": "Home",
"mySalary": "My Salary",
"createRequest": "Create Request",
"forgotPassword": "Forgot Password",
"itemsForSale": "Items for Sale",
"login": "تسجيل الدخول",
"pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول",
"username": "اسم المستخدم",
"password": "كلمة المرور",
"welcomeBack": "مرحبا بعودتك",
"wouldYouLikeToLoginWithCurrentUsername": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟",
"lastLoginDetails": "تفاصيل تسجيل الدخول الأخير:",
"verificationType": "نوع التحقق:",
"pleaseVerify": "ارجوك تحقق",
"verifyThroughFace": "تحقق من خلال الوجه",
"verifyThroughFingerprint": "تحقق من خلال بصمة الإصبع",
"verifyThroughSMS": "تحقق من خلال الرسائل القصيرة",
"verifyThroughWhatsapp": "تحقق من خلال Whatsapp",
"useAnotherAccount": "استخدم حسابا آخر",
"pleaseEnterTheVerificationCodeSentTo": "الرجاء إدخال رمز التحقق المرسل إلى ",
"theVerificationCodeWillExpireIn": "ستنتهي صلاحية رمز التحقق في ",
"goodMorning": "صباح الخير",
"markAttendance": "علامة الحضور",
"timeLeftToday": "الوقت المتبقي اليوم",
"checkIn": "تحقق في",
"workList": "قائمة العمل",
"leaveBalance": "رصيد الاجازات",
"missingSwipes": "الضربات الشديدة في عداد المفقودين",
"ticketBalance": "رصيد التذكرة",
"other": "آخر",
"services": "خدمات",
"viewAllServices": "عرض جميع الخدمات",
"monthlyAttendance": "الحضور الشهري",
"workFromHome": "العمل من المنزل",
"ticketRequest": "طلب تذكرة",
"viewAllOffers": "مشاهدة جميع العروض",
"offers": "عروض & ",
"discounts": "الخصومات",
"newString": "جديد",
"setTheNewPassword": "قم بتعيين كلمة المرور الجديدة",
"typeYourNewPasswordBelow": "اكتب كلمة المرور الجديدة أدناه",
"confirmPassword": "تأكيد كلمة المرور",
"update": "تحديث",
"title": "عنوان",
"home": "مسكن",
"mySalary": "راتبي",
"createRequest": "إنشاء طلب",
"forgotPassword": "هل نسيت كلمة السر",
"employeeId": "هوية الموظف",
"loginCodeWillSentToMobileNumber": "الرجاء إدخال معرف الموظف الخاص بك ، وسيتم إرسال رمز تسجيل الدخول إلى رقم هاتفك المحمول",
"changePassword": "تغيير كلمة المرور",
"itemsForSale": "سلع للبيع",
"msg": "Hello {} in the {} world ",
"msg_named": "{} are written in the {lang} language",
"clickMe": "Click me",
@ -147,6 +150,9 @@ static const Map<String,dynamic> en_US = {
"mySalary": "My Salary",
"createRequest": "Create Request",
"forgotPassword": "Forgot Password",
"employeeId": "Employee ID",
"loginCodeWillSentToMobileNumber": "Please Enter your Employee ID, A login code will be sent to your mobile number",
"changePassword": "Change Password",
"itemsForSale": "Items for Sale",
"msg": "Hello {} in the {} world ",
"msg_named": "{} are written in the {lang} language",

@ -1,7 +1,11 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/config/app_provider.dart';
import 'package:mohem_flutter_app/generated/codegen_loader.g.dart';
import 'package:mohem_flutter_app/models/post_params_model.dart';
import 'package:mohem_flutter_app/theme/app_theme.dart';
import 'package:sizer/sizer.dart';
@ -12,7 +16,7 @@ Future<void> main() async {
await EasyLocalization.ensureInitialized();
runApp(
EasyLocalization(
supportedLocales: [
supportedLocales: const [
Locale('en', 'US'),
Locale('ar', 'SA'),
],
@ -39,6 +43,9 @@ class MyApp extends StatelessWidget {
return AppProvider(
child: Sizer(
builder: (context, orientation, deviceType) {
AppState().setPostParamsModel(
PostParamsModel(languageID: EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2, channel: 31, versionID: 3.2, mobileType: Platform.isAndroid ? "android" : "ios"),
);
return MaterialApp(
theme: AppTheme.getTheme(EasyLocalization.of(context)?.locale.languageCode == "ar"),
debugShowCheckedModeBanner: false,

@ -556,98 +556,98 @@ class GenericResponseModel {
disableSessionList = json['DisableSessionList'];
employeeQR = json['EmployeeQR'];
forgetPasswordTokenID = json['ForgetPasswordTokenID'];
getAbsenceAttachmentsList = json['GetAbsenceAttachmentsList'].cast<String>();
getAbsenceAttendanceTypesList = json['GetAbsenceAttendanceTypesList'].cast<String>();
getAbsenceCollectionNotificationBodyList = json['GetAbsenceCollectionNotificationBodyList'].cast<String>();
getAbsenceDffStructureList = json['GetAbsenceDffStructureList'].cast<String>();
getAbsenceTransactionList = json['GetAbsenceTransactionList'].cast<String>();
getAccrualBalancesList = json['GetAccrualBalancesList'].cast<String>();
getActionHistoryList = json['GetActionHistoryList'].cast<String>();
getAddressDffStructureList = json['GetAddressDffStructureList'].cast<String>();
getAddressNotificationBodyList = json['GetAddressNotificationBodyList'].cast<String>();
getApprovesList = json['GetApprovesList'].cast<String>();
getAttachementList = json['GetAttachementList'].cast<String>();
getAttendanceTrackingList = json['GetAttendanceTrackingList'].cast<String>();
getBasicDetColsStructureList = json['GetBasicDetColsStructureList'].cast<String>();
getBasicDetDffStructureList = json['GetBasicDetDffStructureList'].cast<String>();
getBasicDetNtfBodyList = json['GetBasicDetNtfBodyList'].cast<String>();
getCEICollectionNotificationBodyList = json['GetCEICollectionNotificationBodyList'].cast<String>();
getCEIDFFStructureList = json['GetCEIDFFStructureList'].cast<String>();
getCEITransactionList = json['GetCEITransactionList'].cast<String>();
getCcpDffStructureList = json['GetCcpDffStructureList'].cast<String>();
getCcpOutputList = json['GetCcpOutputList'].cast<String>();
getCcpTransactionsList = json['GetCcpTransactionsList'].cast<String>();
getCcpTransactionsListNew = json['GetCcpTransactionsList_New'].cast<String>();
getConcurrentProgramsList = json['GetConcurrentProgramsList'].cast<String>();
getContactColsStructureList = json['GetContactColsStructureList'].cast<String>();
getContactDetailsList = json['GetContactDetailsList'].cast<String>();
getContactDffStructureList = json['GetContactDffStructureList'].cast<String>();
getContactNotificationBodyList = json['GetContactNotificationBodyList'].cast<String>();
getCountriesList = json['GetCountriesList'].cast<String>();
getDayHoursTypeDetailsList = json['GetDayHoursTypeDetailsList'].cast<String>();
getDeductionsList = json['GetDeductionsList'].cast<String>();
getDefaultValueList = json['GetDefaultValueList'].cast<String>();
getEITCollectionNotificationBodyList = json['GetEITCollectionNotificationBodyList'].cast<String>();
getEITDFFStructureList = json['GetEITDFFStructureList'].cast<String>();
getEITTransactionList = json['GetEITTransactionList'].cast<String>();
getEarningsList = json['GetEarningsList'].cast<String>();
getEmployeeAddressList = json['GetEmployeeAddressList'].cast<String>();
getEmployeeBasicDetailsList = json['GetEmployeeBasicDetailsList'].cast<String>();
getEmployeeContactsList = json['GetEmployeeContactsList'].cast<String>();
getEmployeePhonesList = json['GetEmployeePhonesList'].cast<String>();
getEmployeeSubordinatesList = json['GetEmployeeSubordinatesList'].cast<String>();
getFliexfieldStructureList = json['GetFliexfieldStructureList'].cast<String>();
getHrCollectionNotificationBodyList = json['GetHrCollectionNotificationBodyList'].cast<String>();
getHrTransactionList = json['GetHrTransactionList'].cast<String>();
getItemCreationNtfBodyList = json['GetItemCreationNtfBodyList'].cast<String>();
getItemTypeNotificationsList = json['GetItemTypeNotificationsList'].cast<String>();
getItemTypesList = json['GetItemTypesList'].cast<String>();
getLookupValuesList = json['GetLookupValuesList'].cast<String>();
getMenuEntriesList = json['GetMenuEntriesList'].cast<String>();
getMoItemHistoryList = json['GetMoItemHistoryList'].cast<String>();
getMoNotificationBodyList = json['GetMoNotificationBodyList'].cast<String>();
getNotificationButtonsList = json['GetNotificationButtonsList'].cast<String>();
getNotificationReassignModeList = json['GetNotificationReassignModeList'].cast<String>();
getObjectValuesList = json['GetObjectValuesList'].cast<String>();
getOpenMissingSwipesList = json['GetOpenMissingSwipesList'].cast<String>();
getOpenNotificationsList = json['GetOpenNotificationsList'].cast<String>();
getOpenNotificationsNumList = json['GetOpenNotificationsNumList'].cast<String>();
getOpenPeriodDatesList = json['GetOpenPeriodDatesList'].cast<String>();
getOrganizationsSalariesList = json['GetOrganizationsSalariesList'].cast<String>();
getPaymentInformationList = json['GetPaymentInformationList'].cast<String>();
getPayslipList = json['GetPayslipList'].cast<String>();
getPendingReqDetailsList = json['GetPendingReqDetailsList'].cast<String>();
getPendingReqFunctionsList = json['GetPendingReqFunctionsList'].cast<String>();
getPerformanceAppraisalList = json['GetPerformanceAppraisalList'].cast<String>();
getPhonesNotificationBodyList = json['GetPhonesNotificationBodyList'].cast<String>();
getPoItemHistoryList = json['GetPoItemHistoryList'].cast<String>();
getPoNotificationBodyList = json['GetPoNotificationBodyList'].cast<String>();
getPrNotificationBodyList = json['GetPrNotificationBodyList'].cast<String>();
getQuotationAnalysisList = json['GetQuotationAnalysisList'].cast<String>();
getRFCEmployeeListList = json['GetRFCEmployeeListList'].cast<String>();
getRespondAttributeValueList = json['GetRespondAttributeValueList'].cast<String>();
getSITCollectionNotificationBodyList = json['GetSITCollectionNotificationBodyList'].cast<String>();
getSITDFFStructureList = json['GetSITDFFStructureList'].cast<String>();
getSITTransactionList = json['GetSITTransactionList'].cast<String>();
getScheduleShiftsDetailsList = json['GetScheduleShiftsDetailsList'].cast<String>();
getShiftTypesList = json['GetShiftTypesList'].cast<String>();
getStampMsNotificationBodyList = json['GetStampMsNotificationBodyList'].cast<String>();
getStampNsNotificationBodyList = json['GetStampNsNotificationBodyList'].cast<String>();
getSubordinatesAttdStatusList = json['GetSubordinatesAttdStatusList'].cast<String>();
getSubordinatesLeavesList = json['GetSubordinatesLeavesList'].cast<String>();
getSubordinatesLeavesTotalVacationsList = json['GetSubordinatesLeavesTotalVacationsList'].cast<String>();
getSummaryOfPaymentList = json['GetSummaryOfPaymentList'].cast<String>();
getSwipesList = json['GetSwipesList'].cast<String>();
getTermColsStructureList = json['GetTermColsStructureList'].cast<String>();
getTermDffStructureList = json['GetTermDffStructureList'].cast<String>();
getTermNotificationBodyList = json['GetTermNotificationBodyList'].cast<String>();
getTimeCardSummaryList = json['GetTimeCardSummaryList'].cast<String>();
getUserItemTypesList = json['GetUserItemTypesList'].cast<String>();
getVacationRulesList = json['GetVacationRulesList'].cast<String>();
getVaccinationOnHandList = json['GetVaccinationOnHandList'].cast<String>();
getVaccinationsList = json['GetVaccinationsList'].cast<String>();
getValueSetValuesList = json['GetValueSetValuesList'].cast<String>();
getWorkList = json['GetWorkList'].cast<String>();
getAbsenceAttachmentsList = json['GetAbsenceAttachmentsList'];
getAbsenceAttendanceTypesList = json['GetAbsenceAttendanceTypesList'];
getAbsenceCollectionNotificationBodyList = json['GetAbsenceCollectionNotificationBodyList'];
getAbsenceDffStructureList = json['GetAbsenceDffStructureList'];
getAbsenceTransactionList = json['GetAbsenceTransactionList'];
getAccrualBalancesList = json['GetAccrualBalancesList'];
getActionHistoryList = json['GetActionHistoryList'];
getAddressDffStructureList = json['GetAddressDffStructureList'];
getAddressNotificationBodyList = json['GetAddressNotificationBodyList'];
getApprovesList = json['GetApprovesList'];
getAttachementList = json['GetAttachementList'];
getAttendanceTrackingList = json['GetAttendanceTrackingList'];
getBasicDetColsStructureList = json['GetBasicDetColsStructureList'];
getBasicDetDffStructureList = json['GetBasicDetDffStructureList'];
getBasicDetNtfBodyList = json['GetBasicDetNtfBodyList'];
getCEICollectionNotificationBodyList = json['GetCEICollectionNotificationBodyList'];
getCEIDFFStructureList = json['GetCEIDFFStructureList'];
getCEITransactionList = json['GetCEITransactionList'];
getCcpDffStructureList = json['GetCcpDffStructureList'];
getCcpOutputList = json['GetCcpOutputList'];
getCcpTransactionsList = json['GetCcpTransactionsList'];
getCcpTransactionsListNew = json['GetCcpTransactionsList_New'];
getConcurrentProgramsList = json['GetConcurrentProgramsList'];
getContactColsStructureList = json['GetContactColsStructureList'];
getContactDetailsList = json['GetContactDetailsList'];
getContactDffStructureList = json['GetContactDffStructureList'];
getContactNotificationBodyList = json['GetContactNotificationBodyList'];
getCountriesList = json['GetCountriesList'];
getDayHoursTypeDetailsList = json['GetDayHoursTypeDetailsList'];
getDeductionsList = json['GetDeductionsList'];
getDefaultValueList = json['GetDefaultValueList'];
getEITCollectionNotificationBodyList = json['GetEITCollectionNotificationBodyList'];
getEITDFFStructureList = json['GetEITDFFStructureList'];
getEITTransactionList = json['GetEITTransactionList'];
getEarningsList = json['GetEarningsList'];
getEmployeeAddressList = json['GetEmployeeAddressList'];
getEmployeeBasicDetailsList = json['GetEmployeeBasicDetailsList'];
getEmployeeContactsList = json['GetEmployeeContactsList'];
getEmployeePhonesList = json['GetEmployeePhonesList'];
getEmployeeSubordinatesList = json['GetEmployeeSubordinatesList'];
getFliexfieldStructureList = json['GetFliexfieldStructureList'];
getHrCollectionNotificationBodyList = json['GetHrCollectionNotificationBodyList'];
getHrTransactionList = json['GetHrTransactionList'];
getItemCreationNtfBodyList = json['GetItemCreationNtfBodyList'];
getItemTypeNotificationsList = json['GetItemTypeNotificationsList'];
getItemTypesList = json['GetItemTypesList'];
getLookupValuesList = json['GetLookupValuesList'];
getMenuEntriesList = json['GetMenuEntriesList'];
getMoItemHistoryList = json['GetMoItemHistoryList'];
getMoNotificationBodyList = json['GetMoNotificationBodyList'];
getNotificationButtonsList = json['GetNotificationButtonsList'];
getNotificationReassignModeList = json['GetNotificationReassignModeList'];
getObjectValuesList = json['GetObjectValuesList'];
getOpenMissingSwipesList = json['GetOpenMissingSwipesList'];
getOpenNotificationsList = json['GetOpenNotificationsList'];
getOpenNotificationsNumList = json['GetOpenNotificationsNumList'];
getOpenPeriodDatesList = json['GetOpenPeriodDatesList'];
getOrganizationsSalariesList = json['GetOrganizationsSalariesList'];
getPaymentInformationList = json['GetPaymentInformationList'];
getPayslipList = json['GetPayslipList'];
getPendingReqDetailsList = json['GetPendingReqDetailsList'];
getPendingReqFunctionsList = json['GetPendingReqFunctionsList'];
getPerformanceAppraisalList = json['GetPerformanceAppraisalList'];
getPhonesNotificationBodyList = json['GetPhonesNotificationBodyList'];
getPoItemHistoryList = json['GetPoItemHistoryList'];
getPoNotificationBodyList = json['GetPoNotificationBodyList'];
getPrNotificationBodyList = json['GetPrNotificationBodyList'];
getQuotationAnalysisList = json['GetQuotationAnalysisList'];
getRFCEmployeeListList = json['GetRFCEmployeeListList'];
getRespondAttributeValueList = json['GetRespondAttributeValueList'];
getSITCollectionNotificationBodyList = json['GetSITCollectionNotificationBodyList'];
getSITDFFStructureList = json['GetSITDFFStructureList'];
getSITTransactionList = json['GetSITTransactionList'];
getScheduleShiftsDetailsList = json['GetScheduleShiftsDetailsList'];
getShiftTypesList = json['GetShiftTypesList'];
getStampMsNotificationBodyList = json['GetStampMsNotificationBodyList'];
getStampNsNotificationBodyList = json['GetStampNsNotificationBodyList'];
getSubordinatesAttdStatusList = json['GetSubordinatesAttdStatusList'];
getSubordinatesLeavesList = json['GetSubordinatesLeavesList'];
getSubordinatesLeavesTotalVacationsList = json['GetSubordinatesLeavesTotalVacationsList'];
getSummaryOfPaymentList = json['GetSummaryOfPaymentList'];
getSwipesList = json['GetSwipesList'];
getTermColsStructureList = json['GetTermColsStructureList'];
getTermDffStructureList = json['GetTermDffStructureList'];
getTermNotificationBodyList = json['GetTermNotificationBodyList'];
getTimeCardSummaryList = json['GetTimeCardSummaryList'];
getUserItemTypesList = json['GetUserItemTypesList'];
getVacationRulesList = json['GetVacationRulesList'];
getVaccinationOnHandList = json['GetVaccinationOnHandList'];
getVaccinationsList = json['GetVaccinationsList'];
getValueSetValuesList = json['GetValueSetValuesList'];
getWorkList = json['GetWorkList'];
hRCertificateTemplate = json['HRCertificateTemplate'];
imgURLsList = json['ImgURLsList'];
insertApInv = json['InsertApInv'];

@ -0,0 +1,34 @@
class PostParamsModel {
double? versionID;
int? channel;
int? languageID;
String? mobileType;
String? logInTokenID;
String? tokenID;
PostParamsModel({this.versionID, this.channel, this.languageID, this.mobileType, this.logInTokenID, this.tokenID});
PostParamsModel.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
mobileType = json['MobileType'];
logInTokenID = json['LogInTokenID'];
tokenID = json['TokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['MobileType'] = this.mobileType;
data['LogInTokenID'] = this.logInTokenID;
data['TokenID'] = this.tokenID;
return data;
}
set setLogInTokenID(String? token) => logInTokenID = token;
set setTokenID(String? token) => tokenID = token;
}

@ -0,0 +1,114 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/login_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/dialogs/otp_dialog.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/basic_member_information_model.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/input_widget.dart';
class ForgotPasswordScreen extends StatefulWidget {
ForgotPasswordScreen({Key? key}) : super(key: key);
@override
_ForgotPasswordScreenState createState() {
return _ForgotPasswordScreenState();
}
}
class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
TextEditingController employeeId = TextEditingController();
BasicMemberInformationModel? _basicMemberInformation;
GenericResponseModel? genericResponseModel;
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
void performLogin() async {
// Utils.showLoading(context);
try {
_basicMemberInformation = await LoginApiClient().getBasicUserInformation("CS", employeeId.text);
genericResponseModel = await LoginApiClient().sendPublicActivationCode(_basicMemberInformation?.pMOBILENUMBER, employeeId.text);
OtpDialog(
context,
1,
int.tryParse(_basicMemberInformation?.pMOBILENUMBER ?? ""),
(value) async {
GenericResponseModel? genericResponseModel = await LoginApiClient().checkPublicActivationCode(value, employeeId.text);
if (genericResponseModel?.errorMessage != null) {
Utils.showToast(genericResponseModel?.errorMessage ?? "");
return;
}
Navigator.pushNamed(context, AppRoutes.newPassword);
// this.checkActivationCode(value: value);
},
() => {
Navigator.pop(context),
},
).displayDialog(context);
} catch (ex) {
print(ex);
Utils.handleException(ex, null);
// Utils.hideLoading(context);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
onPressed: () => Navigator.pop(context),
),
),
body: Column(
children: [
//const SizedBox(height: 23),
Expanded(
child: Padding(
padding: const EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
LocaleKeys.forgotPassword.tr().toText24(isBold: true),
LocaleKeys.loginCodeWillSentToMobileNumber.tr().toText16(),
16.height,
InputWidget(LocaleKeys.employeeId.tr(), "123456", employeeId),
],
),
)
],
),
),
),
DefaultButton(LocaleKeys.changePassword.tr(), () async {
//Navigator.pushNamed(context, AppRoutes.verifyLogin);
})
.insideContainer
],
),
);
}
}

@ -2,12 +2,18 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:mohem_flutter_app/api/login_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/check_mobile_app_version_model.dart';
import 'package:mohem_flutter_app/models/member_login_list_model.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/input_widget.dart';
@ -24,6 +30,9 @@ class _LoginScreenState extends State<LoginScreen> {
TextEditingController username = TextEditingController();
TextEditingController password = TextEditingController();
CheckMobileAppVersionModel? _checkMobileAppVersion;
MemberLoginListModel? _memberLoginList;
@override
void initState() {
super.initState();
@ -34,6 +43,23 @@ class _LoginScreenState extends State<LoginScreen> {
super.dispose();
}
void performLogin() async {
// Utils.showLoading(context);
try {
_checkMobileAppVersion = await LoginApiClient().checkMobileAppVersion();
_memberLoginList = await LoginApiClient().memberLogin(username.text, password.text);
AppState().setMemberLoginListModel = _memberLoginList;
AppState().username = username.text;
print(_memberLoginList?.toJson());
// Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.verifyLogin);
} catch (ex) {
print(ex);
Utils.handleException(ex, null);
// Utils.hideLoading(context);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -51,14 +77,18 @@ class _LoginScreenState extends State<LoginScreen> {
Expanded(child: SizedBox()),
Row(
children: [
LocaleKeys.english.tr().toText14(color: MyColors.textMixColor).onPress(() {}),
LocaleKeys.english.tr().toText14(color: MyColors.textMixColor).onPress(() {
context.setLocale(const Locale("en", "US"));
}),
Container(
width: 1,
color: MyColors.darkWhiteColor,
height: 16,
margin: const EdgeInsets.only(left: 10, right: 10),
),
LocaleKeys.arabic.tr().toText14().onPress(() {}),
LocaleKeys.arabic.tr().toText14().onPress(() {
context.setLocale(const Locale("ar", "SA"));
}),
],
),
],
@ -79,7 +109,7 @@ class _LoginScreenState extends State<LoginScreen> {
Align(
alignment: Alignment.centerRight,
child: LocaleKeys.forgotPassword.tr().toText12(isUnderLine: true, color: MyColors.textMixColor).onPress(() {
Navigator.pushNamed(context, AppRoutes.newPassword);
Navigator.pushNamed(context, AppRoutes.forgotPassword);
}),
),
],
@ -92,7 +122,8 @@ class _LoginScreenState extends State<LoginScreen> {
DefaultButton(LocaleKeys.login.tr(), () async {
// context.setLocale(const Locale("en", "US")); // to change Loacle
Navigator.pushNamed(context, AppRoutes.verifyLogin);
SystemChannels.textInput.invokeMethod('TextInput.hide');
performLogin();
}).insideContainer
],
),

@ -88,9 +88,8 @@ class _NewPasswordScreenState extends State<NewPasswordScreen> {
),
),
DefaultButton(LocaleKeys.update.tr(), () async {
// context.setLocale(const Locale("en", "US")); // to change Loacle
Navigator.pushNamed(context, AppRoutes.verifyLogin);
// Navigator.pushNamed(context, AppRoutes.verifyLogin);
}).insideContainer
],
),

@ -3,13 +3,18 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:local_auth/local_auth.dart';
import 'package:mohem_flutter_app/api/login_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/dialogs/otp_dialog.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/basic_member_information_model.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
class VerifyLoginScreen extends StatefulWidget {
@ -613,19 +618,26 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
return InkWell(
onTap: isDisable
? null
: () {
: () async {
if (_flag == 0) {
setState(() {
// isMoreOption = true;
});
} else {
BasicMemberInformationModel? memberInformationModel = await LoginApiClient()
.mohemmSendActivationCodeByOTPNotificationType(checkBiometricIsAvailable(BiometricType.fingerprint) ? 1 : 0, AppState().memberLoginList?.pMOBILENUMBER, _flag, AppState().username);
OtpDialog(
context,
_flag,
//this.mobileNumber
0554870506,
(value) {
Navigator.pushReplacementNamed(context, AppRoutes.dashboard);
int.tryParse(AppState().memberLoginList?.pMOBILENUMBER ?? ""),
(value) async {
GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(false, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().username);
if (genericResponseModel?.errorMessage != null) {
Utils.showToast(genericResponseModel?.errorMessage ?? "");
// Navigator.pop(context);
}
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.dashboard, (Route<dynamic> route) => false);
// this.checkActivationCode(value: value);
},
() => {

Loading…
Cancel
Save