Merge branch 'master' into development_mirza

merge-requests/1/merge
devmirza121 3 years ago
commit a109a0529f

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

@ -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",

@ -25,11 +25,19 @@ class APIError {
APIException _throwAPIException(Response response) {
switch (response.statusCode) {
case 200:
APIError? apiError;
if (response.body != null && response.body.isNotEmpty) {
var jsonError = jsonDecode(response.body);
print(jsonError);
apiError = APIError(jsonError['ErrorCode'], jsonError['ErrorMessage']);
}
return APIException(APIException.BAD_REQUEST, error: apiError);
case 400:
APIError? apiError;
if (response.body != null && response.body.isNotEmpty) {
var jsonError = jsonDecode(response.body);
apiError = APIError(jsonError['errorCode'], jsonError['errorMessage']);
apiError = APIError(jsonError['ErrorCode'], jsonError['ErrorMessage']);
}
return APIException(APIException.BAD_REQUEST, error: apiError);
case 401:
@ -66,12 +74,18 @@ class ApiClient {
print("body:$jsonObject");
}
var response = await postJsonForResponse(url, jsonObject, token: token, queryParameters: queryParameters, headers: _headers, retryTimes: retryTimes);
try {
// try {
var jsonData = jsonDecode(response.body);
return factoryConstructor(jsonData);
} catch (ex) {
throw APIException(APIException.BAD_RESPONSE_FORMAT, arguments: ex);
}
if (jsonData["ErrorMessage"] != null) {
return factoryConstructor(jsonData);
} else {
throw _throwAPIException(response);
}
// } catch (ex) {
// print(response.body);
// print(ex);
// throw APIException(APIException.BAD_RESPONSE_FORMAT, arguments: ex);
// }
}
Future<Response> postJsonForResponse<T>(String url, T jsonObject, {String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0}) async {
@ -103,7 +117,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;

@ -0,0 +1,94 @@
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 'api_client.dart';
class LoginApiClient {
static final LoginApiClient _instance = LoginApiClient._internal();
LoginApiClient._internal();
factory LoginApiClient() => _instance;
Future<CheckMobileAppVersionModel> checkMobileAppVersion() async {
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(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<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);
}
}

@ -2,7 +2,7 @@ import 'dart:async';
import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/models/content_info_model.dart';
import 'package:mohem_flutter_app/models/member_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';
@ -14,21 +14,21 @@ class TangheemUserApiClient {
factory TangheemUserApiClient() => _instance;
Future<SurahModel> getSurahs() async {
String url = "${ApiConsts.tangheemUsers}AlSuar_Get";
var postParams = {};
return await ApiClient().postJsonForObject((json) => SurahModel.fromJson(json), url, postParams);
}
Future<MemberModel> getMembers() async {
String url = "${ApiConsts.tangheemUsers}Committee_Get";
var postParams = {};
return await ApiClient().postJsonForObject((json) => MemberModel.fromJson(json), url, postParams);
}
Future<ContentInfoModel> getContentInfo(int contentId) async {
String url = "${ApiConsts.tangheemUsers}ContentInfo_Get";
var postParams = {"contentTypeId": contentId};
return await ApiClient().postJsonForObject((json) => ContentInfoModel.fromJson(json), url, postParams);
}
// Future<SurahModel> getSurahs() async {
// String url = "${ApiConsts.tangheemUsers}AlSuar_Get";
// var postParams = {};
// return await ApiClient().postJsonForObject((json) => SurahModel.fromJson(json), url, postParams);
// }
//
// Future<MemberModel> getMembers() async {
// String url = "${ApiConsts.tangheemUsers}Committee_Get";
// var postParams = {};
// return await ApiClient().postJsonForObject((json) => MemberModel.fromJson(json), url, postParams);
// }
//
// Future<ContentInfoModel> getContentInfo(int contentId) async {
// String url = "${ApiConsts.tangheemUsers}ContentInfo_Get";
// var postParams = {"contentTypeId": contentId};
// return await ApiClient().postJsonForObject((json) => ContentInfoModel.fromJson(json), 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;
}

@ -1,11 +1,10 @@
class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server
static String baseUrl = "http://20.203.25.82"; // production server
static String baseUrlServices = baseUrl + "/services/"; // production server
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 authentication = baseUrlServices + "api/Authentication/";
static String tangheemUsers = baseUrlServices + "api/TangheemUsers/";
static String adminConfiguration = baseUrlServices + "api/AdminConfiguration/";
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";
static String erpRest = baseUrlServices + "ERP.svc/REST/";
static String user = baseUrlServices + "api/User/";
}

@ -1,7 +1,9 @@
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
// import 'package:fluttertoast/fluttertoast.dart';
import 'package:mohem_flutter_app/exceptions/api_exception.dart';
import 'package:mohem_flutter_app/widgets/loading_dialog.dart';
class Utils {
static bool _isLoadingVisible = false;
@ -9,8 +11,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) {
@ -32,13 +34,13 @@ class Utils {
static void showLoading(BuildContext context) {
WidgetsBinding.instance?.addPostFrameCallback((_) {
_isLoadingVisible = true;
// showDialog(
// context: context,
// barrierColor: ColorConsts.primaryBlack.withOpacity(0.5),
// builder: (BuildContext context) => LoadingDialog(),
// ).then((value) {
// _isLoadingVisible = false;
// });
showDialog(
context: context,
barrierColor: Colors.black.withOpacity(0.5),
builder: (BuildContext context) => LoadingDialog(),
).then((value) {
_isLoadingVisible = false;
});
});
}

@ -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,

@ -0,0 +1,32 @@
class BasicMemberInformationModel {
String? pEMAILADDRESS;
String? pLEGISLATIONCODE;
String? pMOBILENUMBER;
String? pRETURNMSG;
String? pRETURNSTATUS;
BasicMemberInformationModel(
{this.pEMAILADDRESS,
this.pLEGISLATIONCODE,
this.pMOBILENUMBER,
this.pRETURNMSG,
this.pRETURNSTATUS});
BasicMemberInformationModel.fromJson(Map<String, dynamic> json) {
pEMAILADDRESS = json['P_EMAIL_ADDRESS'];
pLEGISLATIONCODE = json['P_LEGISLATION_CODE'];
pMOBILENUMBER = json['P_MOBILE_NUMBER'];
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_EMAIL_ADDRESS'] = this.pEMAILADDRESS;
data['P_LEGISLATION_CODE'] = this.pLEGISLATIONCODE;
data['P_MOBILE_NUMBER'] = this.pMOBILENUMBER;
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
return data;
}
}

@ -0,0 +1,191 @@
class CheckMobileAppVersionModel {
String? date;
int? languageID;
int? serviceName;
String? time;
String? androidLink;
String? authenticationTokenID;
String? data;
bool? dataw;
int? dietType;
int? dietTypeID;
int? errorCode;
String? errorEndUserMessage;
String? errorEndUserMessageN;
String? errorMessage;
int? errorType;
int? foodCategory;
String? iOSLink;
bool? isAuthenticated;
int? mealOrderStatus;
int? mealType;
int? messageStatus;
int? numberOfResultRecords;
String? patientBlodType;
String? successMsg;
String? successMsgN;
String? vidaUpdatedResponse;
String? encryprURL;
bool? kioskHelp;
List<Null>? listRssItems;
List<Null>? listKioskFingerPrint;
List<Null>? listKioskFingerPrintGetByID;
List<Null>? listKioskGetLastTransaction;
List<Null>? listRegKioskFingerPrint;
String? message;
String? ramadanTimeObj;
String? habibTwitterList;
CheckMobileAppVersionModel(
{this.date,
this.languageID,
this.serviceName,
this.time,
this.androidLink,
this.authenticationTokenID,
this.data,
this.dataw,
this.dietType,
this.dietTypeID,
this.errorCode,
this.errorEndUserMessage,
this.errorEndUserMessageN,
this.errorMessage,
this.errorType,
this.foodCategory,
this.iOSLink,
this.isAuthenticated,
this.mealOrderStatus,
this.mealType,
this.messageStatus,
this.numberOfResultRecords,
this.patientBlodType,
this.successMsg,
this.successMsgN,
this.vidaUpdatedResponse,
this.encryprURL,
this.kioskHelp,
this.listRssItems,
this.listKioskFingerPrint,
this.listKioskFingerPrintGetByID,
this.listKioskGetLastTransaction,
this.listRegKioskFingerPrint,
this.message,
this.ramadanTimeObj,
this.habibTwitterList});
CheckMobileAppVersionModel.fromJson(Map<String, dynamic> json) {
date = json['Date'];
languageID = json['LanguageID'];
serviceName = json['ServiceName'];
time = json['Time'];
androidLink = json['AndroidLink'];
authenticationTokenID = json['AuthenticationTokenID'];
data = json['Data'];
dataw = json['Dataw'];
dietType = json['DietType'];
dietTypeID = json['DietTypeID'];
errorCode = json['ErrorCode'];
errorEndUserMessage = json['ErrorEndUserMessage'];
errorEndUserMessageN = json['ErrorEndUserMessageN'];
errorMessage = json['ErrorMessage'];
errorType = json['ErrorType'];
foodCategory = json['FoodCategory'];
iOSLink = json['IOSLink'];
isAuthenticated = json['IsAuthenticated'];
mealOrderStatus = json['MealOrderStatus'];
mealType = json['MealType'];
messageStatus = json['MessageStatus'];
numberOfResultRecords = json['NumberOfResultRecords'];
patientBlodType = json['PatientBlodType'];
successMsg = json['SuccessMsg'];
successMsgN = json['SuccessMsgN'];
vidaUpdatedResponse = json['VidaUpdatedResponse'];
encryprURL = json['EncryprURL'];
kioskHelp = json['KioskHelp'];
if (json['ListRssItems'] != null) {
listRssItems = <Null>[];
json['ListRssItems'].forEach((v) {
//listRssItems!.add(new Null.fromJson(v));
});
}
if (json['List_Kiosk_FingerPrint'] != null) {
listKioskFingerPrint = <Null>[];
json['List_Kiosk_FingerPrint'].forEach((v) {
// listKioskFingerPrint!.add(new Null.fromJson(v));
});
}
if (json['List_Kiosk_FingerPrintGetByID'] != null) {
listKioskFingerPrintGetByID = <Null>[];
json['List_Kiosk_FingerPrintGetByID'].forEach((v) {
// listKioskFingerPrintGetByID!.add(new Null.fromJson(v));
});
}
if (json['List_Kiosk_GetLastTransaction'] != null) {
listKioskGetLastTransaction = <Null>[];
json['List_Kiosk_GetLastTransaction'].forEach((v) {
// listKioskGetLastTransaction!.add(new Null.fromJson(v));
});
}
if (json['List_RegKiosk_FingerPrint'] != null) {
listRegKioskFingerPrint = <Null>[];
json['List_RegKiosk_FingerPrint'].forEach((v) {
// listRegKioskFingerPrint!.add(new Null.fromJson(v));
});
}
message = json['Message'];
ramadanTimeObj = json['RamadanTimeObj'];
habibTwitterList = json['habibTwitterList'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Date'] = this.date;
data['LanguageID'] = this.languageID;
data['ServiceName'] = this.serviceName;
data['Time'] = this.time;
data['AndroidLink'] = this.androidLink;
data['AuthenticationTokenID'] = this.authenticationTokenID;
data['Data'] = this.data;
data['Dataw'] = this.dataw;
data['DietType'] = this.dietType;
data['DietTypeID'] = this.dietTypeID;
data['ErrorCode'] = this.errorCode;
data['ErrorEndUserMessage'] = this.errorEndUserMessage;
data['ErrorEndUserMessageN'] = this.errorEndUserMessageN;
data['ErrorMessage'] = this.errorMessage;
data['ErrorType'] = this.errorType;
data['FoodCategory'] = this.foodCategory;
data['IOSLink'] = this.iOSLink;
data['IsAuthenticated'] = this.isAuthenticated;
data['MealOrderStatus'] = this.mealOrderStatus;
data['MealType'] = this.mealType;
data['MessageStatus'] = this.messageStatus;
data['NumberOfResultRecords'] = this.numberOfResultRecords;
data['PatientBlodType'] = this.patientBlodType;
data['SuccessMsg'] = this.successMsg;
data['SuccessMsgN'] = this.successMsgN;
data['VidaUpdatedResponse'] = this.vidaUpdatedResponse;
data['EncryprURL'] = this.encryprURL;
data['KioskHelp'] = this.kioskHelp;
if (this.listRssItems != null) {
//data['ListRssItems'] = this.listRssItems!.map((v) => v.toJson()).toList();
}
if (this.listKioskFingerPrint != null) {
// data['List_Kiosk_FingerPrint'] = this.listKioskFingerPrint!.map((v) => v.toJson()).toList();
}
if (this.listKioskFingerPrintGetByID != null) {
//data['List_Kiosk_FingerPrintGetByID'] = this.listKioskFingerPrintGetByID!.map((v) => v.toJson()).toList();
}
if (this.listKioskGetLastTransaction != null) {
//data['List_Kiosk_GetLastTransaction'] = this.listKioskGetLastTransaction!.map((v) => v.toJson()).toList();
}
if (this.listRegKioskFingerPrint != null) {
//data['List_RegKiosk_FingerPrint'] = this.listRegKioskFingerPrint!.map((v) => v.toJson()).toList();
}
data['Message'] = this.message;
data['RamadanTimeObj'] = this.ramadanTimeObj;
data['habibTwitterList'] = this.habibTwitterList;
return data;
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,336 @@
class MemberInformationListModel {
String? aCTUALTERMINATIONDATE;
String? aSSIGNMENTENDDATE;
int? aSSIGNMENTID;
String? aSSIGNMENTNUMBER;
String? aSSIGNMENTSTARTDATE;
int? aSSIGNMENTSTATUSTYPEID;
String? aSSIGNMENTTYPE;
int? bUSINESSGROUPID;
String? bUSINESSGROUPNAME;
String? businessCardQR;
String? cURRENTEMPLOYEEFLAG;
String? eMPLOYEEDISPLAYNAME;
String? eMPLOYEEDISPLAYNAMEAr;
String? eMPLOYEEDISPLAYNAMEEn;
String? eMPLOYEEEMAILADDRESS;
String? eMPLOYEEIMAGE;
String? eMPLOYEEMOBILENUMBER;
String? eMPLOYEENAME;
String? eMPLOYEENAMEAr;
String? eMPLOYEENAMEEn;
String? eMPLOYEENUMBER;
String? eMPLOYEEWORKNUMBER;
String? eMPLOYMENTCATEGORY;
String? eMPLOYMENTCATEGORYMEANING;
String? employeeQR;
String? fREQUENCY;
String? fREQUENCYMEANING;
int? fROMROWNUM;
String? gRADEID;
String? gRADENAME;
String? hIREDATE;
int? jOBID;
String? jOBNAME;
String? jOBNAMEAr;
String? jOBNAMEEn;
int? lEDGERID;
int? lOCATIONID;
String? lOCATIONNAME;
String? mANUALTIMECARDFLAG;
String? mANUALTIMECARDMEANING;
String? mobileNumberWithZipCode;
String? nATIONALITYCODE;
String? nATIONALITYMEANING;
String? nATIONALIDENTIFIER;
String? nORMALHOURS;
int? nOOFROWS;
int? oRGANIZATIONID;
String? oRGANIZATIONNAME;
String? pAYROLLCODE;
int? pAYROLLID;
String? pAYROLLNAME;
int? pERSONID;
String? pERSONTYPE;
int? pERSONTYPEID;
String? pERINFORMATIONCATEGORY;
int? pOSITIONID;
String? pOSITIONNAME;
String? pRIMARYFLAG;
int? rOWNUM;
int? sERVICEDAYS;
int? sERVICEMONTHS;
int? sERVICEYEARS;
String? sUPERVISORASSIGNMENTID;
String? sUPERVISORDISPLAYNAME;
String? sUPERVISOREMAILADDRESS;
int? sUPERVISORID;
String? sUPERVISORMOBILENUMBER;
String? sUPERVISORNAME;
String? sUPERVISORNUMBER;
String? sUPERVISORWORKNUMBER;
String? sWIPESEXEMPTEDFLAG;
String? sWIPESEXEMPTEDMEANING;
String? sYSTEMPERSONTYPE;
String? tKEMAILADDRESS;
String? tKEMPLOYEEDISPLAYNAME;
String? tKEMPLOYEENAME;
String? tKEMPLOYEENUMBER;
int? tKPERSONID;
int? tOROWNUM;
String? uNITNUMBER;
String? uSERSTATUS;
MemberInformationListModel(
{this.aCTUALTERMINATIONDATE,
this.aSSIGNMENTENDDATE,
this.aSSIGNMENTID,
this.aSSIGNMENTNUMBER,
this.aSSIGNMENTSTARTDATE,
this.aSSIGNMENTSTATUSTYPEID,
this.aSSIGNMENTTYPE,
this.bUSINESSGROUPID,
this.bUSINESSGROUPNAME,
this.businessCardQR,
this.cURRENTEMPLOYEEFLAG,
this.eMPLOYEEDISPLAYNAME,
this.eMPLOYEEDISPLAYNAMEAr,
this.eMPLOYEEDISPLAYNAMEEn,
this.eMPLOYEEEMAILADDRESS,
this.eMPLOYEEIMAGE,
this.eMPLOYEEMOBILENUMBER,
this.eMPLOYEENAME,
this.eMPLOYEENAMEAr,
this.eMPLOYEENAMEEn,
this.eMPLOYEENUMBER,
this.eMPLOYEEWORKNUMBER,
this.eMPLOYMENTCATEGORY,
this.eMPLOYMENTCATEGORYMEANING,
this.employeeQR,
this.fREQUENCY,
this.fREQUENCYMEANING,
this.fROMROWNUM,
this.gRADEID,
this.gRADENAME,
this.hIREDATE,
this.jOBID,
this.jOBNAME,
this.jOBNAMEAr,
this.jOBNAMEEn,
this.lEDGERID,
this.lOCATIONID,
this.lOCATIONNAME,
this.mANUALTIMECARDFLAG,
this.mANUALTIMECARDMEANING,
this.mobileNumberWithZipCode,
this.nATIONALITYCODE,
this.nATIONALITYMEANING,
this.nATIONALIDENTIFIER,
this.nORMALHOURS,
this.nOOFROWS,
this.oRGANIZATIONID,
this.oRGANIZATIONNAME,
this.pAYROLLCODE,
this.pAYROLLID,
this.pAYROLLNAME,
this.pERSONID,
this.pERSONTYPE,
this.pERSONTYPEID,
this.pERINFORMATIONCATEGORY,
this.pOSITIONID,
this.pOSITIONNAME,
this.pRIMARYFLAG,
this.rOWNUM,
this.sERVICEDAYS,
this.sERVICEMONTHS,
this.sERVICEYEARS,
this.sUPERVISORASSIGNMENTID,
this.sUPERVISORDISPLAYNAME,
this.sUPERVISOREMAILADDRESS,
this.sUPERVISORID,
this.sUPERVISORMOBILENUMBER,
this.sUPERVISORNAME,
this.sUPERVISORNUMBER,
this.sUPERVISORWORKNUMBER,
this.sWIPESEXEMPTEDFLAG,
this.sWIPESEXEMPTEDMEANING,
this.sYSTEMPERSONTYPE,
this.tKEMAILADDRESS,
this.tKEMPLOYEEDISPLAYNAME,
this.tKEMPLOYEENAME,
this.tKEMPLOYEENUMBER,
this.tKPERSONID,
this.tOROWNUM,
this.uNITNUMBER,
this.uSERSTATUS});
MemberInformationListModel.fromJson(Map<String, dynamic> json) {
aCTUALTERMINATIONDATE = json['ACTUAL_TERMINATION_DATE'];
aSSIGNMENTENDDATE = json['ASSIGNMENT_END_DATE'];
aSSIGNMENTID = json['ASSIGNMENT_ID'];
aSSIGNMENTNUMBER = json['ASSIGNMENT_NUMBER'];
aSSIGNMENTSTARTDATE = json['ASSIGNMENT_START_DATE'];
aSSIGNMENTSTATUSTYPEID = json['ASSIGNMENT_STATUS_TYPE_ID'];
aSSIGNMENTTYPE = json['ASSIGNMENT_TYPE'];
bUSINESSGROUPID = json['BUSINESS_GROUP_ID'];
bUSINESSGROUPNAME = json['BUSINESS_GROUP_NAME'];
businessCardQR = json['BusinessCardQR'];
cURRENTEMPLOYEEFLAG = json['CURRENT_EMPLOYEE_FLAG'];
eMPLOYEEDISPLAYNAME = json['EMPLOYEE_DISPLAY_NAME'];
eMPLOYEEDISPLAYNAMEAr = json['EMPLOYEE_DISPLAY_NAME_Ar'];
eMPLOYEEDISPLAYNAMEEn = json['EMPLOYEE_DISPLAY_NAME_En'];
eMPLOYEEEMAILADDRESS = json['EMPLOYEE_EMAIL_ADDRESS'];
eMPLOYEEIMAGE = json['EMPLOYEE_IMAGE'];
eMPLOYEEMOBILENUMBER = json['EMPLOYEE_MOBILE_NUMBER'];
eMPLOYEENAME = json['EMPLOYEE_NAME'];
eMPLOYEENAMEAr = json['EMPLOYEE_NAME_Ar'];
eMPLOYEENAMEEn = json['EMPLOYEE_NAME_En'];
eMPLOYEENUMBER = json['EMPLOYEE_NUMBER'];
eMPLOYEEWORKNUMBER = json['EMPLOYEE_WORK_NUMBER'];
eMPLOYMENTCATEGORY = json['EMPLOYMENT_CATEGORY'];
eMPLOYMENTCATEGORYMEANING = json['EMPLOYMENT_CATEGORY_MEANING'];
employeeQR = json['EmployeeQR'];
fREQUENCY = json['FREQUENCY'];
fREQUENCYMEANING = json['FREQUENCY_MEANING'];
fROMROWNUM = json['FROM_ROW_NUM'];
gRADEID = json['GRADE_ID'];
gRADENAME = json['GRADE_NAME'];
hIREDATE = json['HIRE_DATE'];
jOBID = json['JOB_ID'];
jOBNAME = json['JOB_NAME'];
jOBNAMEAr = json['JOB_NAME_Ar'];
jOBNAMEEn = json['JOB_NAME_En'];
lEDGERID = json['LEDGER_ID'];
lOCATIONID = json['LOCATION_ID'];
lOCATIONNAME = json['LOCATION_NAME'];
mANUALTIMECARDFLAG = json['MANUAL_TIMECARD_FLAG'];
mANUALTIMECARDMEANING = json['MANUAL_TIMECARD_MEANING'];
mobileNumberWithZipCode = json['MobileNumberWithZipCode'];
nATIONALITYCODE = json['NATIONALITY_CODE'];
nATIONALITYMEANING = json['NATIONALITY_MEANING'];
nATIONALIDENTIFIER = json['NATIONAL_IDENTIFIER'];
nORMALHOURS = json['NORMAL_HOURS'];
nOOFROWS = json['NO_OF_ROWS'];
oRGANIZATIONID = json['ORGANIZATION_ID'];
oRGANIZATIONNAME = json['ORGANIZATION_NAME'];
pAYROLLCODE = json['PAYROLL_CODE'];
pAYROLLID = json['PAYROLL_ID'];
pAYROLLNAME = json['PAYROLL_NAME'];
pERSONID = json['PERSON_ID'];
pERSONTYPE = json['PERSON_TYPE'];
pERSONTYPEID = json['PERSON_TYPE_ID'];
pERINFORMATIONCATEGORY = json['PER_INFORMATION_CATEGORY'];
pOSITIONID = json['POSITION_ID'];
pOSITIONNAME = json['POSITION_NAME'];
pRIMARYFLAG = json['PRIMARY_FLAG'];
rOWNUM = json['ROW_NUM'];
sERVICEDAYS = json['SERVICE_DAYS'];
sERVICEMONTHS = json['SERVICE_MONTHS'];
sERVICEYEARS = json['SERVICE_YEARS'];
sUPERVISORASSIGNMENTID = json['SUPERVISOR_ASSIGNMENT_ID'];
sUPERVISORDISPLAYNAME = json['SUPERVISOR_DISPLAY_NAME'];
sUPERVISOREMAILADDRESS = json['SUPERVISOR_EMAIL_ADDRESS'];
sUPERVISORID = json['SUPERVISOR_ID'];
sUPERVISORMOBILENUMBER = json['SUPERVISOR_MOBILE_NUMBER'];
sUPERVISORNAME = json['SUPERVISOR_NAME'];
sUPERVISORNUMBER = json['SUPERVISOR_NUMBER'];
sUPERVISORWORKNUMBER = json['SUPERVISOR_WORK_NUMBER'];
sWIPESEXEMPTEDFLAG = json['SWIPES_EXEMPTED_FLAG'];
sWIPESEXEMPTEDMEANING = json['SWIPES_EXEMPTED_MEANING'];
sYSTEMPERSONTYPE = json['SYSTEM_PERSON_TYPE'];
tKEMAILADDRESS = json['TK_EMAIL_ADDRESS'];
tKEMPLOYEEDISPLAYNAME = json['TK_EMPLOYEE_DISPLAY_NAME'];
tKEMPLOYEENAME = json['TK_EMPLOYEE_NAME'];
tKEMPLOYEENUMBER = json['TK_EMPLOYEE_NUMBER'];
tKPERSONID = json['TK_PERSON_ID'];
tOROWNUM = json['TO_ROW_NUM'];
uNITNUMBER = json['UNIT_NUMBER'];
uSERSTATUS = json['USER_STATUS'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ACTUAL_TERMINATION_DATE'] = this.aCTUALTERMINATIONDATE;
data['ASSIGNMENT_END_DATE'] = this.aSSIGNMENTENDDATE;
data['ASSIGNMENT_ID'] = this.aSSIGNMENTID;
data['ASSIGNMENT_NUMBER'] = this.aSSIGNMENTNUMBER;
data['ASSIGNMENT_START_DATE'] = this.aSSIGNMENTSTARTDATE;
data['ASSIGNMENT_STATUS_TYPE_ID'] = this.aSSIGNMENTSTATUSTYPEID;
data['ASSIGNMENT_TYPE'] = this.aSSIGNMENTTYPE;
data['BUSINESS_GROUP_ID'] = this.bUSINESSGROUPID;
data['BUSINESS_GROUP_NAME'] = this.bUSINESSGROUPNAME;
data['BusinessCardQR'] = this.businessCardQR;
data['CURRENT_EMPLOYEE_FLAG'] = this.cURRENTEMPLOYEEFLAG;
data['EMPLOYEE_DISPLAY_NAME'] = this.eMPLOYEEDISPLAYNAME;
data['EMPLOYEE_DISPLAY_NAME_Ar'] = this.eMPLOYEEDISPLAYNAMEAr;
data['EMPLOYEE_DISPLAY_NAME_En'] = this.eMPLOYEEDISPLAYNAMEEn;
data['EMPLOYEE_EMAIL_ADDRESS'] = this.eMPLOYEEEMAILADDRESS;
data['EMPLOYEE_IMAGE'] = this.eMPLOYEEIMAGE;
data['EMPLOYEE_MOBILE_NUMBER'] = this.eMPLOYEEMOBILENUMBER;
data['EMPLOYEE_NAME'] = this.eMPLOYEENAME;
data['EMPLOYEE_NAME_Ar'] = this.eMPLOYEENAMEAr;
data['EMPLOYEE_NAME_En'] = this.eMPLOYEENAMEEn;
data['EMPLOYEE_NUMBER'] = this.eMPLOYEENUMBER;
data['EMPLOYEE_WORK_NUMBER'] = this.eMPLOYEEWORKNUMBER;
data['EMPLOYMENT_CATEGORY'] = this.eMPLOYMENTCATEGORY;
data['EMPLOYMENT_CATEGORY_MEANING'] = this.eMPLOYMENTCATEGORYMEANING;
data['EmployeeQR'] = this.employeeQR;
data['FREQUENCY'] = this.fREQUENCY;
data['FREQUENCY_MEANING'] = this.fREQUENCYMEANING;
data['FROM_ROW_NUM'] = this.fROMROWNUM;
data['GRADE_ID'] = this.gRADEID;
data['GRADE_NAME'] = this.gRADENAME;
data['HIRE_DATE'] = this.hIREDATE;
data['JOB_ID'] = this.jOBID;
data['JOB_NAME'] = this.jOBNAME;
data['JOB_NAME_Ar'] = this.jOBNAMEAr;
data['JOB_NAME_En'] = this.jOBNAMEEn;
data['LEDGER_ID'] = this.lEDGERID;
data['LOCATION_ID'] = this.lOCATIONID;
data['LOCATION_NAME'] = this.lOCATIONNAME;
data['MANUAL_TIMECARD_FLAG'] = this.mANUALTIMECARDFLAG;
data['MANUAL_TIMECARD_MEANING'] = this.mANUALTIMECARDMEANING;
data['MobileNumberWithZipCode'] = this.mobileNumberWithZipCode;
data['NATIONALITY_CODE'] = this.nATIONALITYCODE;
data['NATIONALITY_MEANING'] = this.nATIONALITYMEANING;
data['NATIONAL_IDENTIFIER'] = this.nATIONALIDENTIFIER;
data['NORMAL_HOURS'] = this.nORMALHOURS;
data['NO_OF_ROWS'] = this.nOOFROWS;
data['ORGANIZATION_ID'] = this.oRGANIZATIONID;
data['ORGANIZATION_NAME'] = this.oRGANIZATIONNAME;
data['PAYROLL_CODE'] = this.pAYROLLCODE;
data['PAYROLL_ID'] = this.pAYROLLID;
data['PAYROLL_NAME'] = this.pAYROLLNAME;
data['PERSON_ID'] = this.pERSONID;
data['PERSON_TYPE'] = this.pERSONTYPE;
data['PERSON_TYPE_ID'] = this.pERSONTYPEID;
data['PER_INFORMATION_CATEGORY'] = this.pERINFORMATIONCATEGORY;
data['POSITION_ID'] = this.pOSITIONID;
data['POSITION_NAME'] = this.pOSITIONNAME;
data['PRIMARY_FLAG'] = this.pRIMARYFLAG;
data['ROW_NUM'] = this.rOWNUM;
data['SERVICE_DAYS'] = this.sERVICEDAYS;
data['SERVICE_MONTHS'] = this.sERVICEMONTHS;
data['SERVICE_YEARS'] = this.sERVICEYEARS;
data['SUPERVISOR_ASSIGNMENT_ID'] = this.sUPERVISORASSIGNMENTID;
data['SUPERVISOR_DISPLAY_NAME'] = this.sUPERVISORDISPLAYNAME;
data['SUPERVISOR_EMAIL_ADDRESS'] = this.sUPERVISOREMAILADDRESS;
data['SUPERVISOR_ID'] = this.sUPERVISORID;
data['SUPERVISOR_MOBILE_NUMBER'] = this.sUPERVISORMOBILENUMBER;
data['SUPERVISOR_NAME'] = this.sUPERVISORNAME;
data['SUPERVISOR_NUMBER'] = this.sUPERVISORNUMBER;
data['SUPERVISOR_WORK_NUMBER'] = this.sUPERVISORWORKNUMBER;
data['SWIPES_EXEMPTED_FLAG'] = this.sWIPESEXEMPTEDFLAG;
data['SWIPES_EXEMPTED_MEANING'] = this.sWIPESEXEMPTEDMEANING;
data['SYSTEM_PERSON_TYPE'] = this.sYSTEMPERSONTYPE;
data['TK_EMAIL_ADDRESS'] = this.tKEMAILADDRESS;
data['TK_EMPLOYEE_DISPLAY_NAME'] = this.tKEMPLOYEEDISPLAYNAME;
data['TK_EMPLOYEE_NAME'] = this.tKEMPLOYEENAME;
data['TK_EMPLOYEE_NUMBER'] = this.tKEMPLOYEENUMBER;
data['TK_PERSON_ID'] = this.tKPERSONID;
data['TO_ROW_NUM'] = this.tOROWNUM;
data['UNIT_NUMBER'] = this.uNITNUMBER;
data['USER_STATUS'] = this.uSERSTATUS;
return data;
}
}

@ -0,0 +1,48 @@
class MemberLoginListModel {
String? pEMAILADDRESS;
String? pINVALIDLOGINMSG;
String? pLEGISLATIONCODE;
String? pMOBILENUMBER;
String? pPASSOWRDEXPIRED;
String? pPASSWORDEXPIREDMSG;
String? pRETURNMSG;
String? pRETURNSTATUS;
int? pSESSIONID;
MemberLoginListModel(
{this.pEMAILADDRESS,
this.pINVALIDLOGINMSG,
this.pLEGISLATIONCODE,
this.pMOBILENUMBER,
this.pPASSOWRDEXPIRED,
this.pPASSWORDEXPIREDMSG,
this.pRETURNMSG,
this.pRETURNSTATUS,
this.pSESSIONID});
MemberLoginListModel.fromJson(Map<String, dynamic> json) {
pEMAILADDRESS = json['P_EMAIL_ADDRESS'];
pINVALIDLOGINMSG = json['P_INVALID_LOGIN_MSG'];
pLEGISLATIONCODE = json['P_LEGISLATION_CODE'];
pMOBILENUMBER = json['P_MOBILE_NUMBER'];
pPASSOWRDEXPIRED = json['P_PASSOWRD_EXPIRED'];
pPASSWORDEXPIREDMSG = json['P_PASSWORD_EXPIRED_MSG'];
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
pSESSIONID = json['P_SESSION_ID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_EMAIL_ADDRESS'] = this.pEMAILADDRESS;
data['P_INVALID_LOGIN_MSG'] = this.pINVALIDLOGINMSG;
data['P_LEGISLATION_CODE'] = this.pLEGISLATIONCODE;
data['P_MOBILE_NUMBER'] = this.pMOBILENUMBER;
data['P_PASSOWRD_EXPIRED'] = this.pPASSOWRDEXPIRED;
data['P_PASSWORD_EXPIRED_MSG'] = this.pPASSWORDEXPIREDMSG;
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
data['P_SESSION_ID'] = this.pSESSIONID;
return data;
}
}

@ -1,62 +0,0 @@
class MemberModel {
int? totalItemsCount;
int? statusCode;
String? message;
List<MemberDataModel>? data;
MemberModel({this.totalItemsCount, this.statusCode, this.message, this.data});
MemberModel.fromJson(Map<String, dynamic> json) {
totalItemsCount = json['totalItemsCount'];
statusCode = json['statusCode'];
message = json['message'];
if (json['data'] != null) {
data = [];
json['data'].forEach((v) {
data?.add(new MemberDataModel.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['totalItemsCount'] = this.totalItemsCount;
data['statusCode'] = this.statusCode;
data['message'] = this.message;
if (this.data != null) {
data['data'] = this.data?.map((v) => v.toJson()).toList();
}
return data;
}
}
class MemberDataModel {
int? committeeId;
String? firstName;
String? lastName;
String? description;
String? picture;
int? orderNo;
MemberDataModel({this.committeeId, this.firstName, this.lastName, this.description, this.picture, this.orderNo});
MemberDataModel.fromJson(Map<String, dynamic> json) {
committeeId = json['committeeId'];
firstName = json['firstName'];
lastName = json['lastName'];
description = json['description'];
picture = json['picture'];
orderNo = json['orderNo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['committeeId'] = this.committeeId;
data['firstName'] = this.firstName;
data['lastName'] = this.lastName;
data['description'] = this.description;
data['picture'] = this.picture;
data['orderNo'] = this.orderNo;
return data;
}
}

@ -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,21 @@
class PrivilegeListModel {
int? iD;
String? serviceName;
bool? previlege;
PrivilegeListModel({this.iD, this.serviceName, this.previlege});
PrivilegeListModel.fromJson(Map<String, dynamic> json) {
iD = json['ID'];
serviceName = json['ServiceName'];
previlege = json['Previlege'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ID'] = this.iD;
data['ServiceName'] = this.serviceName;
data['Previlege'] = this.previlege;
return data;
}
}

@ -15,6 +15,7 @@ class AppTheme {
},
),
hintColor: Colors.grey[400],
colorScheme: ColorScheme.fromSwatch(accentColor: MyColors.backgroundColor),
disabledColor: Colors.grey[300],
errorColor: const Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: MyColors.backgroundColor,

@ -43,7 +43,7 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
children: [
Container(
color: MyColors.backgroundBlackColor,
padding: EdgeInsets.only(left: 21, right: 21, bottom: 21),
padding: EdgeInsets.only(top: 4,left: 21, right: 21, bottom: 21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

@ -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
],
),

@ -35,32 +35,39 @@ class _NewPasswordScreenState extends State<NewPasswordScreen> {
@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),
//const SizedBox(height: 23),
Expanded(
child: Padding(
padding: const EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(child: SizedBox()),
Row(
children: [
LocaleKeys.english.tr().toText14(color: MyColors.textMixColor).onPress(() {}),
Container(
width: 1,
color: MyColors.darkWhiteColor,
height: 16,
margin: const EdgeInsets.only(left: 10, right: 10),
),
LocaleKeys.arabic.tr().toText14().onPress(() {}),
],
),
],
),
// Row(
// children: [
// Expanded(child: SizedBox()),
// Row(
// children: [
// LocaleKeys.english.tr().toText14(color: MyColors.textMixColor).onPress(() {}),
// Container(
// width: 1,
// color: MyColors.darkWhiteColor,
// height: 16,
// margin: const EdgeInsets.only(left: 10, right: 10),
// ),
// LocaleKeys.arabic.tr().toText14().onPress(() {}),
// ],
// ),
// ],
// ),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
@ -81,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,20 +618,36 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
return InkWell(
onTap: isDisable
? null
: () {
: () async {
if (_flag == 0) {
setState(() {
// isMoreOption = true;
});
} else {
Utils.showLoading(context);
BasicMemberInformationModel? memberInformationModel = await LoginApiClient()
.mohemmSendActivationCodeByOTPNotificationType(checkBiometricIsAvailable(BiometricType.fingerprint) ? 1 : 0, AppState().memberLoginList?.pMOBILENUMBER, _flag, AppState().username);
Utils.hideLoading(context);
OtpDialog(
context,
_flag,
//this.mobileNumber
0554870506,
(value) {
Navigator.pushReplacementNamed(context, AppRoutes.dashboard);
// this.checkActivationCode(value: value);
int.tryParse(AppState().memberLoginList?.pMOBILENUMBER ?? ""),
(value) async {
Utils.showLoading(context);
try {
GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(false, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().username);
if (genericResponseModel?.errorMessage != null) {
Utils.showToast(genericResponseModel?.errorMessage ?? "");
// Navigator.pop(context);
}
Utils.hideLoading(context);
Navigator.pop(context);
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.dashboard, (Route<dynamic> route) => false);
} catch (ex) {
print(ex);
Utils.hideLoading(context);
Utils.handleException(ex, null);
}
},
() => {
Navigator.pop(context),

@ -0,0 +1,47 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class LoadingDialog extends StatefulWidget {
LoadingDialog({Key? key}) : super(key: key);
@override
_LoadingDialogState createState() {
return _LoadingDialogState();
}
}
class _LoadingDialogState extends State<LoadingDialog> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Dialog(
insetPadding: const EdgeInsets.symmetric(horizontal: 60.0, vertical: 24.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
elevation: 0,
backgroundColor: Colors.transparent,
child: Directionality(
textDirection: TextDirection.rtl,
child: Center(
child: Image.asset(
"assets/images/logos/loading_mohemm_logo.gif",
height: 96.0,
width: 96.0,
),
),
),
);
}
}
Loading…
Cancel
Save