Compare commits

..

No commits in common. 'master' and 'sultan-dev' have entirely different histories.

@ -1,57 +0,0 @@
{
"agcgw_all":{
"CN":"connect-drcn.dbankcloud.cn",
"CN_back":"connect-drcn.hispace.hicloud.com",
"DE":"connect-dre.dbankcloud.cn",
"DE_back":"connect-dre.hispace.hicloud.com",
"RU":"connect-drru.hispace.dbankcloud.ru",
"RU_back":"connect-drru.hispace.dbankcloud.cn",
"SG":"connect-dra.dbankcloud.cn",
"SG_back":"connect-dra.hispace.hicloud.com"
},
"websocketgw_all":{
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
},
"client":{
"cp_id":"2640966000002322881",
"product_id":"737518067793559971",
"client_id":"715996003571874624",
"client_secret":"B5B89A56A53847C6BB9D216A8747E75952760DF9A8232239D8744CD847A8FFDA",
"project_id":"737518067793559971",
"app_id":"104737117",
"api_key":"DAEDACKDrYgyco9mjPV9ZUjCSh1kCr/GBV0nseHH0z2mnxlZ41RksOKmyTi+PUTwmGEPK+VxCup4F9oUf4VbDnCsjB7aNBShYcjR+g==",
"package_name":"hmg.cloudSolutions.mohem"
},
"oauth_client":{
"client_id":"104737117",
"client_type":1
},
"app_info":{
"app_id":"104737117",
"package_name":"hmg.cloudSolutions.mohem"
},
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"hmg.cloudSolutions.mohem",
"client":{
"app_id":"104737117"
},
"app_info":{
"package_name":"hmg.cloudSolutions.mohem",
"app_id":"104737117"
},
"oauth_client":{
"client_type":1,
"client_id":"104737117"
}
}
]
}

@ -31,7 +31,6 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.huawei.agconnect'
android { android {
compileSdkVersion 33 compileSdkVersion 33
@ -59,12 +58,6 @@ android {
} }
signingConfigs { signingConfigs {
// debug {
// keyAlias keystoreProperties['keyAlias']
// keyPassword keystoreProperties['keyPassword']
// storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
// storePassword keystoreProperties['storePassword']
// }
release { release {
keyAlias keystoreProperties['keyAlias'] keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword'] keyPassword keystoreProperties['keyPassword']
@ -75,9 +68,6 @@ android {
buildTypes { buildTypes {
release { release {
signingConfig signingConfigs.release signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
} }

@ -7,15 +7,7 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.NFC" /> <uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<!-- Chat Web RTC Calling -->
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<application <application
android:allowBackup="false" android:allowBackup="false"

@ -3,14 +3,12 @@ buildscript {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.0.3' classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.8' classpath 'com.google.gms:google-services:4.3.8'
classpath 'com.huawei.agconnect:agcp:1.8.0.300'
} }
} }
@ -18,7 +16,6 @@ allprojects {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

@ -25,7 +25,6 @@
"checkIn": "تحقق في", "checkIn": "تحقق في",
"workList": "قائمة العمل", "workList": "قائمة العمل",
"leaveBalance": "رصيد الاجازات", "leaveBalance": "رصيد الاجازات",
"businessTripBalance": "رصيد رحلة العمل",
"missingSwipes": "تسجيل بصمة حضور", "missingSwipes": "تسجيل بصمة حضور",
"ticketBalance": "رصيد التذكرة", "ticketBalance": "رصيد التذكرة",
"other": "آخر", "other": "آخر",
@ -307,7 +306,6 @@
"actionBy": "الرد بواسطة", "actionBy": "الرد بواسطة",
"pending": "معلق", "pending": "معلق",
"pendingTransactions": "المعاملات المعلقه", "pendingTransactions": "المعاملات المعلقه",
"notices": "إشعارات",
"selectRequestType": "الرجاء اختيار نوع الطلب", "selectRequestType": "الرجاء اختيار نوع الطلب",
"dateFrom": "من تاريخ", "dateFrom": "من تاريخ",
"dateTo": "الى تاريخ", "dateTo": "الى تاريخ",
@ -526,19 +524,5 @@
"fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية", "fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية",
"noWinner": "حزين! لم يفز أحد اليوم.", "noWinner": "حزين! لم يفز أحد اليوم.",
"myTeam" : "فريقي", "myTeam" : "فريقي",
"youCanPlayDemo": "لكن يمكنك لعب العرض", "youCanPlayDemo": "لكن يمكنك لعب العرض"
"qualification": "مؤهلات",
"esteblishmentName": "اسم المؤسسة",
"gradeDescription": "وصف الصف",
"type": "يكتب",
"status": "حالة",
"leaveType": "نوع الإجازة",
"attendanceType": "نوع الحضور",
"help": "يساعد",
"dear": "عزيزي",
"assistant": "للحصول على المساعدة ، يمكنك تقديم الطلب على نظام سعيد أو الاتصال بمركز الاتصال الموحد على 8310200",
"employee_leaves_calender": "تقويم أوراق الموظفين",
"view_your_leave_information": "عرض معلومات إجازتك",
"view_details": "عرض التفاصيل",
"hierarchy": "تَسَلسُل"
} }

@ -25,7 +25,6 @@
"checkIn": "Check In", "checkIn": "Check In",
"workList": "Work List", "workList": "Work List",
"leaveBalance": "Leave Balance", "leaveBalance": "Leave Balance",
"businessTripBalance": "Business Trip Balance",
"missingSwipes": "Missing Swipes", "missingSwipes": "Missing Swipes",
"ticketBalance": "Ticket Balance", "ticketBalance": "Ticket Balance",
"other": "Other", "other": "Other",
@ -303,7 +302,6 @@
"topic": "Topic", "topic": "Topic",
"actionBy": "Action By", "actionBy": "Action By",
"pendingTransactions": "Pending Transactions", "pendingTransactions": "Pending Transactions",
"notices": "Notices",
"selectRequestType": "Please select request type", "selectRequestType": "Please select request type",
"dateFrom": "Date From", "dateFrom": "Date From",
"dateTo": "Date To", "dateTo": "Date To",
@ -426,7 +424,7 @@
"typeCurrentPasswordBelow": "Type Your Current password below", "typeCurrentPasswordBelow": "Type Your Current password below",
"currentPassword": "Current password", "currentPassword": "Current password",
"concurrentReports": "Concurrent Reports", "concurrentReports": "Concurrent Reports",
"EnterNewAddressMoved": "Enter a new address if you have moved", "EnterNewAddressMoved" : "Enter a new address if you have moved",
"CorrectAddress": "Correct or amend this address", "CorrectAddress": "Correct or amend this address",
"SelectChangeWantToMake": "Select the type of change you want to make", "SelectChangeWantToMake": "Select the type of change you want to make",
"profile": { "profile": {
@ -471,7 +469,7 @@
"gameTime": "Game Time:", "gameTime": "Game Time:",
"joinMarathon": "Join Marathon", "joinMarathon": "Join Marathon",
"joinDemoMarathon": "Join Demo Marathon", "joinDemoMarathon": "Join Demo Marathon",
"demo": "Demo", "demo":"Demo",
"minutes": "Minutes", "minutes": "Minutes",
"seconds": "Seconds", "seconds": "Seconds",
"note": "Note:", "note": "Note:",
@ -519,27 +517,12 @@
"startingIn": "Starting in", "startingIn": "Starting in",
"youAreOutOfContest": "You are out of the contest.", "youAreOutOfContest": "You are out of the contest.",
"winners": "WINNERS!!!", "winners": "WINNERS!!!",
"expireAfter": "Expires After", "expireAfter":"Expires After",
"oneWeek": "1 Week", "oneWeek":"1 Week",
"twoWeek": "2 Week", "twoWeek":"2 Week",
"noUpcoming": "There is no upcoming", "noUpcoming": "There is no upcoming",
"fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.", "fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.",
"noWinner": "Sad! No one won today.", "noWinner": "Sad! No one won today.",
"myTeam": "My Team", "myTeam" : "My Team",
"youCanPlayDemo": "But you can play demo", "youCanPlayDemo": "But you can play demo"
"qualification": "Qualifications",
"esteblishmentName": "Establishment Name",
"gradeDescription": "Grade Description",
"type": "Type",
"status": "Status",
"leaveType": "Leave Type",
"attendanceType": "Attendance Type",
"help": "Help",
"dear": "Dear",
"assistant": "For assistance, you can submit the request on the Saeed system or call the unified call center on 8310200",
"employee_leaves_calender": "Employee Leaves Calender",
"view_your_leave_information": "View Your Leave Information",
"view_details": "View Details",
"hierarchy": "Hierarchy"
} }

@ -1,7 +1,6 @@
import UIKit import UIKit
import Flutter import Flutter
import Firebase import Firebase
import flutter_local_notifications
@UIApplicationMain @UIApplicationMain
@ -10,13 +9,7 @@ import flutter_local_notifications
_ application: UIApplication, _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
FirebaseApp.configure() FirebaseApp.configure()
FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in
GeneratedPluginRegistrant.register(with: registry)
}
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
}
GeneratedPluginRegistrant.register(with: self) GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }

@ -2,15 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsForMedia</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
<key>CADisableMinimumFrameDurationOnPhone</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<true/> <true/>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
@ -42,7 +33,7 @@
<key>NFCReaderUsageDescription</key> <key>NFCReaderUsageDescription</key>
<string>This App requires access to NFC to mark your attendance.</string> <string>This App requires access to NFC to mark your attendance.</string>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>This app requires camera access to capture &amp; upload picture as profile image.</string> <string>This app requires camera access to capture &amp; upload pictures.</string>
<key>NSFaceIDUsageDescription</key> <key>NSFaceIDUsageDescription</key>
<string>This app requires Face ID to allow biometric authentication for app login.</string> <string>This app requires Face ID to allow biometric authentication for app login.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
@ -55,13 +46,15 @@
<string>This app requires photo library access to select image as document &amp; upload it.</string> <string>This app requires photo library access to select image as document &amp; upload it.</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>This app requires microphone access to for call.</string> <string>This app requires microphone access to for call.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires photo library access to select image as document &amp; upload it.</string>
<key>UIBackgroundModes</key> <key>UIBackgroundModes</key>
<array> <array>
<string>fetch</string> <string>fetch</string>
<string>remote-notification</string> <string>remote-notification</string>
</array> </array>
<key>FirebaseAppDelegateProxyEnabled</key> <key>FirebaseAppDelegateProxyEnabled</key>
<false/> <false/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
@ -87,9 +80,14 @@
</array> </array>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>com.apple.developer.nfc.readersession.formats</key> <key>com.apple.developer.nfc.readersession.formats</key>
<array> <array>
<string>TAG</string> <string>TAG</string>
</array> </array>
<key>com.apple.developer.nfc.readersession.felica.systemcodes</key>
<array>
<string>0000</string>
</array>
</dict> </dict>
</plist> </plist>

@ -77,22 +77,23 @@ class ApiClient {
if (headers != null && headers.isNotEmpty) { if (headers != null && headers.isNotEmpty) {
_headers.addAll(headers); _headers.addAll(headers);
} }
if (!kReleaseMode) {
print("Url:$url"); print("Url:$url");
var bodyJson = json.encode(jsonObject); var bodyJson = json.encode(jsonObject);
print("body:$bodyJson"); print("body:$bodyJson");
}
var response = await postJsonForResponse(url, jsonObject, token: token, queryParameters: queryParameters, headers: _headers, retryTimes: retryTimes, isFormData: isFormData); var response = await postJsonForResponse(url, jsonObject, token: token, queryParameters: queryParameters, headers: _headers, retryTimes: retryTimes, isFormData: isFormData);
try { try {
if (!kReleaseMode) { if (!kReleaseMode) {
logger.i("res: " + response.body); logger.i("res: " + response.body);
} }
var jsonData = jsonDecode(response.body); var jsonData = jsonDecode(response.body);
if (jsonData["IsAuthenticated"] != null) { if (jsonData["MessageStatus"] == 2) {
AppState().setIsAuthenticated = jsonData["IsAuthenticated"]; AppState().setIsAuthenticated = false;
} }
if (jsonData["ErrorMessage"] == null) {
if (jsonData["ErrorMessage"] == null && jsonData["MessageStatus"] == 1) {
return factoryConstructor(jsonData); return factoryConstructor(jsonData);
} else { } else {
APIError? apiError; APIError? apiError;

@ -88,10 +88,7 @@ class LoginApiClient {
AppState().postParamsObject?.pEmailAddress = responseData.basicMemberInformation!.pEMAILADDRESS; AppState().postParamsObject?.pEmailAddress = responseData.basicMemberInformation!.pEMAILADDRESS;
AppState().postParamsObject?.pSessionId = responseData.pSESSIONID; AppState().postParamsObject?.pSessionId = responseData.pSESSIONID;
AppState().postParamsObject?.pUserName = AppState().getUserName; AppState().postParamsObject?.pUserName = AppState().getUserName;
//TODO: employee id changed in SRCA instead of username AppState().postParamsObject?.pSelectedEmployeeNumber = AppState().getUserName;
// AppState().postParamsObject?.pSelectedEmployeeNumber = AppState().getUserName;
//TODO: need to fix emp number
AppState().postParamsObject?.pSelectedEmployeeNumber = responseData.memberInformationList!.first.eMPLOYEENUMBER;
AppState().postParamsObject?.setPLegislationCode = responseData.basicMemberInformation!.pLEGISLATIONCODE; AppState().postParamsObject?.setPLegislationCode = responseData.basicMemberInformation!.pLEGISLATIONCODE;
AppState().postParamsObject?.setPayrollCodeStr = responseData.memberInformationList!.first.pAYROLLCODE; AppState().postParamsObject?.setPayrollCodeStr = responseData.memberInformationList!.first.pAYROLLCODE;
AppState().setBusinessCardPrivilege = responseData.businessCardPrivilege ?? false; AppState().setBusinessCardPrivilege = responseData.businessCardPrivilege ?? false;

@ -1,13 +1,14 @@
import 'dart:async'; import 'dart:async';
import 'package:mohem_flutter_app/api/api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/consts.dart'; import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/models/employee_leaves_list.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart'; import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart';
import 'package:mohem_flutter_app/models/get_mobile_login_info_list_model.dart';
import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart'; import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart';
import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart';
import 'package:mohem_flutter_app/api/api_client.dart';
class MonthlyAttendanceApiClient { class MonthlyAttendanceApiClient {
static final MonthlyAttendanceApiClient _instance = MonthlyAttendanceApiClient._internal(); static final MonthlyAttendanceApiClient _instance = MonthlyAttendanceApiClient._internal();
@ -51,24 +52,6 @@ class MonthlyAttendanceApiClient {
}, url, postParams); }, url, postParams);
} }
Future<List<EmployeeLeavesList>> getEmployeeLeaves(String startDate, String endDate) async {
// String url = "${ApiConsts.erpRest}GET_TIME_CARD_SUMMARY";
String url = "${ApiConsts.erpRest}GET_EMPLOYEE_LEAVES";
Map<String, dynamic> postParams = {
"P_MENU_TYPE": "E",
"P_SELECTED_RESP_ID": -999,
// "SearchMonth": month,
// "SearchYear": year,
"P_DATE_FROM_STR": startDate,
"P_DATE_TO_STR": endDate
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.getEmployeeLeavesList ?? [];
}, url, postParams);
}
Future<GetScheduleShiftsDetailsList?> getScheduleShiftsDetails(int pRTPID) async { Future<GetScheduleShiftsDetailsList?> getScheduleShiftsDetails(int pRTPID) async {
String url = "${ApiConsts.erpRest}GET_SCHEDULE_SHIFTS_DETAILS"; String url = "${ApiConsts.erpRest}GET_SCHEDULE_SHIFTS_DETAILS";
@ -83,4 +66,5 @@ class MonthlyAttendanceApiClient {
return (responseData.getScheduleShiftsDetailsList?.length ?? 0) > 0 ? responseData.getScheduleShiftsDetailsList!.first : null; return (responseData.getScheduleShiftsDetailsList?.length ?? 0) > 0 ? responseData.getScheduleShiftsDetailsList!.first : null;
}, url, postParams); }, url, postParams);
} }
} }

@ -1,5 +1,4 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert';
import 'package:mohem_flutter_app/api/api_client.dart'; import 'package:mohem_flutter_app/api/api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
@ -75,14 +74,6 @@ class MyAttendanceApiClient {
}; };
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID; if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID;
// below commneted lines when need to verify payload
// print(jsonEncode(postParams));
// for (var value in list) {
// print(jsonEncode(value));
// }
//postParams["GetValueSetValuesTBL"] = list;
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json); GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return ESERVICESDV.fromJson(responseData.getDefaultValueList!.toJson()); return ESERVICESDV.fromJson(responseData.getDefaultValueList!.toJson());

@ -16,9 +16,9 @@ class MyRequestsApiClient {
factory MyRequestsApiClient() => _instance; factory MyRequestsApiClient() => _instance;
Future<List<GetConcurrentProgramsModel>> getConcurrentPrograms(int id) async { Future<List<GetConcurrentProgramsModel>> getConcurrentPrograms() async {
String url = "${ApiConsts.erpRest}GET_CONCURRENT_PROGRAMS"; String url = "${ApiConsts.erpRest}GET_CONCURRENT_PROGRAMS";
Map<String, dynamic> postParams = {"P_REQUEST_GROUP_ID": id}; Map<String, dynamic> postParams = {"P_REQUEST_GROUP_ID": 3290};
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {
@ -60,28 +60,30 @@ class MyRequestsApiClient {
}, url, postParams); }, url, postParams);
} }
Future<GenericResponseModel> getSubmitNewRequest(List<Map<String, dynamic>> list, {String? functionName}) async { Future<SubmitCcpTransactionList?> getSubmitNewRequest(List<Map<String, dynamic>> list) async
{
String url = "${ApiConsts.erpRest}SUBMIT_CCP_TRANSACTION"; String url = "${ApiConsts.erpRest}SUBMIT_CCP_TRANSACTION";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
"P_MENU_TYPE": "E", "P_MENU_TYPE": "E",
"P_SELECTED_RESP_ID": -999, "P_SELECTED_RESP_ID": -999,
"P_DESC_FLEX_NAME": functionName ?? "HMG_EMP_BUS_TRIP_SET_SS", "P_DESC_FLEX_NAME": "HMG_EMP_BUS_TRIP_SET_SS",
}; };
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
postParams["EITTransactionTBL"] = list; postParams["EITTransactionTBL"] = list;
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json); GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData; return responseData.submitCcpTransactionList;
}, url, postParams); }, url, postParams);
} }
Future<List<GetCCPTransactionsModel>> getCcpTransactions(List<Map<String, dynamic>> list, {String? functionName}) async { Future<List<GetCCPTransactionsModel>> getCcpTransactions(List<Map<String, dynamic>> list) async
{
String url = "${ApiConsts.erpRest}GET_CCP_TRANSACTIONS"; String url = "${ApiConsts.erpRest}GET_CCP_TRANSACTIONS";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
"P_MENU_TYPE": "E", "P_MENU_TYPE": "E",
"P_SELECTED_RESP_ID": -999, "P_SELECTED_RESP_ID": -999,
"P_DESC_FLEX_NAME": functionName ?? "HMG_EMP_BUS_TRIP_SET_SS", "P_DESC_FLEX_NAME": "HMG_EMP_BUS_TRIP_SET_SS",
}; };
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
@ -91,4 +93,5 @@ class MyRequestsApiClient {
return responseData.getCCPTransactionsModel ?? []; return responseData.getCCPTransactionsModel ?? [];
}, url, postParams); }, url, postParams);
} }
} }

@ -12,10 +12,8 @@ import 'package:mohem_flutter_app/models/get_employee_address_model.dart';
import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart';
import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart';
import 'package:mohem_flutter_app/models/get_employee_phones_model.dart'; import 'package:mohem_flutter_app/models/get_employee_phones_model.dart';
import 'package:mohem_flutter_app/models/hierarchy_lists.dart';
import 'package:mohem_flutter_app/models/performance.dart'; import 'package:mohem_flutter_app/models/performance.dart';
import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart';
import 'package:mohem_flutter_app/models/profile/employee_qualifications_list.dart';
import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart';
import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart';
import 'package:mohem_flutter_app/models/profile/get_countries_list_model.dart'; import 'package:mohem_flutter_app/models/profile/get_countries_list_model.dart';
@ -60,19 +58,6 @@ class ProfileApiClient {
}, url, postParams); }, url, postParams);
} }
Future<List<EmployeeQualificationsList>> getEmployeeQualifications() async {
String url = "${ApiConsts.erpRest}GET_EMPLOYEE_QUALIFICATIONS";
Map<String, dynamic> postParams = {
"P_MENU_TYPE": "E",
"P_SELECTED_RESP_ID": -999,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.getEmployeeQualificationsList ?? [];
}, url, postParams);
}
Future<List<GetEmployeePhonesList>> getEmployeePhones() async { Future<List<GetEmployeePhonesList>> getEmployeePhones() async {
String url = "${ApiConsts.erpRest}GET_EMPLOYEE_PHONES"; String url = "${ApiConsts.erpRest}GET_EMPLOYEE_PHONES";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
@ -418,19 +403,4 @@ class ProfileApiClient {
return responseData.getPerformanceAppraisalList ?? []; return responseData.getPerformanceAppraisalList ?? [];
}, url, postParams); }, url, postParams);
} }
Future<SupervisorHierarchyLists?> getHierarchy(String empNum) async {
String url = "${ApiConsts.erpRest}GET_SUPERVISOR_HIERARCHY";
Map<String, dynamic> postParams = {
"P_MENU_TYPE": "E",
"P_SELECTED_RESP_ID": -999
};
postParams.addAll(AppState().postParamsJson);
postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empNum;
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.supervisorHierarchyLists;
}, url, postParams);
}
} }

@ -149,13 +149,12 @@ class WorkListApiClient {
}, url, postParams); }, url, postParams);
} }
Future<MemberInformationListModel> getUserInformation(int pSelectedResopID, String selectedEmployeeNumber, String noficationId) async { Future<MemberInformationListModel> getUserInformation(int pSelectedResopID, String selectedEmployeeNumber) async {
String url = "${ApiConsts.erpRest}Get_Notification_UserInformation"; String url = "${ApiConsts.erpRest}Get_UserInformation";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": pSelectedResopID, "P_SELECTED_RESP_ID": pSelectedResopID,
"P_PAGE_LIMIT": 100, "P_PAGE_LIMIT": 100,
"P_PAGE_NUM": 1, "P_PAGE_NUM": 1,
"P_NOTIFICATION_ID": noficationId,
}; };
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
if (selectedEmployeeNumber != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = selectedEmployeeNumber; if (selectedEmployeeNumber != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = selectedEmployeeNumber;
@ -414,7 +413,7 @@ class WorkListApiClient {
"EmployeeNumber": employeeNumber, "EmployeeNumber": employeeNumber,
"Comments": "", "Comments": "",
"AdditionalFields": null, "AdditionalFields": null,
"NewUserEMPId": newUserEMPId "NewUserEMPId":newUserEMPId
}; };
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {

@ -1,6 +1,7 @@
import 'dart:io'; import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:mohem_flutter_app/models/chat/get_user_login_token_model.dart'; import 'package:mohem_flutter_app/models/chat/get_user_login_token_model.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/request_detail_model.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/request_detail_model.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart'; import 'package:mohem_flutter_app/models/member_information_list_model.dart';
@ -10,9 +11,6 @@ import 'package:mohem_flutter_app/models/post_params_model.dart';
import 'package:mohem_flutter_app/models/privilege_list_model.dart'; import 'package:mohem_flutter_app/models/privilege_list_model.dart';
import 'package:mohem_flutter_app/models/worklist_response_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart';
class AppState { class AppState {
static final AppState _instance = AppState._internal(); static final AppState _instance = AppState._internal();
@ -79,19 +77,7 @@ class AppState {
bool get getIsDemoMarathon => _isDemoMarathon; bool get getIsDemoMarathon => _isDemoMarathon;
bool _isHuawei = false; final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 3.9, mobileType: Platform.isAndroid ? "android" : "ios");
set setIsHuawei(bool value) => _isHuawei = value;
bool get getIsHuawei => _isHuawei;
String _huaweiPushToken = "";
set setHuaweiPushToken(String value) => _huaweiPushToken = value;
String get getHuaweiPushToken => _huaweiPushToken;
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 6.1, mobileType: Platform.isAndroid ? "android" : "ios");
void setPostParamsInitConfig() { void setPostParamsInitConfig() {
isAuthenticated = false; isAuthenticated = false;
@ -194,4 +180,5 @@ class AppState {
} }
bool cancelRequestTrancsection = true; bool cancelRequestTrancsection = true;
} }

@ -6,8 +6,8 @@ class MyColors {
static const Color darkTextColor = Color(0xff2B353E); static const Color darkTextColor = Color(0xff2B353E);
static const Color normalTextColor = Color(0xff5A5A5A); static const Color normalTextColor = Color(0xff5A5A5A);
static const Color lightTextColor = Color(0xffBFBFBF); static const Color lightTextColor = Color(0xffBFBFBF);
static const Color gradiantStartColor = Color(0xff259db7); static const Color gradiantStartColor = Color(0xff33c0a5);
static const Color gradiantEndColor = Color(0xff33c0a5); static const Color gradiantEndColor = Color(0xff259db7);
static const Color textMixColor = Color(0xff2BB8A6); static const Color textMixColor = Color(0xff2BB8A6);
static const Color backgroundColor = Color(0xffF8F8F8); static const Color backgroundColor = Color(0xffF8F8F8);
static const Color grey41Color = Color(0xff414141); static const Color grey41Color = Color(0xff414141);
@ -30,7 +30,7 @@ class MyColors {
static const Color darkWhiteColor = Color(0xffE0E0E0); static const Color darkWhiteColor = Color(0xffE0E0E0);
static const Color redColor = Color(0xffD02127); static const Color redColor = Color(0xffD02127);
static const Color pinkColor = Color(0xffEBA9A9); static const Color pinkColor = Color(0xffEBA9A9);
static const Color pinkDarkColor = Color(0xffdb5b6a); static const Color pinkDarkColor = Color(0xffe3797d);
static const Color yellowColor = Color(0xffF4E31C); static const Color yellowColor = Color(0xffF4E31C);
static const Color orange = Color(0xFFCC9B14); static const Color orange = Color(0xFFCC9B14);
static const Color yellowFavColor = Color(0xffEAC321); static const Color yellowFavColor = Color(0xffEAC321);
@ -41,7 +41,6 @@ class MyColors {
static const Color borderColor = Color(0xffE8E8E8); static const Color borderColor = Color(0xffE8E8E8);
static const Color borderE3Color = Color(0xffE3E3E3); static const Color borderE3Color = Color(0xffE3E3E3);
static const Color borderCEColor = Color(0xffCECECE); static const Color borderCEColor = Color(0xffCECECE);
//static const Color grey67Color = Color(0xff676767); //static const Color grey67Color = Color(0xff676767);
static const Color whiteColor = Color(0xFFEEEEEE); static const Color whiteColor = Color(0xFFEEEEEE);
static const Color greenColor = Color(0xff1FA269); static const Color greenColor = Color(0xff1FA269);
@ -56,7 +55,7 @@ class MyColors {
static const Color lightGreyColor = Color(0xffC7C7C7); static const Color lightGreyColor = Color(0xffC7C7C7);
static const Color green69Color = Color(0xff1FA169); static const Color green69Color = Color(0xff1FA169);
static const Color redA3Color = Color(0xffCA3332); static const Color redA3Color = Color(0xffCA3332);
static const Color green9CColor = Color(0xff259CB8); static const Color green9CColor = Color(0xff259CB8);
static const Color green2DColor = Color(0xff32D892); static const Color green2DColor = Color(0xff32D892);
static const Color greyC4Color = Color(0xffC4C4C4); static const Color greyC4Color = Color(0xffC4C4C4);
static const Color grey35Color = Color(0xff535353); static const Color grey35Color = Color(0xff535353);

@ -1,10 +1,12 @@
import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart'; import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart';
class ApiConsts { class ApiConsts {
static String baseUrl = "https://uathrmsys.moenergy.gov.sa"; //MOE UAT //static String baseUrl = "http://10.200.204.20:2801/"; // Local server
// static String baseUrl = "https://hrmsys.moenergy.gov.sa"; // MOE ;LIVE // static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";
static String erpRest = baseUrlServices + "ERP.svc/REST/"; static String erpRest = baseUrlServices + "ERP.svc/REST/";
static String swpRest = baseUrlServices + "SWP.svc/REST/"; static String swpRest = baseUrlServices + "SWP.svc/REST/";

@ -60,13 +60,13 @@ class DateUtil {
} }
} }
date = date + " $hours:$mins:$secs"; date = date + " $hours:$mins:$secs";
DateTime returnDate = DateFormat("MM/dd/yyyy HH:mm:ss", "en_US").parse(date); DateTime returnDate = DateFormat("MM/dd/yyyy HH:mm:ss").parse(date);
return returnDate; return returnDate;
} }
static DateTime convertSimpleStringDateToDateddMMyyyy(String date) { static DateTime convertSimpleStringDateToDateddMMyyyy(String date) {
return DateFormat("MM/dd/yyyy hh:mm:ss", "en_US").parse(date); return DateFormat("MM/dd/yyyy hh:mm:ss").parse(date);
} }
static DateTime convertStringToDateNoTimeZone(String date) { static DateTime convertStringToDateNoTimeZone(String date) {
@ -123,7 +123,7 @@ class DateUtil {
} }
static String formatDateToTime(DateTime date) { static String formatDateToTime(DateTime date) {
return DateFormat('hh:mm a', "en_US").format(date); return DateFormat('hh:mm a').format(date);
} }
static String yearMonthDay(DateTime dateTime) { static String yearMonthDay(DateTime dateTime) {
@ -419,7 +419,7 @@ class DateUtil {
/// [dateTime] convert DateTime to data formatted /// [dateTime] convert DateTime to data formatted
static String getDayMonthDateFormatted(DateTime dateTime) { static String getDayMonthDateFormatted(DateTime dateTime) {
if (dateTime != null) if (dateTime != null)
return DateFormat('dd/MM', "en_US").format(dateTime); return DateFormat('dd/MM').format(dateTime);
else else
return ""; return "";
} }
@ -466,7 +466,7 @@ class DateUtil {
/// [dateTime] convert DateTime to data formatted /// [dateTime] convert DateTime to data formatted
static String getDayMonthYearHourMinuteDateFormatted(DateTime dateTime) { static String getDayMonthYearHourMinuteDateFormatted(DateTime dateTime) {
if (dateTime != null) if (dateTime != null)
return dateTime.day.toString() + "/" + dateTime.month.toString() + "/" + dateTime.year.toString() + " " + DateFormat('HH:mm', "en_US").format(dateTime); return dateTime.day.toString() + "/" + dateTime.month.toString() + "/" + dateTime.year.toString() + " " + DateFormat('HH:mm').format(dateTime);
else else
return ""; return "";
} }
@ -491,11 +491,11 @@ class DateUtil {
} }
static String getFormattedDate(DateTime dateTime, String formattedString) { static String getFormattedDate(DateTime dateTime, String formattedString) {
return DateFormat(formattedString, "en_US").format(dateTime); return DateFormat(formattedString).format(dateTime);
} }
static String convertISODateToJsonDate(String isoDate) { static String convertISODateToJsonDate(String isoDate) {
return "/Date(" + DateFormat('mm-dd-yyy', "en_US").parse(isoDate).millisecondsSinceEpoch.toString() + ")/"; return "/Date(" + DateFormat('mm-dd-yyy').parse(isoDate).millisecondsSinceEpoch.toString() + ")/";
} }
// static String getDay(DayOfWeek dayOfWeek) { // static String getDay(DayOfWeek dayOfWeek) {

@ -1,155 +1,13 @@
// import 'dart:io'; import 'dart:convert';
//
// import 'package:firebase_core/firebase_core.dart';
// import 'package:firebase_messaging/firebase_messaging.dart';
// import 'package:flutter/foundation.dart';
// import 'package:flutter_local_notifications/flutter_local_notifications.dart';
// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
// import 'package:huawei_push/huawei_push.dart' as huawei_push;
// import 'package:mohem_flutter_app/app_state/app_state.dart';
// import 'package:mohem_flutter_app/classes/utils.dart';
// import 'package:permission_handler/permission_handler.dart';
//
// final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
//
// class AppNotifications {
// static final AppNotifications _instance = AppNotifications._internal();
//
// AppNotifications._internal();
//
// factory AppNotifications() => _instance;
//
// late HmsApiAvailability hmsApiAvailability;
//
// String _huaweiToken = '';
//
// Future<void> requestPermissions() async {
// if (Platform.isIOS) {
// await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(alert: true, badge: true, sound: true);
// } else if (Platform.isAndroid) {
// AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>();
// bool? granted = await androidImplementation?.requestPermission();
// if (granted == false) {
// if (kDebugMode) {
// print("-------------------- Permission Granted ------------------------");
// print(granted);
// }
// await Permission.notification.request();
// }
// }
// }
//
// void init(String? firebaseToken) async {
// hmsApiAvailability = HmsApiAvailability();
// await requestPermissions();
// AppState().setDeviceToken = firebaseToken;
// await Permission.notification.isDenied.then((bool value) {
// if (value) {
// Permission.notification.request();
// }
// });
// RemoteMessage? initialMessage = await FirebaseMessaging.instance.getInitialMessage();
//
// if (initialMessage != null) _handleMessage(initialMessage);
//
// FirebaseMessaging.onMessage.listen((RemoteMessage message) {
// if (message.notification != null) _handleMessage(message);
// });
//
// FirebaseMessaging.onMessageOpenedApp.listen(_handleOpenApp);
//
// FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
//
// FirebaseMessaging.instance.onTokenRefresh.listen((String token) {
// AppState().setDeviceToken = token;
// });
//
// if (Platform.isAndroid) {
// await hmsApiAvailability.isHMSAvailable().then((value) async {
// if (value == 0) {
// huawei_push.Push.enableLogger();
// var result = await huawei_push.Push.setAutoInitEnabled(true);
//
// huawei_push.Push.onNotificationOpenedApp.listen((message) {
// // newMessage(toFirebaseRemoteMessage(message));
// }, onError: (e) => print(e.toString()));
//
// huawei_push.Push.onMessageReceivedStream.listen((message) {
// // newMessage(toFirebaseRemoteMessage(message));
// }, onError: (e) => print(e.toString()));
// }
// }).catchError((err) {
// print(err);
// });
// }
// }
//
// void initHuaweiPush(Function loginCallback) {
// AppState().setIsHuawei = true;
// initTokenStream(loginCallback);
// huawei_push.Push.getToken("");
// }
//
// // HUAWEI PUSH TOKEN IMPLEMENTATION
// void _onTokenEvent(String event) {
// _huaweiToken = event;
// AppState().setHuaweiPushToken = _huaweiToken;
// debugPrint("HUAWEI PUSH TOKEN: $_huaweiToken");
// }
//
// void _onTokenError(Object error) {}
//
// Future<void> initTokenStream(Function loginCallback) async {
// huawei_push.Push.getTokenStream.listen(_onTokenEvent, onError: _onTokenError).onData((data) {
// AppState().setHuaweiPushToken = data;
// debugPrint("HUAWEI PUSH TOKEN: $data");
// loginCallback();
// });
// }
//
// void _handleMessage(RemoteMessage message) {
// Utils.saveStringFromPrefs("isAppOpendByChat", "false");
// }
//
// void _handleOpenApp(RemoteMessage message) {
// Utils.saveStringFromPrefs("isAppOpendByChat", "true");
// Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
// }
// }
//
// AndroidNotificationChannel channel = const AndroidNotificationChannel(
// "high_importance_channel",
// "High Importance Notifications",
// importance: Importance.high,
// );
//
// Future<dynamic> backgroundMessageHandler(RemoteMessage message) async {
// await Firebase.initializeApp();
// Utils.saveStringFromPrefs("isAppOpendByChat", "false");
// Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
// }
//************** NEW fILE *****************
import 'dart:io'; import 'dart:io';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart';
// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:huawei_push/huawei_push.dart' as huawei_push;
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/main.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:firebase_core/firebase_core.dart';
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
@ -160,10 +18,6 @@ class AppNotifications {
factory AppNotifications() => _instance; factory AppNotifications() => _instance;
// late HmsApiAvailability hmsApiAvailability;
String _huaweiToken = '';
Future<void> requestPermissions() async { Future<void> requestPermissions() async {
if (Platform.isIOS) { if (Platform.isIOS) {
await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(alert: true, badge: true, sound: true); await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(alert: true, badge: true, sound: true);
@ -181,10 +35,6 @@ class AppNotifications {
} }
void init(String? firebaseToken) async { void init(String? firebaseToken) async {
// if (Platform.isAndroid) {
// hmsApiAvailability = HmsApiAvailability();
// }
await requestPermissions(); await requestPermissions();
AppState().setDeviceToken = firebaseToken; AppState().setDeviceToken = firebaseToken;
await Permission.notification.isDenied.then((bool value) { await Permission.notification.isDenied.then((bool value) {
@ -207,59 +57,15 @@ class AppNotifications {
FirebaseMessaging.instance.onTokenRefresh.listen((String token) { FirebaseMessaging.instance.onTokenRefresh.listen((String token) {
AppState().setDeviceToken = token; AppState().setDeviceToken = token;
}); });
if (Platform.isAndroid) {
// await hmsApiAvailability.isHMSAvailable().then((value) async {
if (!(await Utils.isGoogleServicesAvailable())) {
huawei_push.Push.enableLogger();
var result = await huawei_push.Push.setAutoInitEnabled(true);
huawei_push.Push.onNotificationOpenedApp.listen((message) {
// newMessage(toFirebaseRemoteMessage(message));
}, onError: (e) => print(e.toString()));
huawei_push.Push.onMessageReceivedStream.listen((message) {
// newMessage(toFirebaseRemoteMessage(message));
}, onError: (e) => print(e.toString()));
}
// }).catchError((err) {
// print(err);
// });
}
}
void initHuaweiPush(Function loginCallback) {
AppState().setIsHuawei = true;
initTokenStream(loginCallback);
huawei_push.Push.getToken("");
}
// HUAWEI PUSH TOKEN IMPLEMENTATION
void _onTokenEvent(String event) {
_huaweiToken = event;
AppState().setHuaweiPushToken = _huaweiToken;
debugPrint("HUAWEI PUSH TOKEN: $_huaweiToken");
}
void _onTokenError(Object error) {}
Future<void> initTokenStream(Function loginCallback) async {
huawei_push.Push.getTokenStream.listen(_onTokenEvent, onError: _onTokenError).onData((data) {
AppState().setHuaweiPushToken = data;
debugPrint("HUAWEI PUSH TOKEN: $data");
loginCallback();
});
} }
void _handleMessage(RemoteMessage message) { void _handleMessage(RemoteMessage message) {
Utils.saveStringFromPrefs("isAppOpendByChat", "false"); Utils.saveStringFromPrefs("isAppOpendByChat", "true");
} }
void _handleOpenApp(RemoteMessage message) { void _handleOpenApp(RemoteMessage message) {
if (message.data.isNotEmpty && message.data["type"] == 'chat') { Utils.saveStringFromPrefs("isAppOpendByChat", "true");
Utils.saveStringFromPrefs("isAppOpendByChat", "true"); Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
}
} }
} }
@ -271,9 +77,7 @@ AndroidNotificationChannel channel = const AndroidNotificationChannel(
Future<dynamic> backgroundMessageHandler(RemoteMessage message) async { Future<dynamic> backgroundMessageHandler(RemoteMessage message) async {
await Firebase.initializeApp(); await Firebase.initializeApp();
Utils.saveStringFromPrefs("isAppOpendByChat", "false"); Utils.saveStringFromPrefs("isAppOpendByChat", "true");
logger.w(message.data["user_chat_history_response"]);
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString()); Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
if (message.data.isNotEmpty && message.data["type"] == 'call') {
// ChatVoipCall().showCallkitIncoming(uuid: const Uuid().v4(), data: message);
}
} }

@ -7,7 +7,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
import 'package:google_api_availability/google_api_availability.dart';
import 'package:mohem_flutter_app/app_state/app_state.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/colors.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
@ -99,8 +98,7 @@ class Utils {
static void handleException(dynamic exception, cxt, Function(String)? onErrorMessage) { static void handleException(dynamic exception, cxt, Function(String)? onErrorMessage) {
String errorMessage; String errorMessage;
print("exception:$exception"); if (exception.error.errorType != null && exception.error.errorType == 4) {
if (exception?.error?.errorType != null && exception.error.errorType == 4) {
Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.appUpdateScreen, (_) => false, arguments: exception.error?.errorMessage); Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.appUpdateScreen, (_) => false, arguments: exception.error?.errorMessage);
} else { } else {
if (exception is APIException) { if (exception is APIException) {
@ -117,14 +115,12 @@ class Utils {
} else { } else {
if (!AppState().isAuthenticated) { if (!AppState().isAuthenticated) {
showDialog( showDialog(
barrierDismissible: false,
context: cxt, context: cxt,
builder: (cxt) => ConfirmDialog( builder: (cxt) => ConfirmDialog(
message: errorMessage, message: errorMessage,
onTap: () { onTap: () {
Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route<dynamic> route) => false); Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route<dynamic> route) => false);
}, },
onCloseTap: () {},
), ),
); );
} else { } else {
@ -268,7 +264,7 @@ class Utils {
static String getMonthNamedFormat(DateTime date) { static String getMonthNamedFormat(DateTime date) {
/// it will return like "29-Sep-2022" /// it will return like "29-Sep-2022"
return DateFormat('dd-MMM-yyyy', "en_US").format(date); return DateFormat('dd-MMM-yyyy').format(date);
} }
static String reverseFormatDate(String date) { static String reverseFormatDate(String date) {
@ -337,17 +333,10 @@ class Utils {
} }
return date; return date;
} else { } else {
if(date.toLowerCase().split("-").length == 1 && date.contains("/")) {
return reverseFormatDate(date);
}
else
if (date.toLowerCase().split("-")[1].length == 3) { if (date.toLowerCase().split("-")[1].length == 3) {
return DateFormat('dd-MM-yyyy', "en_US").format(DateFormat('dd-MMM-yyyy', "en_US").parseLoose(date)); return DateFormat('dd-MM-yyyy').format(DateFormat('dd-MMM-yyyy').parseLoose(date));
} else { } else {
if(date.contains(" ")) { return DateFormat('dd-MM-yyyy').format(DateFormat('yyyy-MM-dd').parseLoose(date));
date = date.split(" ").first;
}
return DateFormat('dd-MM-yyyy', "en_US").format(DateFormat('yyyy-MM-dd', "en_US").parseLoose(date));
} }
// return DateFormat('yyyy-MM-dd').format(DateFormat('dd-MM-yyyy').parseLoose(date)); // return DateFormat('yyyy-MM-dd').format(DateFormat('dd-MM-yyyy').parseLoose(date));
} }
@ -399,15 +388,4 @@ class Utils {
print(err); print(err);
}); });
} }
//HUAWEI DECISION MAKING
static Future<bool> isGoogleServicesAvailable() async {
GooglePlayServicesAvailability availability = await GoogleApiAvailability.instance.checkGooglePlayServicesAvailability();
String status = availability.toString().split('.').last;
if (status == "success") {
return true;
}
return false;
}
} }

@ -1,206 +0,0 @@
// ignore_for_file: prefer_single_quotes, lines_longer_than_80_chars final
// link to generate dart class https://www.webinovers.com/web-tools/json-to-dart-convertor
Map<String, dynamic> _env = {
"appConfig": "lib/config/config_en.json",
"login": {
"verification": true,
"verificationMethod": {
"whatsapp": false,
},
"forgetPassword": false
},
"bottomBar": false,
"dashboard": {
"attendance": false,
"worklist": true,
"ticketBalance": false,
"leaveBalance": true,
"missingSwipe": false,
"monthlyAttendance": false,
"vocationRules": false,
},
"itg": false,
"marathon": false,
"offersDiscount": false,
"myTeams": false,
"modifiy": false,
"myRequest": false,
"pendingTransactions": false,
"myProfile": false,
"itemsForSale": false,
"chat": false,
"monthlyAttendance": true,
"vocationRules": false,
"canEdit": false,
};
Env env = Env.fromJson(_env);
class Env {
Env({
required this.appConfig,
required this.login,
required this.bottomBar,
required this.dashboard,
required this.itg,
required this.marathon,
required this.offersDiscount,
required this.myTeams,
required this.modifiy,
required this.myRequest,
required this.pendingTransactions,
required this.myProfile,
required this.itemsForSale,
required this.chat,
required this.monthlyAttendance,
required this.vocationRules,
required this.canEdit,
});
late final String appConfig;
late final Login login;
late final bool bottomBar;
late final Dashboard dashboard;
late final bool itg;
late final bool marathon;
late final bool offersDiscount;
late final bool myTeams;
late final bool modifiy;
late final bool myRequest;
late final bool pendingTransactions;
late final bool myProfile;
late final bool itemsForSale;
late final bool chat;
late final bool monthlyAttendance;
late final bool vocationRules;
late final bool canEdit;
Env.fromJson(Map<String, dynamic> json) {
appConfig = json['appConfig'];
login = Login.fromJson(json['login']);
bottomBar = json['bottomBar'];
dashboard = Dashboard.fromJson(json['dashboard']);
marathon = json['marathon'];
itg = json['itg'];
offersDiscount = json['offersDiscount'];
myTeams = json['myTeams'];
modifiy = json['modifiy'];
myRequest = json['myRequest'];
pendingTransactions = json['pendingTransactions'];
myProfile = json['myProfile'];
itemsForSale = json['itemsForSale'];
chat = json['chat'];
monthlyAttendance = json['monthlyAttendance'];
vocationRules = json['vocationRules'];
canEdit = json['canEdit'];
}
Map<String, dynamic> toJson() {
var _data = <String, dynamic>{};
_data['appConfig'] = appConfig;
_data['login'] = login.toJson();
_data['bottomBar'] = bottomBar;
_data['dashboard'] = dashboard.toJson();
_data['marathon'] = marathon;
_data['itg'] = itg;
_data['offersDiscount'] = offersDiscount;
_data['myTeams'] = myTeams;
_data['modifiy'] = modifiy;
_data['myRequest'] = myRequest;
_data['pendingTransactions'] = pendingTransactions;
_data['myProfile'] = myProfile;
_data['itemsForSale'] = itemsForSale;
_data['chat'] = chat;
_data['monthlyAttendance'] = monthlyAttendance;
_data['vocationRules'] = vocationRules;
_data['canEdit'] = canEdit;
return _data;
}
}
class Login {
Login({
required this.verification,
required this.verificationMethod,
required this.forgetPassword,
});
late final bool verification;
late final VerificationMethod verificationMethod;
late final bool forgetPassword;
Login.fromJson(Map<String, dynamic> json) {
verification = json['verification'];
verificationMethod = VerificationMethod.fromJson(json['verificationMethod']);
forgetPassword = json['forgetPassword'];
}
Map<String, dynamic> toJson() {
var _data = <String, dynamic>{};
_data['verification'] = verification;
_data['verificationMethod'] = verificationMethod.toJson();
_data['forgetPassword'] = forgetPassword;
return _data;
}
}
class VerificationMethod {
VerificationMethod({
required this.whatsapp,
});
late final bool whatsapp;
VerificationMethod.fromJson(Map<String, dynamic> json) {
whatsapp = json['whatsapp'];
}
Map<String, dynamic> toJson() {
var _data = <String, dynamic>{};
_data['whatsapp'] = whatsapp;
return _data;
}
}
class Dashboard {
Dashboard({
required this.attendance,
required this.worklist,
required this.ticketBalance,
required this.leaveBalance,
required this.missingSwipe,
required this.monthlyAttendance,
required this.vocationRules,
});
late final bool attendance;
late final bool worklist;
late final bool ticketBalance;
late final bool leaveBalance;
late final bool missingSwipe;
late final bool monthlyAttendance;
late final bool vocationRules;
Dashboard.fromJson(Map<String, dynamic> json) {
attendance = json['attendance'];
worklist = json['worklist'];
ticketBalance = json['ticketBalance'];
leaveBalance = json['leaveBalance'];
missingSwipe = json['missingSwipe'];
monthlyAttendance = json['monthlyAttendance'];
vocationRules = json['vocationRules'];
}
Map<String, dynamic> toJson() {
var _data = <String, dynamic>{};
_data['attendance'] = attendance;
_data['worklist'] = worklist;
_data['ticketBalance'] = ticketBalance;
_data['leaveBalance'] = leaveBalance;
_data['missingSwipe'] = missingSwipe;
_data['monthlyAttendance'] = monthlyAttendance;
_data['vocationRules'] = vocationRules;
return _data;
}
}

@ -1,7 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/ui/app_update_screen.dart'; import 'package:mohem_flutter_app/ui/app_update_screen.dart';
import 'package:mohem_flutter_app/ui/attendance/add_vacation_rule_screen.dart'; import 'package:mohem_flutter_app/ui/attendance/add_vacation_rule_screen.dart';
import 'package:mohem_flutter_app/ui/attendance/moe_monthly_attendance_screen.dart';
import 'package:mohem_flutter_app/ui/attendance/monthly_attendance_screen.dart'; import 'package:mohem_flutter_app/ui/attendance/monthly_attendance_screen.dart';
import 'package:mohem_flutter_app/ui/attendance/vacation_rule_screen.dart'; import 'package:mohem_flutter_app/ui/attendance/vacation_rule_screen.dart';
import 'package:mohem_flutter_app/ui/bottom_sheets/attendence_details_bottom_sheet.dart'; import 'package:mohem_flutter_app/ui/bottom_sheets/attendence_details_bottom_sheet.dart';
@ -46,8 +45,6 @@ import 'package:mohem_flutter_app/ui/profile/delete_family_member.dart';
import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_address_screen.dart'; import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_address_screen.dart';
import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_basic_details_screen.dart'; import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_basic_details_screen.dart';
import 'package:mohem_flutter_app/ui/profile/family_members.dart'; import 'package:mohem_flutter_app/ui/profile/family_members.dart';
import 'package:mohem_flutter_app/ui/profile/help_screen.dart';
import 'package:mohem_flutter_app/ui/profile/hierarchy_screen.dart';
import 'package:mohem_flutter_app/ui/profile/personal_info.dart'; import 'package:mohem_flutter_app/ui/profile/personal_info.dart';
import 'package:mohem_flutter_app/ui/profile/profile_screen.dart'; import 'package:mohem_flutter_app/ui/profile/profile_screen.dart';
import 'package:mohem_flutter_app/ui/screens/announcements/announcement_details.dart'; import 'package:mohem_flutter_app/ui/screens/announcements/announcement_details.dart';
@ -195,8 +192,6 @@ class AppRoutes {
static const String unsafeDeviceScreen = "/unsafeDeviceScreen"; static const String unsafeDeviceScreen = "/unsafeDeviceScreen";
static const String appUpdateScreen = "/appUpdateScreen"; static const String appUpdateScreen = "/appUpdateScreen";
static const String help = "/help";
static const String hierarchy = "/hierarchy";
static final Map<String, WidgetBuilder> routes = { static final Map<String, WidgetBuilder> routes = {
login: (BuildContext context) => LoginScreen(), login: (BuildContext context) => LoginScreen(),
@ -231,8 +226,7 @@ class AppRoutes {
// addWorkFromHome: (BuildContext context) => AddWorkFromHomeScreen(), // addWorkFromHome: (BuildContext context) => AddWorkFromHomeScreen(),
profile: (BuildContext context) => ProfileScreen(), profile: (BuildContext context) => ProfileScreen(),
//Attendance //Attendance
// monthlyAttendance: (BuildContext context) => MonthlyAttendanceScreen(), monthlyAttendance: (BuildContext context) => MonthlyAttendanceScreen(),
monthlyAttendance: (BuildContext context) => MoeMonthlyAttendanceScreen(),
vacationRule: (BuildContext context) => VacationRuleScreen(), vacationRule: (BuildContext context) => VacationRuleScreen(),
addVacationRule: (BuildContext context) => AddVacationRuleScreen(), addVacationRule: (BuildContext context) => AddVacationRuleScreen(),
@ -309,7 +303,5 @@ class AppRoutes {
unsafeDeviceScreen: (BuildContext context) => const UnsafeDeviceScreen(), unsafeDeviceScreen: (BuildContext context) => const UnsafeDeviceScreen(),
appUpdateScreen: (BuildContext context) => const AppUpdateScreen(), appUpdateScreen: (BuildContext context) => const AppUpdateScreen(),
help: (BuildContext context) => HelpScreen(),
hierarchy: (BuildContext context) => HierarchyScreen(),
}; };
} }

@ -9,6 +9,7 @@ import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/otp_widget.dart'; import 'package:mohem_flutter_app/widgets/otp_widget.dart';
import 'package:sizer/sizer.dart';
final ValueNotifier<String> otpFieldClear = ValueNotifier<String>(""); final ValueNotifier<String> otpFieldClear = ValueNotifier<String>("");

@ -114,7 +114,6 @@ extension EmailValidator on String {
Widget toText16({Color? color, bool isUnderLine = false, bool isBold = false, int? maxlines, double? height}) => Text( Widget toText16({Color? color, bool isUnderLine = false, bool isBold = false, int? maxlines, double? height}) => Text(
this, this,
maxLines: maxlines, maxLines: maxlines,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: color ?? MyColors.darkTextColor, color: color ?? MyColors.darkTextColor,
fontSize: 16, fontSize: 16,
@ -159,15 +158,13 @@ extension EmailValidator on String {
style: TextStyle(height: 1, color: color ?? MyColors.darkTextColor, fontSize: 22, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), style: TextStyle(height: 1, color: color ?? MyColors.darkTextColor, fontSize: 22, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
); );
Widget toText24({Color? color, bool isBold = false, bool isCentered = false}) => Text( Widget toText24({Color? color, bool isBold = false}) => Text(
this, this,
textAlign: isCentered ? TextAlign.center : null,
style: TextStyle(height: 23 / 24, color: color ?? MyColors.darkTextColor, fontSize: 24, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), style: TextStyle(height: 23 / 24, color: color ?? MyColors.darkTextColor, fontSize: 24, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
); );
Widget toText30({Color? color, bool isBold = false, bool isCentered = false}) => Text( Widget toText30({Color? color, bool isBold = false}) => Text(
this, this,
textAlign: isCentered ? TextAlign.center : null,
style: TextStyle(height: 20 / 32, color: color ?? MyColors.darkTextColor, fontSize: 32, letterSpacing: -1.2, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), style: TextStyle(height: 20 / 32, color: color ?? MyColors.darkTextColor, fontSize: 32, letterSpacing: -1.2, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
); );
@ -222,7 +219,7 @@ extension EmailValidator on String {
String date = this.split("T")[0]; String date = this.split("T")[0];
String time = this.split("T")[1]; String time = this.split("T")[1];
var dates = date.split("-"); var dates = date.split("-");
return "${dates[2]} ${getMonth(int.parse(dates[1]))} ${dates[0]} ${DateFormat('hh:mm a', "en_US").format(DateFormat('hh:mm:ss', "en_US").parse(time))}"; return "${dates[2]} ${getMonth(int.parse(dates[1]))} ${dates[0]} ${DateFormat('hh:mm a').format(DateFormat('hh:mm:ss').parse(time))}";
} }
String getMonth(int month) { String getMonth(int month) {

@ -41,7 +41,6 @@ class CodegenLoader extends AssetLoader{
"checkIn": "تحقق في", "checkIn": "تحقق في",
"workList": "قائمة العمل", "workList": "قائمة العمل",
"leaveBalance": "رصيد الاجازات", "leaveBalance": "رصيد الاجازات",
"businessTripBalance": "رصيد رحلة العمل",
"missingSwipes": "تسجيل بصمة حضور", "missingSwipes": "تسجيل بصمة حضور",
"ticketBalance": "رصيد التذكرة", "ticketBalance": "رصيد التذكرة",
"other": "آخر", "other": "آخر",
@ -534,29 +533,11 @@ class CodegenLoader extends AssetLoader{
"startingIn": "يبدأ في", "startingIn": "يبدأ في",
"youAreOutOfContest": "أنت خارج المسابقة.", "youAreOutOfContest": "أنت خارج المسابقة.",
"winners": "الفائزين!!!", "winners": "الفائزين!!!",
"expireAfter": "تنتهي بعد",
"oneWeek": "أسبوع 1",
"twoWeek": "2 أسبوع",
"noUpcoming": "لا يوجد قادم", "noUpcoming": "لا يوجد قادم",
"fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية", "fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية",
"noWinner": "حزين! لم يفز أحد اليوم.", "noWinner": "حزين! لم يفز أحد اليوم.",
"myTeam": "فريقي", "myTeam": "فريقي",
"youCanPlayDemo": "لكن يمكنك لعب العرض", "youCanPlayDemo": "لكن يمكنك لعب العرض"
"qualification": "مؤهلات",
"esteblishmentName": "اسم المؤسسة",
"gradeDescription": "وصف الصف",
"type": "يكتب",
"status": "حالة",
"leaveType": "نوع الإجازة",
"attendanceType": "نوع الحضور",
"help": "يساعد",
"dear": "عزيزي",
"assistant": "للحصول على المساعدة ، يمكنك تقديم الطلب على نظام سعيد أو الاتصال بمركز الاتصال الموحد على 8310200",
"employee_leaves_calender": "تقويم أوراق الموظفين",
"view_your_leave_information": "عرض معلومات إجازتك",
"view_details": "عرض التفاصيل",
"create_absence_request": "إنشاء طلب الغياب",
"business_mission": "طلب مهمة العمل"
}; };
static const Map<String,dynamic> en_US = { static const Map<String,dynamic> en_US = {
"mohemm": "Mohemm", "mohemm": "Mohemm",
@ -585,7 +566,6 @@ static const Map<String,dynamic> en_US = {
"checkIn": "Check In", "checkIn": "Check In",
"workList": "Work List", "workList": "Work List",
"leaveBalance": "Leave Balance", "leaveBalance": "Leave Balance",
"businessTripBalance": "Business Trip Balance",
"missingSwipes": "Missing Swipes", "missingSwipes": "Missing Swipes",
"ticketBalance": "Ticket Balance", "ticketBalance": "Ticket Balance",
"other": "Other", "other": "Other",
@ -1078,29 +1058,11 @@ static const Map<String,dynamic> en_US = {
"startingIn": "Starting in", "startingIn": "Starting in",
"youAreOutOfContest": "You are out of the contest.", "youAreOutOfContest": "You are out of the contest.",
"winners": "WINNERS!!!", "winners": "WINNERS!!!",
"expireAfter": "Expires After",
"oneWeek": "1 Week",
"twoWeek": "2 Week",
"noUpcoming": "There is no upcoming", "noUpcoming": "There is no upcoming",
"fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.", "fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.",
"noWinner": "Sad! No one won today.", "noWinner": "Sad! No one won today.",
"myTeam": "My Team", "myTeam": "My Team",
"youCanPlayDemo": "But you can play demo", "youCanPlayDemo": "But you can play demo"
"qualification": "Qualifications",
"esteblishmentName": "Establishment Name",
"gradeDescription": "Grade Description",
"type": "Type",
"status": "Status",
"leaveType": "Leave Type",
"attendanceType": "Attendance Type",
"help": "Help",
"dear": "Dear",
"assistant": "For assistance, you can submit the request on the Saeed system or call the unified call center on 8310200",
"employee_leaves_calender": "Employee Leaves Calender",
"view_your_leave_information": "View Your Leave Information",
"view_details": "View Details",
"create_absence_request": "Create Absence Request",
"business_mission": "Business Mission Request"
}; };
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};
} }

@ -1,6 +1,6 @@
// DO NOT EDIT. This is code generated via package:easy_localization/generate.dart // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart
abstract class LocaleKeys { abstract class LocaleKeys {
static const mohemm = 'mohemm'; static const mohemm = 'mohemm';
static const english = 'english'; static const english = 'english';
static const arabic = 'arabic'; static const arabic = 'arabic';
@ -27,7 +27,6 @@ abstract class LocaleKeys {
static const checkIn = 'checkIn'; static const checkIn = 'checkIn';
static const workList = 'workList'; static const workList = 'workList';
static const leaveBalance = 'leaveBalance'; static const leaveBalance = 'leaveBalance';
static const businessTripBalance = 'businessTripBalance';
static const missingSwipes = 'missingSwipes'; static const missingSwipes = 'missingSwipes';
static const ticketBalance = 'ticketBalance'; static const ticketBalance = 'ticketBalance';
static const services = 'services'; static const services = 'services';
@ -251,7 +250,7 @@ abstract class LocaleKeys {
static const Payroll = 'Payroll'; static const Payroll = 'Payroll';
static const civilIdentityNumber = 'civilIdentityNumber'; static const civilIdentityNumber = 'civilIdentityNumber';
static const dateOfBirth = 'dateOfBirth'; static const dateOfBirth = 'dateOfBirth';
static const maritalStatus = 'maritalStatus '; static const maritalStatus = 'maritalStatus ';
static const fullName = 'fullName'; static const fullName = 'fullName';
static const remove = 'remove'; static const remove = 'remove';
static const submit = 'submit'; static const submit = 'submit';
@ -281,7 +280,7 @@ abstract class LocaleKeys {
static const enterNewInfo = 'enterNewInfo'; static const enterNewInfo = 'enterNewInfo';
static const endDate = 'endDate'; static const endDate = 'endDate';
static const removeThisMember = 'removeThisMember'; static const removeThisMember = 'removeThisMember';
static const wantUpdateThisMember = 'wantUpdateThisMember '; static const wantUpdateThisMember = 'wantUpdateThisMember ';
static const addNewFamilyMember = 'addNewFamilyMember'; static const addNewFamilyMember = 'addNewFamilyMember';
static const addRow = 'addRow'; static const addRow = 'addRow';
static const pleaseSelect = 'pleaseSelect'; static const pleaseSelect = 'pleaseSelect';
@ -504,30 +503,12 @@ abstract class LocaleKeys {
static const startingIn = 'startingIn'; static const startingIn = 'startingIn';
static const youAreOutOfContest = 'youAreOutOfContest'; static const youAreOutOfContest = 'youAreOutOfContest';
static const winners = 'winners'; static const winners = 'winners';
static const noUpcoming = 'noUpcoming';
static const fakeLocation = 'fakeLocation';
static const expireAfter = 'expireAfter'; static const expireAfter = 'expireAfter';
static const oneWeek = 'oneWeek'; static const oneWeek = 'oneWeek';
static const twoWeek = 'twoWeek'; static const twoWeek = 'twoWeek';
static const noUpcoming = 'noUpcoming';
static const fakeLocation = 'fakeLocation';
static const noWinner = 'noWinner'; static const noWinner = 'noWinner';
static const myTeam = 'myTeam'; static const myTeam = 'myTeam';
static const youCanPlayDemo = 'youCanPlayDemo'; static const youCanPlayDemo = 'youCanPlayDemo';
static const qualification = 'qualification';
static const esteblishmentName = 'esteblishmentName';
static const gradeDescription = 'gradeDescription';
static const type = 'type';
static const status = 'status';
static const leaveType = 'leaveType';
static const attendanceType = 'attendanceType';
static const help = 'help';
static const dear = 'dear';
static const assistant = 'assistant';
static const employee_leaves_calender = 'employee_leaves_calender';
static const view_your_leave_information = 'view_your_leave_information';
static const view_details = 'view_details';
static const notices = 'notices';
static const hierarchy = 'hierarchy';
static const create_absence_request = 'create_absence_request';
static const business_mission = 'business_mission';
} }

@ -6,11 +6,9 @@ import 'package:flutter/services.dart';
import 'package:logger/logger.dart'; import 'package:logger/logger.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/consts.dart'; import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/config/env.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/generated/codegen_loader.g.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/models/post_params_model.dart';
import 'package:mohem_flutter_app/provider/chat_call_provider.dart';
import 'package:mohem_flutter_app/provider/chat_provider_model.dart'; import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/provider/eit_provider_model.dart'; import 'package:mohem_flutter_app/provider/eit_provider_model.dart';
@ -22,11 +20,14 @@ import 'package:provider/single_child_widget.dart';
import 'package:sizer/sizer.dart'; import 'package:sizer/sizer.dart';
Logger logger = Logger( Logger logger = Logger(
// filter: null, // Use the default LogFilter (-> only log in debug mode)
printer: PrettyPrinter( printer: PrettyPrinter(
lineLength: 0, lineLength: 0,
), ), // Use the PrettyPrinter to format and print log
// output: null, // U
); );
class MyHttpOverrides extends HttpOverrides { class MyHttpOverrides extends HttpOverrides {
@override @override
HttpClient createHttpClient(SecurityContext? context) { HttpClient createHttpClient(SecurityContext? context) {
@ -63,17 +64,12 @@ Future<void> main() async {
ChangeNotifierProvider<EITProviderModel>( ChangeNotifierProvider<EITProviderModel>(
create: (_) => EITProviderModel(), create: (_) => EITProviderModel(),
), ),
if (env.chat) ChangeNotifierProvider<ChatProviderModel>(
ChangeNotifierProvider<ChatProviderModel>( create: (_) => ChatProviderModel(),
create: (_) => ChatProviderModel(), ),
), ChangeNotifierProvider<MarathonProvider>(
if (env.marathon) create: (_) => MarathonProvider(),
ChangeNotifierProvider<MarathonProvider>( )
create: (_) => MarathonProvider(),
),
// ChangeNotifierProvider<ChatCallProvider>(
// create: (_) => ChatCallProvider(),
// ),
], ],
child: const MyApp(), child: const MyApp(),
), ),
@ -265,3 +261,4 @@ class MyApp extends StatelessWidget {
// }); // });
// } // }
// } // }

@ -7,191 +7,127 @@ import 'dart:convert';
class CallDataModel { class CallDataModel {
CallDataModel({ CallDataModel({
this.callerId, this.callerId,
this.callerDetails, this.callReceiverID,
this.receiverId, this.notificationForeground,
this.receiverDetails, this.message,
this.title, this.title,
this.calltype, this.type,
this.identity,
this.name,
this.isCall,
this.isWebrtc,
this.contant,
this.contantNo,
this.chatEventId,
this.fileTypeId,
this.currentUserId,
this.chatSource,
this.userChatHistoryLineRequestList,
this.server,
}); });
String? callerId; String? callerId;
CallerDetails? callerDetails; String? callReceiverID;
String? receiverId; String? notificationForeground;
ReceiverDetails? receiverDetails; String? message;
dynamic title; String? title;
String? calltype; String? type;
String? identity;
String? name;
String? isCall;
String? isWebrtc;
String? contant;
String? contantNo;
String? chatEventId;
dynamic? fileTypeId;
String? currentUserId;
String? chatSource;
List<UserChatHistoryLineRequestList>? userChatHistoryLineRequestList;
String? server;
factory CallDataModel.fromRawJson(String str) => CallDataModel.fromJson(json.decode(str)); factory CallDataModel.fromRawJson(String str) => CallDataModel.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson()); String toRawJson() => json.encode(toJson());
factory CallDataModel.fromJson(Map<String, dynamic> json) => CallDataModel( factory CallDataModel.fromJson(Map<String, dynamic> json) => CallDataModel(
callerId: json["callerID"], callerId: json["callerID"] == null ? null : json["callerID"],
callerDetails: json["callerDetails"] == null ? null : CallerDetails.fromJson(json["callerDetails"]), callReceiverID: json["callReceiverID"] == null ? null : json["callReceiverID"],
receiverId: json["receiverID"], notificationForeground: json["notification_foreground"] == null ? null : json["notification_foreground"],
receiverDetails: json["receiverDetails"] == null ? null : ReceiverDetails.fromJson(json["receiverDetails"]), message: json["message"] == null ? null : json["message"],
title: json["title"], title: json["title"] == null ? null : json["title"],
calltype: json["calltype"], type: json["type"] == null ? null : json["type"],
); identity: json["identity"] == null ? null : json["identity"],
name: json["name"] == null ? null : json["name"],
Map<String, dynamic> toJson() => { isCall: json["is_call"] == null ? null : json["is_call"],
"callerID": callerId, isWebrtc: json["is_webrtc"] == null ? null : json["is_webrtc"],
"callerDetails": callerDetails?.toJson(), contant: json["contant"] == null ? null : json["contant"],
"receiverID": receiverId, contantNo: json["contantNo"] == null ? null : json["contantNo"],
"receiverDetails": receiverDetails?.toJson(), chatEventId: json["chatEventId"] == null ? null : json["chatEventId"],
"title": title, fileTypeId: json["fileTypeId"],
"calltype": calltype, currentUserId: json["currentUserId"] == null ? null : json["currentUserId"],
}; chatSource: json["chatSource"] == null ? null : json["chatSource"],
} userChatHistoryLineRequestList: json["userChatHistoryLineRequestList"] == null
? null
class CallerDetails { : List<UserChatHistoryLineRequestList>.from(
CallerDetails({ json["userChatHistoryLineRequestList"].map(
this.response, (x) => UserChatHistoryLineRequestList.fromJson(x),
this.errorResponses, ),
}); ),
server: json["server"] == null ? null : json["server"],
Response? response; );
dynamic errorResponses;
factory CallerDetails.fromRawJson(String str) => CallerDetails.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory CallerDetails.fromJson(Map<String, dynamic> json) => CallerDetails(
response: json["response"] == null ? null : Response.fromJson(json["response"]),
errorResponses: json["errorResponses"],
);
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"response": response?.toJson(), "callerID": callerId == null ? null : callerId,
"errorResponses": errorResponses, "callReceiverID": callReceiverID == null ? null : callReceiverID,
}; "notification_foreground": notificationForeground == null ? null : notificationForeground,
"message": message == null ? null : message,
"title": title == null ? null : title,
"type": type == null ? null : type,
"identity": identity == null ? null : identity,
"name": name == null ? null : name,
"is_call": isCall == null ? null : isCall,
"is_webrtc": isWebrtc == null ? null : isWebrtc,
"contant": contant == null ? null : contant,
"contantNo": contantNo == null ? null : contantNo,
"chatEventId": chatEventId == null ? null : chatEventId,
"fileTypeId": fileTypeId,
"currentUserId": currentUserId == null ? null : currentUserId,
"chatSource": chatSource == null ? null : chatSource,
"userChatHistoryLineRequestList": userChatHistoryLineRequestList == null
? null
: List<dynamic>.from(
userChatHistoryLineRequestList!.map(
(x) => x.toJson(),
),
),
"server": server == null ? null : server,
};
} }
class Response { class UserChatHistoryLineRequestList {
Response({ UserChatHistoryLineRequestList({
this.id, this.isSeen,
this.userName, this.isDelivered,
this.email, this.targetUserId,
this.phone, this.targetUserStatus,
this.title,
this.token,
this.isDomainUser,
this.isActiveCode,
this.encryptedUserId,
this.encryptedUserName,
}); });
int? id; bool? isSeen;
String? userName; bool? isDelivered;
String? email; int? targetUserId;
dynamic phone; int? targetUserStatus;
String? title;
String? token;
bool? isDomainUser;
bool? isActiveCode;
String? encryptedUserId;
String? encryptedUserName;
factory Response.fromRawJson(String str) => Response.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory Response.fromJson(Map<String, dynamic> json) => Response(
id: json["id"],
userName: json["userName"],
email: json["email"],
phone: json["phone"],
title: json["title"],
token: json["token"],
isDomainUser: json["isDomainUser"],
isActiveCode: json["isActiveCode"],
encryptedUserId: json["encryptedUserId"],
encryptedUserName: json["encryptedUserName"],
);
Map<String, dynamic> toJson() => {
"id": id,
"userName": userName,
"email": email,
"phone": phone,
"title": title,
"token": token,
"isDomainUser": isDomainUser,
"isActiveCode": isActiveCode,
"encryptedUserId": encryptedUserId,
"encryptedUserName": encryptedUserName,
};
}
class ReceiverDetails {
ReceiverDetails({
this.id,
this.userName,
this.email,
this.phone,
this.title,
this.userStatus,
this.image,
this.unreadMessageCount,
this.userAction,
this.isPin,
this.isFav,
this.isAdmin,
this.rKey,
this.totalCount,
});
int? id;
String? userName;
String? email;
dynamic phone;
dynamic title;
int? userStatus;
String? image;
int? unreadMessageCount;
dynamic userAction;
bool? isPin;
bool? isFav;
bool? isAdmin;
String? rKey;
int? totalCount;
factory ReceiverDetails.fromRawJson(String str) => ReceiverDetails.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory ReceiverDetails.fromJson(Map<String, dynamic> json) => ReceiverDetails( factory UserChatHistoryLineRequestList.fromJson(Map<String, dynamic> json) => UserChatHistoryLineRequestList(
id: json["id"], isSeen: json["isSeen"] == null ? null : json["isSeen"],
userName: json["userName"], isDelivered: json["isDelivered"] == null ? null : json["isDelivered"],
email: json["email"], targetUserId: json["targetUserId"] == null ? null : json["targetUserId"],
phone: json["phone"], targetUserStatus: json["targetUserStatus"] == null ? null : json["targetUserStatus"],
title: json["title"], );
userStatus: json["userStatus"],
image: json["image"],
unreadMessageCount: json["unreadMessageCount"],
userAction: json["userAction"],
isPin: json["isPin"],
isFav: json["isFav"],
isAdmin: json["isAdmin"],
rKey: json["rKey"],
totalCount: json["totalCount"],
);
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"id": id, "isSeen": isSeen == null ? null : isSeen,
"userName": userName, "isDelivered": isDelivered == null ? null : isDelivered,
"email": email, "targetUserId": targetUserId == null ? null : targetUserId,
"phone": phone, "targetUserStatus": targetUserStatus == null ? null : targetUserStatus,
"title": title, };
"userStatus": userStatus,
"image": image,
"unreadMessageCount": unreadMessageCount,
"userAction": userAction,
"isPin": isPin,
"isFav": isFav,
"isAdmin": isAdmin,
"rKey": rKey,
"totalCount": totalCount,
};
} }

@ -2,8 +2,6 @@ class DrawerMenuItem {
String icon; String icon;
String title; String title;
String routeName; String routeName;
int? requestGroupId;
String? requestGroupName;
DrawerMenuItem(this.icon, this.title, this.routeName, {this.requestGroupId, this.requestGroupName}); DrawerMenuItem(this.icon, this.title, this.routeName);
} }

@ -1,45 +0,0 @@
// To parse this JSON data, do
//
// final employeeLeavesList = employeeLeavesListFromJson(jsonString);
import 'dart:convert';
EmployeeLeavesList employeeLeavesListFromJson(String str) => EmployeeLeavesList.fromJson(json.decode(str));
String employeeLeavesListToJson(EmployeeLeavesList data) => json.encode(data.toJson());
class EmployeeLeavesList {
EmployeeLeavesList({
this.absenceAttendanceTypeName,
this.dateEnd,
this.dateStart,
this.eventDate,
this.holidayType,
this.leaveType,
});
String? absenceAttendanceTypeName;
String? dateEnd;
String? dateStart;
String? eventDate;
String? holidayType;
String? leaveType;
factory EmployeeLeavesList.fromJson(Map<String, dynamic> json) => EmployeeLeavesList(
absenceAttendanceTypeName: json["ABSENCE_ATTENDANCE_TYPE_NAME"],
dateEnd: json["DATE_END"],
dateStart: json["DATE_START"],
eventDate: json["EVENT_DATE"],
holidayType: json["HOLIDAY_TYPE"],
leaveType: json["LEAVE_TYPE"],
);
Map<String, dynamic> toJson() => {
"ABSENCE_ATTENDANCE_TYPE_NAME": absenceAttendanceTypeName,
"DATE_END": dateEnd,
"DATE_START": dateStart,
"EVENT_DATE": eventDate,
"HOLIDAY_TYPE": holidayType,
"LEAVE_TYPE": leaveType,
};
}

@ -8,7 +8,6 @@ import 'package:mohem_flutter_app/models/dashboard/get_open_notifications_list.d
import 'package:mohem_flutter_app/models/dashboard/list_menu.dart'; import 'package:mohem_flutter_app/models/dashboard/list_menu.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart'; import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/models/dashboard/mohemm_itg_pending_task_responseitem.dart'; import 'package:mohem_flutter_app/models/dashboard/mohemm_itg_pending_task_responseitem.dart';
import 'package:mohem_flutter_app/models/employee_leaves_list.dart';
import 'package:mohem_flutter_app/models/get_absence_collection_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/get_absence_collection_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_action_history_list_model.dart'; import 'package:mohem_flutter_app/models/get_action_history_list_model.dart';
import 'package:mohem_flutter_app/models/get_approves_list_model.dart'; import 'package:mohem_flutter_app/models/get_approves_list_model.dart';
@ -36,7 +35,6 @@ import 'package:mohem_flutter_app/models/get_stamp_ms_notification_body_list_mod
import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart';
import 'package:mohem_flutter_app/models/get_user_item_type_list.dart'; import 'package:mohem_flutter_app/models/get_user_item_type_list.dart';
import 'package:mohem_flutter_app/models/hierarchy_lists.dart';
import 'package:mohem_flutter_app/models/leave_balance/calculate_absence_duration_model.dart'; import 'package:mohem_flutter_app/models/leave_balance/calculate_absence_duration_model.dart';
import 'package:mohem_flutter_app/models/leave_balance/cancel_hr_transaction_list_model.dart'; import 'package:mohem_flutter_app/models/leave_balance/cancel_hr_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/leave_balance/get_absence_attendance_types_list_model.dart'; import 'package:mohem_flutter_app/models/leave_balance/get_absence_attendance_types_list_model.dart';
@ -75,7 +73,6 @@ import 'package:mohem_flutter_app/models/performance.dart';
import 'package:mohem_flutter_app/models/privilege_list_model.dart'; import 'package:mohem_flutter_app/models/privilege_list_model.dart';
import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.dart';
import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart';
import 'package:mohem_flutter_app/models/profile/employee_qualifications_list.dart';
import 'package:mohem_flutter_app/models/profile/get_address_dff_structure_list.dart'; import 'package:mohem_flutter_app/models/profile/get_address_dff_structure_list.dart';
import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart';
import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart';
@ -199,7 +196,6 @@ class GenericResponseModel {
List<GetEmployeeBasicDetailsList>? getEmployeeBasicDetailsList; List<GetEmployeeBasicDetailsList>? getEmployeeBasicDetailsList;
List<GetEmployeeContactsList>? getEmployeeContactsList; List<GetEmployeeContactsList>? getEmployeeContactsList;
List<GetEmployeePhonesList>? getEmployeePhonesList; List<GetEmployeePhonesList>? getEmployeePhonesList;
List<EmployeeQualificationsList>? getEmployeeQualificationsList;
List<GetEmployeeSubordinatesList>? getEmployeeSubordinatesList; List<GetEmployeeSubordinatesList>? getEmployeeSubordinatesList;
List<String>? getFliexfieldStructureList; List<String>? getFliexfieldStructureList;
List<String>? getHrCollectionNotificationBodyList; List<String>? getHrCollectionNotificationBodyList;
@ -253,7 +249,6 @@ class GenericResponseModel {
List<GetTermDffStructureList>? getTermDffStructureList; List<GetTermDffStructureList>? getTermDffStructureList;
List<String>? getTermNotificationBodyList; List<String>? getTermNotificationBodyList;
List<GetTimeCardSummaryList>? getTimeCardSummaryList; List<GetTimeCardSummaryList>? getTimeCardSummaryList;
List<EmployeeLeavesList>? getEmployeeLeavesList;
List<GetTicketsByEmployeeList>? getTicketsByEmployeeList; List<GetTicketsByEmployeeList>? getTicketsByEmployeeList;
List<GetTicketDetailsByEmployee>? getTicketDetailsByEmployee; List<GetTicketDetailsByEmployee>? getTicketDetailsByEmployee;
List<GetTicketTransactions>? getTicketTransactions; List<GetTicketTransactions>? getTicketTransactions;
@ -383,274 +378,269 @@ class GenericResponseModel {
String? ePharmacyGetItemOnHandList; String? ePharmacyGetItemOnHandList;
bool? isActiveCode; bool? isActiveCode;
bool? isSMSSent; bool? isSMSSent;
SupervisorHierarchyLists? supervisorHierarchyLists;
GenericResponseModel(
GenericResponseModel({ {this.date,
this.date, this.languageID,
this.languageID, this.serviceName,
this.serviceName, this.time,
this.time, this.androidLink,
this.androidLink, this.authenticationTokenID,
this.authenticationTokenID, this.data,
this.data, this.dataw,
this.dataw, this.dietType,
this.dietType, this.dietTypeID,
this.dietTypeID, this.errorCode,
this.errorCode, this.errorEndUserMessage,
this.errorEndUserMessage, this.errorEndUserMessageN,
this.errorEndUserMessageN, this.errorMessage,
this.errorMessage, this.errorType,
this.errorType, this.foodCategory,
this.foodCategory, this.iOSLink,
this.iOSLink, this.isAuthenticated,
this.isAuthenticated, this.mealOrderStatus,
this.mealOrderStatus, this.mealType,
this.mealType, this.messageStatus,
this.messageStatus, this.numberOfResultRecords,
this.numberOfResultRecords, this.patientBlodType,
this.patientBlodType, this.successMsg,
this.successMsg, this.successMsgN,
this.successMsgN, this.vidaUpdatedResponse,
this.vidaUpdatedResponse, this.addAttSuccessList,
this.addAttSuccessList, this.addAttachmentList,
this.addAttachmentList, this.bCDomain,
this.bCDomain, this.bCLogo,
this.bCLogo, this.basicMemberInformation,
this.basicMemberInformation, this.businessCardPrivilege,
this.businessCardPrivilege, this.calculateAbsenceDuration,
this.calculateAbsenceDuration, this.cancelHRTransactionLIst,
this.cancelHRTransactionLIst, this.chatEmployeeLoginList,
this.chatEmployeeLoginList, this.companyBadge,
this.companyBadge, this.companyImage,
this.companyImage, this.companyImageDescription,
this.companyImageDescription, this.companyImageURL,
this.companyImageURL, this.companyMainCompany,
this.companyMainCompany, this.countryList,
this.countryList, this.createVacationRuleList,
this.createVacationRuleList, this.deleteAttachmentList,
this.deleteAttachmentList, this.deleteVacationRuleList,
this.deleteVacationRuleList, this.disableSessionList,
this.disableSessionList, this.employeeQR,
this.employeeQR, this.forgetPasswordTokenID,
this.forgetPasswordTokenID, this.getAbsenceAttachmentsList,
this.getAbsenceAttachmentsList, this.getAbsenceAttendanceTypesList,
this.getAbsenceAttendanceTypesList, this.getAbsenceCollectionNotificationBodyList,
this.getAbsenceCollectionNotificationBodyList, this.getAbsenceDffStructureList,
this.getAbsenceDffStructureList, this.getAbsenceTransactionList,
this.getAbsenceTransactionList, this.getAccrualBalancesList,
this.getAccrualBalancesList, this.getActionHistoryList,
this.getActionHistoryList, this.getAddressDffStructureList,
this.getAddressDffStructureList, this.getAddressNotificationBodyList,
this.getAddressNotificationBodyList, this.getApprovesList,
this.getApprovesList, this.getAttachementList,
this.getAttachementList, this.getAttendanceTrackingList,
this.getAttendanceTrackingList, this.getBasicDetColsStructureList,
this.getBasicDetColsStructureList, this.getBasicDetDffStructureList,
this.getBasicDetDffStructureList, this.getBasicDetNtfBodyList,
this.getBasicDetNtfBodyList, this.getCEICollectionNotificationBodyList,
this.getCEICollectionNotificationBodyList, this.getCEIDFFStructureList,
this.getCEIDFFStructureList, this.getCEITransactionList,
this.getCEITransactionList, this.getCcpTransactionsList,
this.getCcpTransactionsList, this.getCcpTransactionsListNew,
this.getCcpTransactionsListNew, this.getConcurrentProgramsList,
this.getConcurrentProgramsList, this.getContactColsStructureList,
this.getContactColsStructureList, this.getContactDetailsList,
this.getContactDetailsList, this.getContactDffStructureList,
this.getContactDffStructureList, this.getContactNotificationBodyList,
this.getContactNotificationBodyList, this.getCountriesList,
this.getCountriesList, this.getDayHoursTypeDetailsList,
this.getDayHoursTypeDetailsList, this.getDeductionsList,
this.getDeductionsList, this.getDefaultValueList,
this.getDefaultValueList, this.getEITCollectionNotificationBodyList,
this.getEITCollectionNotificationBodyList, this.getEITDFFStructureList,
this.getEITDFFStructureList, this.getEITTransactionList,
this.getEITTransactionList, this.getEarningsList,
this.getEarningsList, this.getEmployeeAddressList,
this.getEmployeeAddressList, this.getEmployeeBasicDetailsList,
this.getEmployeeBasicDetailsList, this.getEmployeeContactsList,
this.getEmployeeContactsList, this.getEmployeePhonesList,
this.getEmployeePhonesList, this.getEmployeeSubordinatesList,
this.getEmployeeQualificationsList, this.getFliexfieldStructureList,
this.getEmployeeSubordinatesList, this.getHrCollectionNotificationBodyList,
this.getFliexfieldStructureList, this.getHrTransactionList,
this.getHrCollectionNotificationBodyList, this.getItemCreationNtfBodyList,
this.getHrTransactionList, this.getItemTypeNotificationsList,
this.getItemCreationNtfBodyList, this.getItemTypesList,
this.getItemTypeNotificationsList, this.getLookupValuesList,
this.getItemTypesList, this.getMenuEntriesList,
this.getLookupValuesList, this.getMoItemHistoryList,
this.getMenuEntriesList, this.getMoNotificationBodyList,
this.getMoItemHistoryList, this.getNotificationButtonsList,
this.getMoNotificationBodyList, this.getNotificationReassignModeList,
this.getNotificationButtonsList, this.getObjectValuesList,
this.getNotificationReassignModeList, this.getOpenMissingSwipesList,
this.getObjectValuesList, this.getOpenNotificationsList,
this.getOpenMissingSwipesList, this.getOpenNotificationsNumList,
this.getOpenNotificationsList, this.getOpenPeriodDatesList,
this.getOpenNotificationsNumList, this.getOrganizationsSalariesList,
this.getOpenPeriodDatesList, this.getPaymentInformationList,
this.getOrganizationsSalariesList, this.getPayslipList,
this.getPaymentInformationList, this.getPerformanceAppraisalList,
this.getPayslipList, this.getPhonesNotificationBodyList,
this.getPerformanceAppraisalList, this.getPoItemHistoryList,
this.getPhonesNotificationBodyList, this.getPoNotificationBodyList,
this.getPoItemHistoryList, this.getPrNotificationBodyList,
this.getPoNotificationBodyList, this.getQuotationAnalysisList,
this.getPrNotificationBodyList, this.getRFCEmployeeListList,
this.getQuotationAnalysisList, this.getRespondAttributeValueList,
this.getRFCEmployeeListList, this.getSITCollectionNotificationBodyList,
this.getRespondAttributeValueList, this.getSITDFFStructureList,
this.getSITCollectionNotificationBodyList, this.getSITTransactionList,
this.getSITDFFStructureList, this.getScheduleShiftsDetailsList,
this.getSITTransactionList, this.getShiftTypesList,
this.getScheduleShiftsDetailsList, this.getStampMsNotificationBodyList,
this.getShiftTypesList, this.getStampNsNotificationBodyList,
this.getStampMsNotificationBodyList, this.getSubordinatesAttdStatusList,
this.getStampNsNotificationBodyList, this.getSubordinatesLeavesList,
this.getSubordinatesAttdStatusList, this.getSubordinatesLeavesTotalVacationsList,
this.getSubordinatesLeavesList, this.getSummaryOfPaymentList,
this.getSubordinatesLeavesTotalVacationsList, this.getSwipesList,
this.getSummaryOfPaymentList, this.getTermColsStructureList,
this.getSwipesList, this.getTermDffStructureList,
this.getTermColsStructureList, this.getTermNotificationBodyList,
this.getTermDffStructureList, this.getTimeCardSummaryList,
this.getTermNotificationBodyList, this.getTicketsByEmployeeList,
this.getTimeCardSummaryList, this.getTicketDetailsByEmployee,
this.getEmployeeLeavesList, this.getTicketTransactions,
this.getTicketsByEmployeeList, this.getTicketTypes,
this.getTicketDetailsByEmployee, this.getSectionTopics,
this.getTicketTransactions, this.getMowadhafhiProjects,
this.getTicketTypes, this.getProjectDepartments,
this.getSectionTopics, this.getDepartmentSections,
this.getMowadhafhiProjects, this.getPendingTransactionsFunctions,
this.getProjectDepartments, this.getPendingTransactionsDetails,
this.getDepartmentSections, this.getConcurrentProgramsModel,
this.getPendingTransactionsFunctions, this.getCCPTransactionsModel,
this.getPendingTransactionsDetails, this.getCCPOutputModel,
this.getConcurrentProgramsModel, this.getCCPDFFStructureModel,
this.getCCPTransactionsModel, this.getUserItemTypesList,
this.getCCPOutputModel, this.getVacationRulesList,
this.getCCPDFFStructureModel, this.getVaccinationOnHandList,
this.getUserItemTypesList, this.getVaccinationsList,
this.getVacationRulesList, this.getValueSetValuesList,
this.getVaccinationOnHandList, this.getWorkList,
this.getVaccinationsList, this.hRCertificateTemplate,
this.getValueSetValuesList, this.imgURLsList,
this.getWorkList, this.insertApInv,
this.hRCertificateTemplate, this.insertBooked,
this.imgURLsList, this.insertEmpSwipesList,
this.insertApInv, this.insertJournal,
this.insertBooked, this.insertOrders,
this.insertEmpSwipesList, this.intPortalGetEmployeeList,
this.insertJournal, this.isDeviceTokenEmpty,
this.insertOrders, this.isPasswordExpired,
this.intPortalGetEmployeeList, this.isRegisterAllowed,
this.isDeviceTokenEmpty, this.isRequriedValueSetEmpty,
this.isPasswordExpired, this.isUserSMSExcluded,
this.isRegisterAllowed, this.itemOnHand,
this.isRequriedValueSetEmpty, this.languageAvailable,
this.isUserSMSExcluded, this.listSupplier,
this.itemOnHand, this.listUserAgreement,
this.languageAvailable, this.listEITStrucrure,
this.listSupplier, this.listItemImagesDetails,
this.listUserAgreement, this.listItemMaster,
this.listEITStrucrure, this.listMedicineDetails,
this.listItemImagesDetails, this.listMenu,
this.listItemMaster, this.listNewEmployees,
this.listMedicineDetails, this.listRadScreen,
this.listMenu, this.logInTokenID,
this.listNewEmployees, this.memberInformationList,
this.listRadScreen, this.memberLoginList,
this.logInTokenID, this.mohemmGetBusinessCardEnabledList,
this.memberInformationList, this.mohemmGetFavoriteReplacementsList,
this.memberLoginList, this.mohemmGetMobileDeviceInfobyEmpInfoList,
this.mohemmGetBusinessCardEnabledList, this.mohemmGetMobileLoginInfoList,
this.mohemmGetFavoriteReplacementsList, this.mohemmGetPatientIDList,
this.mohemmGetMobileDeviceInfobyEmpInfoList, this.mohemmITGResponseItem,
this.mohemmGetMobileLoginInfoList, this.mohemmIsChangeIsActiveBusinessCardEnable,
this.mohemmGetPatientIDList, this.mohemmIsInsertBusinessCardEnable,
this.mohemmITGResponseItem, this.mohemmWifiPassword,
this.mohemmIsChangeIsActiveBusinessCardEnable, this.mohemmWifiSSID,
this.mohemmIsInsertBusinessCardEnable, this.notificationAction,
this.mohemmWifiPassword, this.notificationGetRespondAttributesList,
this.mohemmWifiSSID, this.notificationRespondRolesList,
this.notificationAction, this.oracleOutPutNumber,
this.notificationGetRespondAttributesList, this.pASSWORDEXPIREDMSG,
this.notificationRespondRolesList, this.pCOUNTRYCODE,
this.oracleOutPutNumber, this.pCOUNTRYNAME,
this.pASSWORDEXPIREDMSG, this.pDESCFLEXCONTEXTCODE,
this.pCOUNTRYCODE, this.pDESCFLEXCONTEXTNAME,
this.pCOUNTRYNAME, this.pForm,
this.pDESCFLEXCONTEXTCODE, this.pINFORMATION,
this.pDESCFLEXCONTEXTNAME, this.pMBLID,
this.pForm, this.pNUMOFSUBORDINATES,
this.pINFORMATION, this.pOPENNTFNUMBER,
this.pMBLID, this.pQUESTION,
this.pNUMOFSUBORDINATES, this.pSESSIONID,
this.pOPENNTFNUMBER, this.pSchema,
this.pQUESTION, this.pharmacyStockAddPharmacyStockList,
this.pSESSIONID, this.pharmacyStockGetOnHandList,
this.pSchema, this.privilegeList,
this.pharmacyStockAddPharmacyStockList, this.processTransactions,
this.pharmacyStockGetOnHandList, this.registerUserNameList,
this.privilegeList, this.replacementList,
this.processTransactions, this.respondAttributesList,
this.registerUserNameList, this.respondRolesList,
this.replacementList, this.resubmitAbsenceTransactionList,
this.respondAttributesList, this.resubmitEITTransactionList,
this.respondRolesList, this.resubmitHrTransactionList,
this.resubmitAbsenceTransactionList, this.sFHGetPoNotificationBodyList,
this.resubmitEITTransactionList, this.sFHGetPrNotificationBodyList,
this.resubmitHrTransactionList, this.startAbsenceApprovalProccess,
this.sFHGetPoNotificationBodyList, this.startAddressApprovalProcessList,
this.sFHGetPrNotificationBodyList, this.startBasicDetApprProcessList,
this.startAbsenceApprovalProccess, this.startCeiApprovalProcess,
this.startAddressApprovalProcessList, this.startContactApprovalProcessList,
this.startBasicDetApprProcessList, this.startEitApprovalProcess,
this.startCeiApprovalProcess, this.startHrApprovalProcessList,
this.startContactApprovalProcessList, this.startPhonesApprovalProcessList,
this.startEitApprovalProcess, this.startSitApprovalProcess,
this.startHrApprovalProcessList, this.startTermApprovalProcessList,
this.startPhonesApprovalProcessList, this.submitAddressTransactionList,
this.startSitApprovalProcess, this.submitBasicDetTransactionList,
this.startTermApprovalProcessList, this.submitCEITransactionList,
this.submitAddressTransactionList, this.submitCcpTransactionList,
this.submitBasicDetTransactionList, this.submitContactTransactionList,
this.submitCEITransactionList, this.submitEITTransactionList,
this.submitCcpTransactionList, this.submitHrTransactionList,
this.submitContactTransactionList, this.submitPhonesTransactionList,
this.submitEITTransactionList, this.submitSITTransactionList,
this.submitHrTransactionList, this.submitTermTransactionList,
this.submitPhonesTransactionList, this.subordinatesOnLeavesList,
this.submitSITTransactionList, this.sumbitAbsenceTransactionList,
this.submitTermTransactionList, this.tokenID,
this.subordinatesOnLeavesList, this.updateAttachmentList,
this.sumbitAbsenceTransactionList, this.updateEmployeeImageList,
this.tokenID, this.updateItemTypeSuccessList,
this.updateAttachmentList, this.updateUserItemTypesList,
this.updateEmployeeImageList, this.updateVacationRuleList,
this.updateItemTypeSuccessList, this.vHREmployeeLoginList,
this.updateUserItemTypesList, this.vHRGetEmployeeDetailsList,
this.updateVacationRuleList, this.vHRGetManagersDetailsList,
this.vHREmployeeLoginList, this.vHRGetProjectByCodeList,
this.vHRGetEmployeeDetailsList, this.vHRIsVerificationCodeValid,
this.vHRGetManagersDetailsList, this.validateAbsenceTransactionList,
this.vHRGetProjectByCodeList, this.validateEITTransactionList,
this.vHRIsVerificationCodeValid, this.validatePhonesTransactionList,
this.validateAbsenceTransactionList, this.vrItemTypesList,
this.validateEITTransactionList, this.wFLookUpList,
this.validatePhonesTransactionList, this.eLearningGETEMPLOYEEPROFILEList,
this.vrItemTypesList, this.eLearningLOGINList,
this.wFLookUpList, this.eLearningValidateLoginList,
this.eLearningGETEMPLOYEEPROFILEList, this.eLearningValidate_LoginList,
this.eLearningLOGINList, this.ePharmacyGetItemOnHandList,
this.eLearningValidateLoginList, this.isActiveCode,
this.eLearningValidate_LoginList, this.isSMSSent});
this.ePharmacyGetItemOnHandList,
this.isActiveCode,
this.isSMSSent,
this.supervisorHierarchyLists,
});
GenericResponseModel.fromJson(Map<String, dynamic> json) { GenericResponseModel.fromJson(Map<String, dynamic> json) {
date = json['Date']; date = json['Date'];
@ -899,12 +889,6 @@ class GenericResponseModel {
getEmployeePhonesList!.add(GetEmployeePhonesList.fromJson(v)); getEmployeePhonesList!.add(GetEmployeePhonesList.fromJson(v));
}); });
} }
if (json['EmployeeQualificationsList'] != null) {
getEmployeeQualificationsList = <EmployeeQualificationsList>[];
json['EmployeeQualificationsList'].forEach((v) {
getEmployeeQualificationsList!.add(EmployeeQualificationsList.fromJson(v));
});
}
if (json['GetEmployeeSubordinatesList'] != null) { if (json['GetEmployeeSubordinatesList'] != null) {
getEmployeeSubordinatesList = <GetEmployeeSubordinatesList>[]; getEmployeeSubordinatesList = <GetEmployeeSubordinatesList>[];
json['GetEmployeeSubordinatesList'].forEach((v) { json['GetEmployeeSubordinatesList'].forEach((v) {
@ -1079,12 +1063,6 @@ class GenericResponseModel {
getTimeCardSummaryList!.add(GetTimeCardSummaryList.fromJson(v)); getTimeCardSummaryList!.add(GetTimeCardSummaryList.fromJson(v));
}); });
} }
if (json['EmployeeLeavesList'] != null) {
getEmployeeLeavesList = <EmployeeLeavesList>[];
json['EmployeeLeavesList'].forEach((v) {
getEmployeeLeavesList!.add(EmployeeLeavesList.fromJson(v));
});
}
if (json['Mohemm_ITG_TicketsByEmployeeList'] != null) { if (json['Mohemm_ITG_TicketsByEmployeeList'] != null) {
getTicketsByEmployeeList = <GetTicketsByEmployeeList>[]; getTicketsByEmployeeList = <GetTicketsByEmployeeList>[];
@ -1313,7 +1291,7 @@ class GenericResponseModel {
if (json['RespondRolesList'] != null) { if (json['RespondRolesList'] != null) {
respondRolesList = <String>[]; respondRolesList = <String>[];
json['RespondRolesList'].forEach((v) { json['RespondRolesList'].forEach((v) {
// respondRolesList!.add(v); // respondRolesList!.add(v);
}); });
} }
resubmitAbsenceTransactionList = json['ResubmitAbsenceTransactionList']; resubmitAbsenceTransactionList = json['ResubmitAbsenceTransactionList'];
@ -1339,7 +1317,10 @@ class GenericResponseModel {
submitAddressTransactionList = json['SubmitAddressTransactionList'] != null ? SubmitAddressTransaction.fromJson(json['SubmitAddressTransactionList']) : null; submitAddressTransactionList = json['SubmitAddressTransactionList'] != null ? SubmitAddressTransaction.fromJson(json['SubmitAddressTransactionList']) : null;
submitBasicDetTransactionList = json['SubmitBasicDetTransactionList'] != null ? SubmitBasicDetailsTransactionList.fromJson(json['SubmitBasicDetTransactionList']) : null; submitBasicDetTransactionList = json['SubmitBasicDetTransactionList'] != null ? SubmitBasicDetailsTransactionList.fromJson(json['SubmitBasicDetTransactionList']) : null;
submitCEITransactionList = json['SubmitCEITransactionList']; submitCEITransactionList = json['SubmitCEITransactionList'];
submitCcpTransactionList = json['SubmitCcpTransactionList'] != null ? new SubmitCcpTransactionList.fromJson(json['SubmitCcpTransactionList']) : null; submitCcpTransactionList = json['SubmitCcpTransactionList'] != null
? new SubmitCcpTransactionList.fromJson(
json['SubmitCcpTransactionList'])
: null;
submitContactTransactionList = json['SubmitContactTransactionList'] != null ? SubmitContactTransactionList.fromJson(json['SubmitContactTransactionList']) : null; submitContactTransactionList = json['SubmitContactTransactionList'] != null ? SubmitContactTransactionList.fromJson(json['SubmitContactTransactionList']) : null;
submitEITTransactionList = json['SubmitEITTransactionList'] != null ? SubmitEITTransactionList.fromJson(json['SubmitEITTransactionList']) : null; submitEITTransactionList = json['SubmitEITTransactionList'] != null ? SubmitEITTransactionList.fromJson(json['SubmitEITTransactionList']) : null;
@ -1399,8 +1380,6 @@ class GenericResponseModel {
ePharmacyGetItemOnHandList = json['ePharmacy_GetItemOnHandList']; ePharmacyGetItemOnHandList = json['ePharmacy_GetItemOnHandList'];
isActiveCode = json['isActiveCode']; isActiveCode = json['isActiveCode'];
isSMSSent = json['isSMSSent']; isSMSSent = json['isSMSSent'];
supervisorHierarchyLists= json["SupervisorHierarchyLists"] == null ? null : SupervisorHierarchyLists.fromJson(json["SupervisorHierarchyLists"]);
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -1562,9 +1541,6 @@ class GenericResponseModel {
if (this.getEmployeePhonesList != null) { if (this.getEmployeePhonesList != null) {
data['GetEmployeePhonesList'] = this.getEmployeePhonesList!.map((v) => v.toJson()).toList(); data['GetEmployeePhonesList'] = this.getEmployeePhonesList!.map((v) => v.toJson()).toList();
} }
if (this.getEmployeeQualificationsList != null) {
data['EmployeeQualificationsList'] = this.getEmployeeQualificationsList!.map((v) => v.toJson()).toList();
}
if (this.getEmployeeSubordinatesList != null) { if (this.getEmployeeSubordinatesList != null) {
data['GetEmployeeSubordinatesList'] = this.getEmployeeSubordinatesList!.map((v) => v.toJson()).toList(); data['GetEmployeeSubordinatesList'] = this.getEmployeeSubordinatesList!.map((v) => v.toJson()).toList();
} }
@ -1675,10 +1651,6 @@ class GenericResponseModel {
if (this.getTimeCardSummaryList != null) { if (this.getTimeCardSummaryList != null) {
data['GetTimeCardSummaryList'] = this.getTimeCardSummaryList!.map((v) => v.toJson()).toList(); data['GetTimeCardSummaryList'] = this.getTimeCardSummaryList!.map((v) => v.toJson()).toList();
} }
if (this.getEmployeeLeavesList != null) {
data['EmployeeLeavesList'] = this.getEmployeeLeavesList!.map((v) => v.toJson()).toList();
}
data['GetUserItemTypesList'] = this.getUserItemTypesList; data['GetUserItemTypesList'] = this.getUserItemTypesList;
if (this.getVacationRulesList != null) { if (this.getVacationRulesList != null) {
data['GetVacationRulesList'] = this.getVacationRulesList!.map((v) => v.toJson()).toList(); data['GetVacationRulesList'] = this.getVacationRulesList!.map((v) => v.toJson()).toList();
@ -1804,7 +1776,8 @@ class GenericResponseModel {
data['SubmitCEITransactionList'] = this.submitCEITransactionList; data['SubmitCEITransactionList'] = this.submitCEITransactionList;
if (this.submitCcpTransactionList != null) { if (this.submitCcpTransactionList != null) {
data['SubmitCcpTransactionList'] = this.submitCcpTransactionList!.toJson(); data['SubmitCcpTransactionList'] =
this.submitCcpTransactionList!.toJson();
} }
data['SubmitContactTransactionList'] = this.submitContactTransactionList; data['SubmitContactTransactionList'] = this.submitContactTransactionList;
@ -1866,7 +1839,6 @@ class GenericResponseModel {
data['ePharmacy_GetItemOnHandList'] = this.ePharmacyGetItemOnHandList; data['ePharmacy_GetItemOnHandList'] = this.ePharmacyGetItemOnHandList;
data['isActiveCode'] = this.isActiveCode; data['isActiveCode'] = this.isActiveCode;
data['isSMSSent'] = this.isSMSSent; data['isSMSSent'] = this.isSMSSent;
data["SupervisorHierarchyLists"]= supervisorHierarchyLists?.toJson();
return data; return data;
} }
} }

@ -31,7 +31,6 @@ class GetEITDFFStructureList {
List<PARENTSEGMENTSVSSplitedVS>? pARENTSEGMENTSVSSplitedVS; List<PARENTSEGMENTSVSSplitedVS>? pARENTSEGMENTSVSSplitedVS;
String? rEADONLY; String? rEADONLY;
String? rEQUIREDFLAG; String? rEQUIREDFLAG;
String? rEQCOLTIP;
String? sEGMENTNAME; String? sEGMENTNAME;
String? sEGMENTPROMPT; String? sEGMENTPROMPT;
int? sEGMENTSEQNUM; int? sEGMENTSEQNUM;
@ -74,7 +73,6 @@ class GetEITDFFStructureList {
this.pARENTSEGMENTSVSSplitedVS, this.pARENTSEGMENTSVSSplitedVS,
this.rEADONLY, this.rEADONLY,
this.rEQUIREDFLAG, this.rEQUIREDFLAG,
this.rEQCOLTIP,
this.sEGMENTNAME, this.sEGMENTNAME,
this.sEGMENTPROMPT, this.sEGMENTPROMPT,
this.sEGMENTSEQNUM, this.sEGMENTSEQNUM,
@ -134,6 +132,7 @@ class GetEITDFFStructureList {
}); });
} }
pARENTSEGMENTSVS = json['PARENT_SEGMENTS_VS']; pARENTSEGMENTSVS = json['PARENT_SEGMENTS_VS'];
if (json['PARENT_SEGMENTS_VS_SplitedVS'] != null) { if (json['PARENT_SEGMENTS_VS_SplitedVS'] != null) {
pARENTSEGMENTSVSSplitedVS = <PARENTSEGMENTSVSSplitedVS>[]; pARENTSEGMENTSVSSplitedVS = <PARENTSEGMENTSVSSplitedVS>[];
json['PARENT_SEGMENTS_VS_SplitedVS'].forEach((v) { json['PARENT_SEGMENTS_VS_SplitedVS'].forEach((v) {
@ -142,7 +141,6 @@ class GetEITDFFStructureList {
} }
rEADONLY = json['READ_ONLY']; rEADONLY = json['READ_ONLY'];
rEQUIREDFLAG = json['REQUIRED_FLAG']; rEQUIREDFLAG = json['REQUIRED_FLAG'];
rEQCOLTIP = json['REQ_COL_TIP'];
sEGMENTNAME = json['SEGMENT_NAME']; sEGMENTNAME = json['SEGMENT_NAME'];
sEGMENTPROMPT = json['SEGMENT_PROMPT']; sEGMENTPROMPT = json['SEGMENT_PROMPT'];
sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM']; sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM'];
@ -173,6 +171,9 @@ class GetEITDFFStructureList {
if (this.eSERVICESVS != null) { if (this.eSERVICESVS != null) {
data['E_SERVICES_VS'] = this.eSERVICESVS!.map((v) => v.toJson()).toList(); data['E_SERVICES_VS'] = this.eSERVICESVS!.map((v) => v.toJson()).toList();
} }
// if (this.eSERVICESVS != null) {
// data['E_SERVICES_VS'] = this.eSERVICESVS!.toList();
// }
data['FLEX_VALUE_SET_NAME'] = this.fLEXVALUESETNAME; data['FLEX_VALUE_SET_NAME'] = this.fLEXVALUESETNAME;
data['FORMAT_TYPE'] = this.fORMATTYPE; data['FORMAT_TYPE'] = this.fORMATTYPE;
data['FORMAT_TYPE_DSP'] = this.fORMATTYPEDSP; data['FORMAT_TYPE_DSP'] = this.fORMATTYPEDSP;
@ -192,9 +193,9 @@ class GetEITDFFStructureList {
if (this.pARENTSEGMENTSVSSplitedVS != null) { if (this.pARENTSEGMENTSVSSplitedVS != null) {
data['PARENT_SEGMENTS_VS_SplitedVS'] = this.pARENTSEGMENTSVSSplitedVS!.map((v) => v.toJson()).toList(); data['PARENT_SEGMENTS_VS_SplitedVS'] = this.pARENTSEGMENTSVSSplitedVS!.map((v) => v.toJson()).toList();
} }
data['READ_ONLY'] = this.rEADONLY; data['READ_ONLY'] = this.rEADONLY;
data['REQUIRED_FLAG'] = this.rEQUIREDFLAG; data['REQUIRED_FLAG'] = this.rEQUIREDFLAG;
data['REQ_COL_TIP'] = this.rEQCOLTIP;
data['SEGMENT_NAME'] = this.sEGMENTNAME; data['SEGMENT_NAME'] = this.sEGMENTNAME;
data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT; data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT;
data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM; data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM;

@ -1,6 +1,6 @@
class GetMobileLoginInfoListModel { class GetMobileLoginInfoListModel {
int? iD; int? iD;
String? employeeID; int? employeeID;
int? channelID; int? channelID;
int? companyID; int? companyID;
String? deviceType; String? deviceType;

@ -1,71 +0,0 @@
class SupervisorHierarchyLists {
SupervisorHierarchyLists({
this.subordinateHierarchyList,
this.supervisorHierarchyList,
});
List<HierarchyList>? subordinateHierarchyList;
List<HierarchyList>? supervisorHierarchyList;
factory SupervisorHierarchyLists.fromJson(Map<String, dynamic> json) => SupervisorHierarchyLists(
subordinateHierarchyList: json["SubordinateHierarchyList"] == null ? [] : List<HierarchyList>.from(json["SubordinateHierarchyList"]!.map((x) => HierarchyList.fromJson(x))),
supervisorHierarchyList: json["SupervisorHierarchyList"] == null ? [] : List<HierarchyList>.from(json["SupervisorHierarchyList"]!.map((x) => HierarchyList.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"SubordinateHierarchyList": subordinateHierarchyList == null ? [] : List<dynamic>.from(subordinateHierarchyList!.map((x) => x.toJson())),
"SupervisorHierarchyList": supervisorHierarchyList == null ? [] : List<dynamic>.from(supervisorHierarchyList!.map((x) => x.toJson())),
};
}
class HierarchyList {
HierarchyList({
this.employeeEmailAddress,
this.employeeImage,
this.employeeMobileNumber,
this.employeeName,
this.employeeNumber,
this.employeeWorkNumber,
this.lvl,
this.numOfSubordinates,
this.organizationName,
this.positionName,
});
String? employeeEmailAddress;
dynamic employeeImage;
String? employeeMobileNumber;
String? employeeName;
String? employeeNumber;
String? employeeWorkNumber;
int? lvl;
int? numOfSubordinates;
String? organizationName;
String? positionName;
factory HierarchyList.fromJson(Map<String, dynamic> json) => HierarchyList(
employeeEmailAddress: json["EMPLOYEE_EMAIL_ADDRESS"],
employeeImage: json["EMPLOYEE_IMAGE"],
employeeMobileNumber: json["EMPLOYEE_MOBILE_NUMBER"],
employeeName: json["EMPLOYEE_NAME"],
employeeNumber: json["EMPLOYEE_NUMBER"],
employeeWorkNumber: json["EMPLOYEE_WORK_NUMBER"],
lvl: json["LVL"],
numOfSubordinates: json["NUM_OF_SUBORDINATES"],
organizationName: json["ORGANIZATION_NAME"],
positionName: json["POSITION_NAME"],
);
Map<String, dynamic> toJson() => {
"EMPLOYEE_EMAIL_ADDRESS": employeeEmailAddress,
"EMPLOYEE_IMAGE": employeeImage,
"EMPLOYEE_MOBILE_NUMBER": employeeMobileNumber,
"EMPLOYEE_NAME": employeeName,
"EMPLOYEE_NUMBER": employeeNumber,
"EMPLOYEE_WORK_NUMBER": employeeWorkNumber,
"LVL": lvl,
"NUM_OF_SUBORDINATES": numOfSubordinates,
"ORGANIZATION_NAME": organizationName,
"POSITION_NAME": positionName,
};
}

@ -1,41 +0,0 @@
// To parse this JSON data, do
//
// final employeeQualificationsList = employeeQualificationsListFromJson(jsonString);
import 'dart:convert';
EmployeeQualificationsList employeeQualificationsListFromJson(String str) => EmployeeQualificationsList.fromJson(json.decode(str));
String employeeQualificationsListToJson(EmployeeQualificationsList data) => json.encode(data.toJson());
class EmployeeQualificationsList {
EmployeeQualificationsList({
this.establishment,
this.grade,
this.gradeDescription,
this.qualificationType,
this.status,
});
String? establishment;
String? grade;
String? gradeDescription;
String? qualificationType;
String? status;
factory EmployeeQualificationsList.fromJson(Map<String, dynamic> json) => EmployeeQualificationsList(
establishment: json["ESTABLISHMENT"],
grade: json["GRADE"],
gradeDescription: json["GRADE_DESCRIPTION"],
qualificationType: json["QUALIFICATION_TYPE"],
status: json["STATUS"],
);
Map<String, dynamic> toJson() => {
"ESTABLISHMENT": establishment,
"GRADE": grade,
"GRADE_DESCRIPTION": gradeDescription,
"QUALIFICATION_TYPE": qualificationType,
"STATUS": status,
};
}

@ -1,187 +0,0 @@
import 'dart:convert';
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart';
class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
///////////////////// Web RTC Video Calling //////////////////////
// Video Call
late RTCPeerConnection _peerConnection;
RTCVideoRenderer _localVideoRenderer = RTCVideoRenderer();
final RTCVideoRenderer _remoteRenderer = RTCVideoRenderer();
MediaStream? _localStream;
MediaStream? _remoteStream;
void initCallListeners() {
chatHubConnection.on("OnCallAcceptedAsync", onCallAcceptedAsync);
chatHubConnection.on("OnIceCandidateAsync", onIceCandidateAsync);
chatHubConnection.on("OnOfferAsync", onOfferAsync);
chatHubConnection.on("OnAnswerOffer", onAnswerOffer);
chatHubConnection.on("OnHangUpAsync", onHangUpAsync);
chatHubConnection.on("OnCallDeclinedAsync", onCallDeclinedAsync);
}
//Video Constraints
var videoConstraints = {
"video": {
"mandatory": {
"width": {"min": 320},
"height": {"min": 180}
},
"optional": [
{
"width": {"max": 1280}
},
{"frameRate": 25},
{"facingMode": "user"}
]
},
"frameRate": 25,
"width": 420, //420,//640,//1280,
"height": 240 //240//480//720
};
// Audio Constraints
var audioConstraints = {
"sampleRate": 8000,
"sampleSize": 16,
"channelCount": 2,
"echoCancellation": true,
"audio": true,
};
Future<RTCPeerConnection> _createPeerConnection() async {
// {"url": "stun:stun.l.google.com:19302"},
Map<String, dynamic> configuration = {
"iceServers": [
{"urls": 'stun:15.185.116.59:3478'},
{"urls": "turn:15.185.116.59:3479", "username": "admin", "credential": "admin"}
]
};
Map<String, dynamic> offerSdpConstraints = {
"mandatory": {
"OfferToReceiveAudio": true,
"OfferToReceiveVideo": true,
},
"optional": [],
};
RTCPeerConnection pc = await createPeerConnection(configuration, offerSdpConstraints);
// if (pc != null) print(pc);
//pc.addStream(widget.localStream);
pc.onIceCandidate = (e) {
if (e.candidate != null) {
print(json.encode({
'candidate': e.candidate.toString(),
'sdpMid': e.sdpMid.toString(),
'sdpMlineIndex': e.sdpMLineIndex,
}));
}
};
pc.onIceConnectionState = (e) {
print(e);
};
pc.onAddStream = (stream) {
print('addStream: ' + stream.id);
_remoteRenderer.srcObject = stream;
};
return pc;
}
void init() {
initRenderers();
_createPeerConnection().then((pc) {
_peerConnection = pc;
// _setRemoteDescription(widget.info);
});
}
void initRenderers() {
_localVideoRenderer.initialize();
_remoteRenderer.initialize();
initLocalCamera();
}
void initLocalCamera() async {
_localStream = await navigator.mediaDevices.getUserMedia({'video': true, 'audio': true});
_localVideoRenderer.srcObject = _localStream;
// _localVideoRenderer.srcObject = await navigator.mediaDevices
// .getUserMedia({'video': true, 'audio': true});
print('this source Object');
print('this suarce ${_localVideoRenderer.srcObject != null}');
notifyListeners();
}
void startCall({required String callType}) {}
void endCall() {}
void checkCall(Map<String, dynamic> message) {
switch (message["callStatus"]) {
case 'connected':
{}
break;
case 'offer':
{}
break;
case 'accept':
{}
break;
case 'candidate':
{}
break;
case 'bye':
{}
break;
case 'leave':
{}
break;
}
}
//// Listeners Methods ////
void onCallAcceptedAsync(List<Object?>? params) {}
void onIceCandidateAsync(List<Object?>? params) {}
void onOfferAsync(List<Object?>? params) {}
void onAnswerOffer(List<Object?>? params) {}
void onHangUpAsync(List<Object?>? params) {}
void onCallDeclinedAsync(List<Object?>? params) {}
//// Invoke Methods
Future<void> invoke({required String invokeMethod, required String currentUserID, required String targetUserID, bool isVideoCall = false, var data}) async {
List<Object> args = [];
if (invokeMethod == "answerCallAsync") {
args = [currentUserID, targetUserID];
} else if (invokeMethod == "CallUserAsync") {
args = [currentUserID, targetUserID, isVideoCall];
} else if (invokeMethod == "IceCandidateAsync") {
args = [targetUserID, data];
} else if (invokeMethod == "OfferAsync") {
args = [targetUserID, data];
} else if (invokeMethod == "AnswerOfferAsync") {
args = [targetUserID, data];
//json In Data
}
await chatHubConnection.invoke(invokeMethod, args: args);
}
void stopListeners() async {
chatHubConnection.off('OnCallDeclinedAsync');
chatHubConnection.off('OnCallAcceptedAsync');
chatHubConnection.off('OnIceCandidateAsync');
chatHubConnection.off('OnAnswerOffer');
}
}

@ -69,8 +69,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
List<ChatUser> teamMembersList = []; List<ChatUser> teamMembersList = [];
Material.TextDirection textDirection = Material.TextDirection.ltr; Material.TextDirection textDirection = Material.TextDirection.ltr;
bool isRTL = false;
String msgText = "";
//Chat Home Page Counter //Chat Home Page Counter
int chatUConvCounter = 0; int chatUConvCounter = 0;
@ -79,8 +77,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
List<ChatUser>? chatUsersList = []; List<ChatUser>? chatUsersList = [];
int pageNo = 1; int pageNo = 1;
bool disbaleChatForThisUser = false;
Future<void> getUserAutoLoginToken() async { Future<void> getUserAutoLoginToken() async {
userLoginToken.UserAutoLoginModel userLoginResponse = await ChatApiClient().getUserLoginToken(); userLoginToken.UserAutoLoginModel userLoginResponse = await ChatApiClient().getUserLoginToken();
if (userLoginResponse.response != null) { if (userLoginResponse.response != null) {
@ -90,8 +86,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
Utils.showToast( Utils.showToast(
userLoginResponse.errorResponses!.first.fieldName.toString() + " Erorr", userLoginResponse.errorResponses!.first.fieldName.toString() + " Erorr",
); );
disbaleChatForThisUser = true;
notifyListeners();
} }
} }
@ -123,7 +117,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
// chatHubConnection.on("OnUpdateUserChatHistoryWindowsAsync", updateChatHistoryWindow); // chatHubConnection.on("OnUpdateUserChatHistoryWindowsAsync", updateChatHistoryWindow);
chatHubConnection.on("OnGetUserChatHistoryNotDeliveredAsync", chatNotDelivered); chatHubConnection.on("OnGetUserChatHistoryNotDeliveredAsync", chatNotDelivered);
chatHubConnection.on("OnUpdateUserChatHistoryStatusAsync", updateUserChatStatus); chatHubConnection.on("OnUpdateUserChatHistoryStatusAsync", updateUserChatStatus);
if (kDebugMode) { if (kDebugMode) {
logger.i("All listeners registered"); logger.i("All listeners registered");
} }
@ -919,7 +912,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
} }
String dateFormte(DateTime data) { String dateFormte(DateTime data) {
DateFormat f = DateFormat('hh:mm a dd MMM yyyy', "en_US"); DateFormat f = DateFormat('hh:mm a dd MMM yyyy');
f.format(data); f.format(data);
return f.format(data); return f.format(data);
} }
@ -1014,25 +1007,23 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
} }
void disposeData() { void disposeData() {
if (!disbaleChatForThisUser) { search.clear();
search.clear(); isChatScreenActive = false;
isChatScreenActive = false; receiverID = 0;
receiverID = 0; paginationVal = 0;
paginationVal = 0; message.text = '';
message.text = ''; isTextMsg = false;
isTextMsg = false; isAttachmentMsg = false;
isAttachmentMsg = false; isVoiceMsg = false;
isVoiceMsg = false; isReplyMsg = false;
isReplyMsg = false; repliedMsg = [];
repliedMsg = []; sFileType = "";
sFileType = ""; deleteData();
deleteData(); favUsersList.clear();
favUsersList.clear(); searchedChats?.clear();
searchedChats?.clear(); pChatHistory?.clear();
pChatHistory?.clear(); chatHubConnection.stop();
chatHubConnection.stop(); AppState().chatDetails = null;
AppState().chatDetails = null;
}
} }
void deleteData() { void deleteData() {
@ -1416,16 +1407,17 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void inputBoxDirection(String val) { void inputBoxDirection(String val) {
if (val.isNotEmpty) { if (val.isNotEmpty) {
isTextMsg = true; isTextMsg = true;
RegExp exp = RegExp("[a-zA-Z]");
if (exp.hasMatch(val.substring(val.length - 1)) && val.substring(val.length - 1) != " ") {
textDirection = Material.TextDirection.ltr;
notifyListeners();
} else if (val.substring(val.length - 1) != " " && !exp.hasMatch(val.substring(val.length - 1))) {
textDirection = Material.TextDirection.rtl;
notifyListeners();
}
} else { } else {
isTextMsg = false; isTextMsg = false;
} }
msgText = val;
notifyListeners();
}
void onDirectionChange(bool val) {
isRTL = val;
notifyListeners();
} }
Material.TextDirection getTextDirection(String v) { Material.TextDirection getTextDirection(String v) {
@ -1459,19 +1451,19 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
} }
void openChatByNoti(BuildContext context) async { void openChatByNoti(BuildContext context) async {
SingleUserChatModel nUser = SingleUserChatModel(); SingleUserChatModel nUser = SingleUserChatModel.fromJson(
jsonDecode(await Utils.getStringFromPrefs("notificationData")),
);
Utils.saveStringFromPrefs("isAppOpendByChat", "false"); Utils.saveStringFromPrefs("isAppOpendByChat", "false");
if (await Utils.getStringFromPrefs("notificationData") != "null") { Utils.saveStringFromPrefs("notificationData", "null");
nUser = SingleUserChatModel.fromJson(jsonDecode(await Utils.getStringFromPrefs("notificationData"))); Future.delayed(const Duration(seconds: 1));
Utils.saveStringFromPrefs("notificationData", "null"); for (ChatUser user in searchedChats!) {
Future.delayed(const Duration(seconds: 2)); if (user.id == nUser.targetUserId) {
for (ChatUser user in searchedChats!) { Navigator.pushNamed(context, AppRoutes.chatDetailed, arguments: ChatDetailedScreenParams(user, false));
if (user.id == nUser.targetUserId) { return;
Navigator.pushNamed(context, AppRoutes.chatDetailed, arguments: ChatDetailedScreenParams(user, false)); } else {
return; openChatByNoti(context);
}
} }
} }
Utils.saveStringFromPrefs("notificationData", "null");
} }
} }

@ -5,7 +5,6 @@ import 'package:mohem_flutter_app/api/dashboard_api_client.dart';
import 'package:mohem_flutter_app/api/offers_and_discounts_api_client.dart'; import 'package:mohem_flutter_app/api/offers_and_discounts_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/env.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/main.dart';
@ -41,23 +40,12 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
bool isMissingSwipeLoading = true; bool isMissingSwipeLoading = true;
int missingSwipeCounter = 0; int missingSwipeCounter = 0;
bool isMyRequestLoading = true;
ListMenu? myRequest;
//Leave and Ticket Balance //Leave and Ticket Balance
bool isLeaveTicketBalanceLoading = true; bool isLeaveTicketBalanceLoading = true;
List<GetAccrualBalancesList>? accrualList; List<GetAccrualBalancesList>? accrualList;
GetAccrualBalancesList? leaveBalanceAccrual; GetAccrualBalancesList? leaveBalanceAccrual;
GetAccrualBalancesList? oldLeaveBalanceAccrual;
double? get leaveBalance => ((leaveBalanceAccrual?.accrualNetEntitlement! ?? 0) + (oldLeaveBalanceAccrual?.accrualNetEntitlement! ??0));
GetAccrualBalancesList? businessTripAccrual;
double get businessTrip => businessTripAccrual?.accrualNetEntitlement ?? 0;
double get leaveBalance => leaveBalanceAccrual?.accrualNetEntitlement ?? 0;
double ticketBalance = 0; double ticketBalance = 0;
//Menu Entries //Menu Entries
@ -98,19 +86,12 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
isWorkListLoading = true; isWorkListLoading = true;
workListCounter = 0; workListCounter = 0;
isMyRequestLoading = true;
myRequest = null;
isMissingSwipeLoading = true; isMissingSwipeLoading = true;
missingSwipeCounter = 0; missingSwipeCounter = 0;
isWorkListLoading = true;
isLeaveTicketBalanceLoading = true; isLeaveTicketBalanceLoading = true;
accrualList = null; accrualList = null;
leaveBalanceAccrual = null; leaveBalanceAccrual = null;
oldLeaveBalanceAccrual = null;
businessTripAccrual = null;
ticketBalance = 0; ticketBalance = 0;
isServicesMenusLoading = true; isServicesMenusLoading = true;
@ -120,13 +101,12 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
getOffersList = []; getOffersList = [];
drawerMenuItemList = [ drawerMenuItemList = [
DrawerMenuItem("assets/images/drawer/profile_icon.png", LocaleKeys.myProfile.tr(), AppRoutes.profile), DrawerMenuItem("assets/images/drawer/my_profile.svg", LocaleKeys.myProfile.tr(), AppRoutes.profile),
// DrawerMenuItem("assets/images/drawer/performance_evaluation.svg", LocaleKeys.performanceEvaluation.tr(), AppRoutes.performanceEvaluation), DrawerMenuItem("assets/images/drawer/performance_evaluation.svg", LocaleKeys.performanceEvaluation.tr(), AppRoutes.performanceEvaluation),
// DrawerMenuItem("assets/images/drawer/mowadhafi.svg", LocaleKeys.mowadhafhi.tr(), AppRoutes.mowadhafhi), DrawerMenuItem("assets/images/drawer/mowadhafi.svg", LocaleKeys.mowadhafhi.tr(), AppRoutes.mowadhafhi),
DrawerMenuItem("assets/images/drawer/notices.png", LocaleKeys.notices.tr(), AppRoutes.pendingTransactions), DrawerMenuItem("assets/images/drawer/pending_trasactions.svg", LocaleKeys.pendingTransactions.tr(), AppRoutes.pendingTransactions),
// // DrawerMenuItem("assets/images/drawer/drawer_marathon.svg", LocaleKeys.brainMarathon.tr(), AppRoutes.marathonIntroScreen), // DrawerMenuItem("assets/images/drawer/drawer_marathon.svg", LocaleKeys.brainMarathon.tr(), AppRoutes.marathonIntroScreen),
// DrawerMenuItem("assets/images/drawer/change_password.svg", LocaleKeys.changePassword.tr(), AppRoutes.changePassword), DrawerMenuItem("assets/images/drawer/change_password.svg", LocaleKeys.changePassword.tr(), AppRoutes.changePassword),
//
]; ];
notifyListeners(); notifyListeners();
@ -158,17 +138,15 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
getOpenNotificationsList = genericResponseModel?.getOpenNotificationsList; getOpenNotificationsList = genericResponseModel?.getOpenNotificationsList;
workListCounter = genericResponseModel?.pOPENNTFNUMBER ?? 0; workListCounter = genericResponseModel?.pOPENNTFNUMBER ?? 0;
if (env.itg) itgFormsModel = await DashboardApiClient().getItgFormsPendingTask();
itgFormsModel = await DashboardApiClient().getItgFormsPendingTask();
workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0); workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0);
if (env.itg) { GenericResponseModel? cocGenericResponseModel = await DashboardApiClient().getCOCNotifications();
GenericResponseModel? cocGenericResponseModel = await DashboardApiClient().getCOCNotifications(); cocCount = cocGenericResponseModel?.mohemmITGPendingTaskResponseItem;
cocCount = cocGenericResponseModel?.mohemmITGPendingTaskResponseItem; if (cocCount != null) {
if (cocCount != null) { cocFinalCount = (cocCount?.escalation ?? 0) + (cocCount?.waitingToClose ?? 0) + (cocCount?.waitingForAcceptance ?? 0) + (cocCount?.extendTATRequest ?? 0);
cocFinalCount = (cocCount?.escalation ?? 0) + (cocCount?.waitingToClose ?? 0) + (cocCount?.waitingForAcceptance ?? 0) + (cocCount?.extendTATRequest ?? 0); workListCounter += cocFinalCount;
workListCounter += cocFinalCount;
}
} }
if (showLoading) Utils.hideLoading(context); if (showLoading) Utils.hideLoading(context);
notifyListeners(); notifyListeners();
} catch (ex) { } catch (ex) {
@ -209,13 +187,10 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
//Leave and Ticket Balance API's & Methods //Leave and Ticket Balance API's & Methods
Future fetchLeaveTicketBalance(context, DateTime date) async { Future fetchLeaveTicketBalance(context, DateTime date) async {
try { try {
accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy", "en_US").format(date)); accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy").format(date));
isLeaveTicketBalanceLoading = false; isLeaveTicketBalanceLoading = false;
leaveBalanceAccrual = accrualList!.singleWhere((element) => element.accuralPlanName == 'Annual Vacation Accrual' || element.accuralPlanName == "خطة استحقاق الاجازة الاعتيادية", orElse: null); leaveBalanceAccrual = accrualList![0];
oldLeaveBalanceAccrual = accrualList!.singleWhere((element) => element.accuralPlanName == 'Old Leave Balance' || element.accuralPlanName == "خطة فصل الارصدة 1439", orElse: null); ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + (accrualList![2].accrualNetEntitlement ?? 0.0);
businessTripAccrual = accrualList!.singleWhere((element) => element.accuralPlanName == 'Business Trip Accrual' || element.accuralPlanName == "خطة استحقاق الإنتدابات", orElse: null);
ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + (accrualList![2].accrualNetEntitlement ?? 0.0) + (accrualList![3].accrualNetEntitlement ?? 0.0);
notifyListeners(); notifyListeners();
} catch (ex) { } catch (ex) {
isLeaveTicketBalanceLoading = false; isLeaveTicketBalanceLoading = false;
@ -232,19 +207,17 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void fetchListMenu() async { void fetchListMenu() async {
try { try {
List<ListMenu> menuList = await DashboardApiClient().getListMenu(); List<ListMenu> menuList = await DashboardApiClient().getListMenu();
for (var menu in menuList) { List findMyRequest = menuList.where((element) => element.menuType == "E").toList();
if (menu.menuType == "E") { if (findMyRequest.isNotEmpty) {
myRequest = menu; drawerMenuItemList.insert(3, DrawerMenuItem("assets/images/drawer/my_requests.svg", LocaleKeys.myRequest.tr(), AppRoutes.myRequests));
} else if (menu.menuType == "M") { }
AppState().setempStatusIsManager = true; List findMyTeam = menuList.where((element) => element.menuType == "M").toList();
drawerMenuItemList.add(DrawerMenuItem("assets/images/drawer/my_team_icon.png", LocaleKeys.myTeamMembers.tr(), AppRoutes.myTeam)); if (findMyTeam.isNotEmpty) {
} AppState().setempStatusIsManager = true;
drawerMenuItemList.insert(2, DrawerMenuItem("assets/images/drawer/my_team.svg", LocaleKeys.myTeamMembers.tr(), AppRoutes.myTeam));
} }
isMyRequestLoading = false;
notifyListeners();
} catch (ex) { } catch (ex) {
logger.wtf(ex); logger.wtf(ex);
notifyListeners();
Utils.handleException(ex, null, null); Utils.handleException(ex, null, null);
} }
} }
@ -255,14 +228,9 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
GenericResponseModel? genericResponseModel = await DashboardApiClient().getGetMenuEntries(); GenericResponseModel? genericResponseModel = await DashboardApiClient().getGetMenuEntries();
getMenuEntriesList = genericResponseModel!.getMenuEntriesList; getMenuEntriesList = genericResponseModel!.getMenuEntriesList;
homeMenus = parseMenus(getMenuEntriesList ?? []); homeMenus = parseMenus(getMenuEntriesList ?? []);
if (homeMenus!.isNotEmpty) { if (homeMenus!.isNotEmpty) {
if (env.dashboard.monthlyAttendance) { homeMenus!.first.menuEntiesList.insert(0, GetMenuEntriesList(requestType: "MONTHLY_ATTENDANCE", prompt: LocaleKeys.monthlyAttendance.tr()));
homeMenus!.first.menuEntiesList.insert(0, GetMenuEntriesList(requestType: "MONTHLY_ATTENDANCE", prompt: LocaleKeys.monthlyAttendance.tr())); homeMenus!.first.menuEntiesList.add(GetMenuEntriesList(requestType: "VACATION_RULE", prompt: LocaleKeys.vacationRule.tr()));
}
if (env.dashboard.vocationRules) {
homeMenus!.first.menuEntiesList.add(GetMenuEntriesList(requestType: "VACATION_RULE", prompt: LocaleKeys.vacationRule.tr()));
}
} }
isServicesMenusLoading = false; isServicesMenusLoading = false;
notifyListeners(); notifyListeners();
@ -300,7 +268,6 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
MohemmItgResponseItem? res = await DashboardApiClient().getITGPageNotification(); MohemmItgResponseItem? res = await DashboardApiClient().getITGPageNotification();
return res; return res;
} }
void notify() { void notify() {
notifyListeners(); notifyListeners();
} }

@ -1,358 +0,0 @@
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/painting.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:intl/intl.dart';
import 'package:mohem_flutter_app/api/monthly_attendance_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/date_uitl.dart';
import 'package:mohem_flutter_app/classes/utils.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/employee_leaves_list.dart';
import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart';
import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart';
import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart';
import 'package:month_picker_dialog_2/month_picker_dialog_2.dart';
import 'package:pie_chart/pie_chart.dart';
import 'package:sizer/sizer.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
enum LeaveType { ABSENCE, BUSINESS_TRIP, HOLIDAY, NORMAL }
class MoeMonthlyAttendanceScreen extends StatefulWidget {
@override
State<MoeMonthlyAttendanceScreen> createState() => _MoeMonthlyAttendanceScreenState();
}
class _MoeMonthlyAttendanceScreenState extends State<MoeMonthlyAttendanceScreen> {
DateTime currentDate = DateTime.now();
int searchYear = DateTime.now().year;
final CalendarController _calendarController = CalendarController();
List<EmployeeLeavesList> employeeLeavesList = [];
@override
void initState() {
super.initState();
getLeavesData(currentDate);
// callTimeCardAndHourDetails(date.day, searchMonth, searchYear);
}
void getLeavesData(DateTime date) async {
try {
Utils.showLoading(context);
String startDate = '${date.year}-${date.month}-${date.day}';
int lastday = DateTime(date.year, date.month + 1, 0).day;
String endDate = '${date.year}-${date.month}-$lastday';
employeeLeavesList = await MonthlyAttendanceApiClient().getEmployeeLeaves(startDate, endDate);
Utils.hideLoading(context);
_calendarController.displayDate = date;
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(
context,
// title: LocaleKeys.mowadhafhiRequest.tr(),
title: "",
// showHomeButton: true,
),
body: ListView(
scrollDirection: Axis.vertical,
children: [
Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.attendance.tr().toText24(isBold: true, color: MyColors.grey3AColor),
Row(
children: [
"${DateFormat("MMMM-yyyy").format(currentDate)}".toText16(color: MyColors.greyACColor),
const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.greyACColor),
],
).onPress(() async {
showMonthPicker(
context: context,
//locale: EasyLocalization.of(context)?.locale,
initialDate: currentDate,
firstDate: DateTime(searchYear - 2),
lastDate: DateTime.now(),
confirmText: Text(LocaleKeys.confirm.tr()),
cancelText: Text(LocaleKeys.cancel.tr()),
).then((selectedDate) {
if (selectedDate != null) {
getLeavesData(selectedDate);
setState(() {
currentDate = selectedDate;
});
}
});
}),
18.height,
AspectRatio(aspectRatio: 304 / 244, child: calendarWidget()),
12.height,
SizedBox(
width: double.infinity,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
showColorItem("Absence", MyColors.pinkDarkColor),
showColorItem("Business Trip", MyColors.gradiantStartColor),
showColorItem("Holiday", MyColors.gradiantEndColor),
],
),
),
],
).paddingOnly(left: 21, right: 21, top: 21),
],
),
],
),
);
}
Widget showColorItem(String title, Color color) {
return Row(
children: [
Container(
width: 20,
height: 20,
color: color,
).circle(2000),
8.width,
title.toText12()
],
);
}
Widget calendarWidget() {
return SfCalendar(
view: CalendarView.month,
showDatePickerButton: false,
controller: _calendarController,
backgroundColor: Colors.white,
headerHeight: 0,
viewNavigationMode: ViewNavigationMode.none,
todayHighlightColor: MyColors.grey3AColor,
showNavigationArrow: false,
showCurrentTimeIndicator: false,
showWeekNumber: false,
cellBorderColor: Colors.white,
onTap: (v) {
dynamic index = v.date?.day;
if (index != null) {
index = index - 1;
}
EmployeeLeavesList leaves = employeeLeavesList[index];
if (leaves.leaveType != LeaveType.NORMAL.name) {
showModalBottomSheet(
context: context,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(25.0),
topRight: Radius.circular(25.0),
)),
isScrollControlled: true,
backgroundColor: MyColors.white,
builder: (_) {
return DraggableScrollableSheet(
maxChildSize: 0.75,
expand: false,
initialChildSize: 0.75,
builder: (_, controller) {
return Column(
children: [
Container(
width: 49,
height: 7,
margin: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: MyColors.darkGreyColor,
),
),
16.height,
Container(
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 40),
margin: const EdgeInsets.only(left: 20, right: 20),
decoration: BoxDecoration(
border: Border.all(
color: Colors.black,
),
borderRadius: BorderRadius.circular(12)),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
DateUtil.getWeekDay(DateUtil.convertStringToDateTime(leaves.eventDate ?? "").weekday).toString().toText14(),
DateUtil.convertStringToDateTime(leaves.eventDate ?? "").day.toString().toText20(),
DateUtil.getMonth(DateUtil.convertStringToDateTime(leaves.eventDate ?? "").month).toString().toText14(),
DateUtil.convertStringToDateTime(leaves.eventDate ?? "").year.toString().toText14(),
],
),
),
6.height,
showText(LocaleKeys.leaveType.tr(), leaves.leaveType.toString()),
// if (leaves.absenceAttendanceTypeName.toString().isNotEmpty)
// const Divider(
// color: MyColors.borderCEColor,
// ),
// if (leaves.absenceAttendanceTypeName.toString().isNotEmpty) showText(LocaleKeys.attendanceType.tr(), leaves.absenceAttendanceTypeName.toString()),
const Divider(
color: MyColors.borderCEColor,
),
showText(LocaleKeys.startDateT.tr(), leaves.dateStart.toString()),
const Divider(
color: MyColors.borderCEColor,
),
showText(LocaleKeys.endDate.tr(), leaves.dateEnd.toString()),
],
);
},
);
},
);
}
},
selectionDecoration: BoxDecoration(
border: Border.all(color: MyColors.white, width: 1),
shape: BoxShape.circle,
),
dataSource: MeetingDataSource(_getDataSource()),
// onTap: calendarTapped,
monthViewSettings: const MonthViewSettings(
dayFormat: 'EEE',
showTrailingAndLeadingDates: false,
showAgenda: false,
),
viewHeaderStyle: const ViewHeaderStyle(
dayTextStyle: TextStyle(color: MyColors.grey3AColor, fontSize: 13, fontWeight: FontWeight.w600),
),
monthCellBuilder: (build, details) {
LeaveType leaveType = LeaveType.NORMAL;
for (int i = 0; i < employeeLeavesList.length; i++) {
if (details.date.day == DateUtil.convertSimpleStringDateToDateddMMyyyy(employeeLeavesList[i].eventDate ?? "").day) {
if (employeeLeavesList[i].leaveType == LeaveType.ABSENCE.name) {
leaveType = LeaveType.ABSENCE;
} else if (employeeLeavesList[i].leaveType == LeaveType.BUSINESS_TRIP.name) {
leaveType = LeaveType.BUSINESS_TRIP;
} else if (employeeLeavesList[i].leaveType == LeaveType.HOLIDAY.name) {
leaveType = LeaveType.HOLIDAY;
}
}
}
return Container(
margin: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: leaveType == LeaveType.ABSENCE
? MyColors.pinkDarkColor
: leaveType == LeaveType.BUSINESS_TRIP
? MyColors.gradiantStartColor
: leaveType == LeaveType.HOLIDAY
? MyColors.gradiantEndColor
: MyColors.white,
shape: BoxShape.circle,
border: Border.all(
color: leaveType == LeaveType.ABSENCE
? MyColors.pinkDarkColor
: leaveType == LeaveType.BUSINESS_TRIP
? MyColors.gradiantStartColor
: leaveType == LeaveType.HOLIDAY
? MyColors.gradiantEndColor
: MyColors.black,
width: 2,
),
),
alignment: Alignment.center,
child: Text(
"${details.date.day}",
style: TextStyle(fontSize: 13, fontWeight: FontWeight.w500, color: leaveType == LeaveType.NORMAL ? MyColors.black : MyColors.white),
),
);
},
);
}
List<Meeting> _getDataSource() {
List<Meeting> meetings = <Meeting>[];
return meetings;
}
Widget showText(String title, String value) {
return Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
value.toText18(color: MyColors.gradiantEndColor, isBold: true),
title.toText14(color: MyColors.greyACColor, isBold: false),
],
),
);
}
}
class MeetingDataSource extends CalendarDataSource {
MeetingDataSource(List<Meeting> source) {
appointments = source;
}
@override
DateTime getStartTime(int index) {
return _getMeetingData(index).from;
}
@override
DateTime getEndTime(int index) {
return _getMeetingData(index).to;
}
@override
String getSubject(int index) {
return _getMeetingData(index).eventName;
}
@override
Color getColor(int index) {
return _getMeetingData(index).background;
}
@override
bool isAllDay(int index) {
return _getMeetingData(index).isAllDay;
}
Meeting _getMeetingData(int index) {
dynamic meeting = appointments;
Meeting meetingData;
if (meeting is Meeting) {
meetingData = meeting;
}
return meeting;
}
}
class Meeting {
Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay);
String eventName;
DateTime from;
DateTime to;
Color background;
bool isAllDay;
}

@ -432,7 +432,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
expand: false, expand: false,
builder: (_, controller) { builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss", "en_US").parse(dmyString); DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString);
return Column( return Column(
children: [ children: [
Container( Container(

@ -140,7 +140,7 @@ class _VacationRuleScreenState extends State<VacationRuleScreen> {
} }
String getParsedTime(String time) { String getParsedTime(String time) {
DateTime date = DateFormat("MM/dd/yyyy", "en_US").parse(time); DateTime date = DateFormat("MM/dd/yyyy").parse(time);
return DateFormat("d MMM yyyy", "en_US").format(date); return DateFormat("d MMM yyyy").format(date);
} }
} }

@ -10,14 +10,12 @@ import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/main.dart';
import 'package:mohem_flutter_app/models/chat/call.dart'; import 'package:mohem_flutter_app/models/chat/call.dart';
import 'package:mohem_flutter_app/provider/chat_call_provider.dart';
import 'package:provider/provider.dart';
class OutGoingCall extends StatefulWidget { class OutGoingCall extends StatefulWidget {
CallDataModel outGoingCallData; CallDataModel OutGoingCallData;
bool isVideoCall; bool? isVideoCall;
OutGoingCall({Key? key, required this.outGoingCallData, required this.isVideoCall}) : super(key: key); OutGoingCall({Key? key, required this.OutGoingCallData, this.isVideoCall}) : super(key: key);
@override @override
_OutGoingCallState createState() => _OutGoingCallState(); _OutGoingCallState createState() => _OutGoingCallState();
@ -25,25 +23,23 @@ class OutGoingCall extends StatefulWidget {
class _OutGoingCallState extends State<OutGoingCall> with SingleTickerProviderStateMixin { class _OutGoingCallState extends State<OutGoingCall> with SingleTickerProviderStateMixin {
AnimationController? _animationController; AnimationController? _animationController;
late CameraController controller; CameraController? _controller;
late List<CameraDescription> _cameras;
Future<void>? _initializeControllerFuture; Future<void>? _initializeControllerFuture;
bool isCameraReady = false; bool isCameraReady = false;
bool isMicOff = false; bool isMicOff = false;
bool isLoudSpeaker = false; bool isLoudSpeaker = false;
bool isCamOff = false; bool isCamOff = false;
late ChatCallProvider callProviderd;
@override @override
void initState() { void initState() {
callProviderd = Provider.of<ChatCallProvider>(context, listen: false);
_animationController = AnimationController( _animationController = AnimationController(
vsync: this, vsync: this,
duration: const Duration( duration: const Duration(
milliseconds: 500, milliseconds: 500,
), ),
); );
// _runAnimation(); logger.d(jsonEncode(widget.OutGoingCallData));
//_runAnimation();
// connectSignaling(); // connectSignaling();
WidgetsBinding.instance.addPostFrameCallback( WidgetsBinding.instance.addPostFrameCallback(
(_) => _runAnimation(), (_) => _runAnimation(),
@ -62,10 +58,13 @@ class _OutGoingCallState extends State<OutGoingCall> with SingleTickerProviderSt
return Stack( return Stack(
alignment: FractionalOffset.center, alignment: FractionalOffset.center,
children: <Widget>[ children: <Widget>[
if (widget.isVideoCall) if (widget.isVideoCall!)
Positioned.fill( Positioned.fill(
child: CameraPreview( child: AspectRatio(
controller, aspectRatio: _controller!.value.aspectRatio,
child: CameraPreview(
_controller!,
),
), ),
), ),
Positioned.fill( Positioned.fill(
@ -75,7 +74,7 @@ class _OutGoingCallState extends State<OutGoingCall> with SingleTickerProviderSt
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: MyColors.grey57Color.withOpacity( color: MyColors.grey57Color.withOpacity(
0.3, 0.7,
), ),
), ),
child: Column( child: Column(
@ -106,9 +105,9 @@ class _OutGoingCallState extends State<OutGoingCall> with SingleTickerProviderSt
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
10.height, 10.height,
Text( const Text(
widget.outGoingCallData.title, "Aamir Saleem Ahmad",
style: const TextStyle( style: TextStyle(
fontSize: 21, fontSize: 21,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: MyColors.white, color: MyColors.white,
@ -180,7 +179,7 @@ class _OutGoingCallState extends State<OutGoingCall> with SingleTickerProviderSt
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
if (widget.isVideoCall) if (widget.isVideoCall!)
RawMaterialButton( RawMaterialButton(
onPressed: () { onPressed: () {
_camOff(); _camOff();
@ -268,10 +267,13 @@ class _OutGoingCallState extends State<OutGoingCall> with SingleTickerProviderSt
} }
void _runAnimation() async { void _runAnimation() async {
_cameras = await availableCameras(); List<CameraDescription> cameras = await availableCameras();
CameraDescription firstCamera = _cameras[1]; CameraDescription firstCamera = cameras[1];
controller = CameraController(firstCamera, ResolutionPreset.medium); _controller = CameraController(
_initializeControllerFuture = controller.initialize(); firstCamera,
ResolutionPreset.medium,
);
_initializeControllerFuture = _controller!.initialize();
setState(() {}); setState(() {});
// setAudioFile(); // setAudioFile();
for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
@ -302,7 +304,7 @@ class _OutGoingCallState extends State<OutGoingCall> with SingleTickerProviderSt
try { try {
// backToHome(); // backToHome();
// final roomModel = RoomModel(name: widget.OutGoingCallData.name, token: widget.OutGoingCallData.sessionId, identity: widget.OutGoingCallData.identity); // final roomModel = RoomModel(name: widget.OutGoingCallData.name, token: widget.OutGoingCallData.sessionId, identity: widget.OutGoingCallData.identity);
await controller?.dispose(); await _controller?.dispose();
// changeCallStatusAPI(4); // changeCallStatusAPI(4);

@ -1,5 +1,4 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert';
import 'package:audio_waveforms/audio_waveforms.dart'; import 'package:audio_waveforms/audio_waveforms.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -14,10 +13,7 @@ import 'package:mohem_flutter_app/main.dart';
import 'package:mohem_flutter_app/models/chat/call.dart'; import 'package:mohem_flutter_app/models/chat/call.dart';
import 'package:mohem_flutter_app/models/chat/get_search_user_chat_model.dart'; import 'package:mohem_flutter_app/models/chat/get_search_user_chat_model.dart';
import 'package:mohem_flutter_app/models/chat/get_single_user_chat_list_model.dart'; import 'package:mohem_flutter_app/models/chat/get_single_user_chat_list_model.dart';
import 'package:mohem_flutter_app/models/chat/get_user_login_token_model.dart';
import 'package:mohem_flutter_app/provider/chat_call_provider.dart';
import 'package:mohem_flutter_app/provider/chat_provider_model.dart'; import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
import 'package:mohem_flutter_app/ui/chat/custom_auto_direction.dart';
import 'package:mohem_flutter_app/ui/chat/call/chat_outgoing_call_screen.dart'; import 'package:mohem_flutter_app/ui/chat/call/chat_outgoing_call_screen.dart';
import 'package:mohem_flutter_app/ui/chat/chat_bubble.dart'; import 'package:mohem_flutter_app/ui/chat/chat_bubble.dart';
import 'package:mohem_flutter_app/ui/chat/common.dart'; import 'package:mohem_flutter_app/ui/chat/common.dart';
@ -45,10 +41,8 @@ class ChatDetailScreen extends StatefulWidget {
class _ChatDetailScreenState extends State<ChatDetailScreen> { class _ChatDetailScreenState extends State<ChatDetailScreen> {
final RefreshController _rc = RefreshController(initialRefresh: false); final RefreshController _rc = RefreshController(initialRefresh: false);
late ChatProviderModel data; late ChatProviderModel data;
late ChatCallProvider callPro;
ChatDetailedScreenParams? params; ChatDetailedScreenParams? params;
var textDirection = TextDirection.RTL;
// var textDirection = TextDirection.RTL;
void getMoreChat() async { void getMoreChat() async {
if (params != null) { if (params != null) {
@ -78,7 +72,6 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
params = ModalRoute.of(context)!.settings.arguments as ChatDetailedScreenParams; params = ModalRoute.of(context)!.settings.arguments as ChatDetailedScreenParams;
data = Provider.of<ChatProviderModel>(context, listen: false); data = Provider.of<ChatProviderModel>(context, listen: false);
// callPro = Provider.of<ChatCallProvider>(context, listen: false);
if (params != null) { if (params != null) {
data.getSingleUserChatHistory( data.getSingleUserChatHistory(
senderUID: AppState().chatDetails!.response!.id!.toInt(), senderUID: AppState().chatDetails!.response!.id!.toInt(),
@ -99,11 +92,11 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
chatUser: params!.chatUser, chatUser: params!.chatUser,
actions: [ actions: [
// SvgPicture.asset("assets/icons/chat/call.svg", width: 21, height: 23).onPress(() { // SvgPicture.asset("assets/icons/chat/call.svg", width: 21, height: 23).onPress(() {
// makeCall(callType: "AUDIO"); // // makeCall(callType: "AUDIO", con: hubConnection);
// }), // }),
// 24.width, // 24.width,
// SvgPicture.asset("assets/icons/chat/video_call.svg", width: 21, height: 18).onPress(() { // SvgPicture.asset("assets/icons/chat/video_call.svg", width: 21, height: 18).onPress(() {
// makeCall(callType: "VIDEO"); // // makeCall(callType: "VIDEO", con: hubConnection);
// }), // }),
// 21.width, // 21.width,
], ],
@ -259,39 +252,37 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
if (!m.isRecoding) if (!m.isRecoding)
Row( Row(
children: [ children: [
CustomAutoDirection( TextField(
onDirectionChange: (bool isRTL) => m.onDirectionChange(isRTL), textDirection: m.textDirection,
text: m.msgText, controller: m.message,
child: TextField( decoration: InputDecoration(
// textDirection: m.textDirection, hintTextDirection: m.textDirection,
controller: m.message, hintText: m.isAttachmentMsg
decoration: InputDecoration( ? m.selectedFile.path.split("/").last
hintTextDirection: m.textDirection, : m.textDirection.name == "rtl" ? "اكتب هنا للرد" :LocaleKeys.typeheretoreply.tr(),
hintText: m.isAttachmentMsg ? m.selectedFile.path.split("/").last : LocaleKeys.typeheretoreply.tr(), hintStyle: TextStyle(color: m.isAttachmentMsg ? MyColors.darkTextColor : MyColors.grey98Color, fontSize: 14),
hintStyle: TextStyle(color: m.isAttachmentMsg ? MyColors.darkTextColor : MyColors.grey98Color, fontSize: 14), border: InputBorder.none,
border: InputBorder.none, focusedBorder: InputBorder.none,
focusedBorder: InputBorder.none, enabledBorder: InputBorder.none,
enabledBorder: InputBorder.none, errorBorder: InputBorder.none,
errorBorder: InputBorder.none, disabledBorder: InputBorder.none,
disabledBorder: InputBorder.none, filled: true,
filled: true, fillColor: MyColors.white,
fillColor: MyColors.white, contentPadding: const EdgeInsets.only(
contentPadding: const EdgeInsets.only( left: 21,
left: 21, top: 20,
top: 20, bottom: 20,
bottom: 20,
),
prefixIconConstraints: const BoxConstraints(),
prefixIcon: m.sFileType.isNotEmpty
? SvgPicture.asset(m.getType(m.sFileType), height: 30, width: 22, alignment: Alignment.center, fit: BoxFit.cover).paddingOnly(left: 21, right: 15)
: null,
), ),
onChanged: (String val) { prefixIconConstraints: const BoxConstraints(),
m.inputBoxDirection(val); prefixIcon: m.sFileType.isNotEmpty
m.userTypingInvoke(currentUser: AppState().chatDetails!.response!.id!, reciptUser: params!.chatUser!.id!); ? SvgPicture.asset(m.getType(m.sFileType), height: 30, width: 22, alignment: Alignment.center, fit: BoxFit.cover).paddingOnly(left: 21, right: 15)
}, : null,
).expanded, ),
), onChanged: (String val) {
m.inputBoxDirection(val);
m.userTypingInvoke(currentUser: AppState().chatDetails!.response!.id!, reciptUser: params!.chatUser!.id!);
},
).expanded,
if (m.sFileType.isNotEmpty) if (m.sFileType.isNotEmpty)
Row( Row(
children: <Widget>[ children: <Widget>[
@ -351,30 +342,45 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
} }
} }
void makeCall({required String callType}) async { void makeCall({required String callType, required HubConnection con}) async {
callPro.initCallListeners();
print("================== Make call Triggered ============================"); print("================== Make call Triggered ============================");
Map<String, dynamic> json = { Map<String, dynamic> json = {
"callerID": AppState().chatDetails!.response!.id!.toString(), "callerID": AppState().chatDetails!.response!.id!.toString(),
"callerDetails": AppState().chatDetails!.toJson(), "callReceiverID": params!.chatUser!.id.toString(),
"receiverID": params!.chatUser!.id.toString(), "notification_foreground": "true",
"receiverDetails": params!.chatUser!.toJson(), "message": "Aamir is calling",
"title": params!.chatUser!.userName!.replaceAll(".", " "), "title": "Video Call",
"calltype": callType == "VIDEO" ? "Video" : "Audio", "type": callType == "VIDEO" ? "Video" : "Audio",
"identity": AppState().chatDetails!.response!.userName,
"name": AppState().chatDetails!.response!.title,
"is_call": "true",
"is_webrtc": "true",
"contant": "Start video Call ${AppState().chatDetails!.response!.userName}",
"contantNo": "775d1f11-62d9-6fcc-91f6-21f8c14559fb",
"chatEventId": "3",
"fileTypeId": null,
"currentUserId": AppState().chatDetails!.response!.id!.toString(),
"chatSource": "1",
"userChatHistoryLineRequestList": [
{
"isSeen": false,
"isDelivered": false,
"targetUserId": params!.chatUser!.id!,
"targetUserStatus": 4,
}
],
// "server": "https://192.168.8.163:8086",
"server": "https://livecareturn.hmg.com:8086",
}; };
logger.w(json);
CallDataModel callData = CallDataModel.fromJson(json); CallDataModel callData = CallDataModel.fromJson(json);
await Navigator.push( await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => OutGoingCall( builder: (BuildContext context) => OutGoingCall(
isVideoCall: callType == "VIDEO" ? true : false, isVideoCall: callType == "VIDEO" ? true : false,
outGoingCallData: callData, OutGoingCallData: callData,
), ),
), ),
).then((value) { );
print("then");
callPro.stopListeners();
});
} }
} }

@ -52,11 +52,11 @@ class _ChatHomeState extends State<ChatHome> {
if (data.searchedChats == null || data.searchedChats!.isEmpty) { if (data.searchedChats == null || data.searchedChats!.isEmpty) {
data.isLoading = true; data.isLoading = true;
data.getUserRecentChats().whenComplete(() async { data.getUserRecentChats().whenComplete(() async {
// String isAppOpendByChat = await Utils.getStringFromPrefs("isAppOpendByChat"); String isAppOpendByChat = await Utils.getStringFromPrefs("isAppOpendByChat");
// String notificationData = await Utils.getStringFromPrefs("notificationData"); String notificationData = await Utils.getStringFromPrefs("notificationData");
// if (isAppOpendByChat != "null" || isAppOpendByChat == "true" && notificationData != "null") { if (isAppOpendByChat != "null" || isAppOpendByChat == "true" && notificationData != "null") {
// data.openChatByNoti(context); data.openChatByNoti(context);
// } }
}); });
} }
} }

@ -1,38 +0,0 @@
import 'package:flutter/material.dart';
import 'package:intl/intl.dart' as intl;
class CustomAutoDirection extends StatefulWidget {
final String text;
final Widget child;
final void Function(bool isRTL)? onDirectionChange;
const CustomAutoDirection({Key? key, required this.text, required this.child, this.onDirectionChange}) : super(key: key);
@override
_CustomAutoDirectionState createState() => _CustomAutoDirectionState();
}
class _CustomAutoDirectionState extends State<CustomAutoDirection> {
late String text;
late Widget childWidget;
@override
Widget build(BuildContext context) {
text = widget.text;
childWidget = widget.child;
return Directionality(textDirection: isRTL(text) ? TextDirection.rtl : TextDirection.ltr, child: childWidget);
}
@override
void didUpdateWidget(CustomAutoDirection oldWidget) {
if (isRTL(oldWidget.text) != isRTL(widget.text)) {
WidgetsBinding.instance.addPostFrameCallback((_) => widget.onDirectionChange?.call(isRTL(widget.text)));
}
super.didUpdateWidget(oldWidget);
}
bool isRTL(String text) {
if (text.isEmpty) return Directionality.of(context) == TextDirection.rtl;
return intl.Bidi.detectRtlDirectionality(text);
}
}

@ -6,8 +6,10 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_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/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/main.dart';
class EmployeeDigitialIdDialog extends StatelessWidget { class EmployeeDigitialIdDialog extends StatelessWidget {
@override @override

@ -11,12 +11,12 @@ import 'package:mohem_flutter_app/api/dashboard_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.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/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/env.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.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/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_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/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/main.dart';
import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart'; import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart';
import 'package:mohem_flutter_app/provider/chat_provider_model.dart'; import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
@ -60,13 +60,9 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
super.initState(); super.initState();
scheduleMicrotask(() { scheduleMicrotask(() {
data = Provider.of<DashboardProviderModel>(context, listen: false); data = Provider.of<DashboardProviderModel>(context, listen: false);
if (env.marathon) { marathonProvider = Provider.of<MarathonProvider>(context, listen: false);
marathonProvider = Provider.of<MarathonProvider>(context, listen: false); cProvider = Provider.of<ChatProviderModel>(context, listen: false);
} _bHubCon();
if (env.chat) {
cProvider = Provider.of<ChatProviderModel>(context, listen: false);
_bHubCon();
}
_onRefresh(true); _onRefresh(true);
}); });
} }
@ -80,8 +76,11 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
void checkSession() async { void checkSession() async {
try { try {
await DashboardApiClient().getOpenNotifications(); Utils.showLoading(context);
await DashboardApiClient().getOpenMissingSwipes();
Utils.hideLoading(context);
} catch (ex) { } catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
} }
} }
@ -90,28 +89,24 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
void dispose() { void dispose() {
WidgetsBinding.instance.removeObserver(this); WidgetsBinding.instance.removeObserver(this);
super.dispose(); super.dispose();
if (!cProvider.disbaleChatForThisUser) { chatHubConnection.stop();
chatHubConnection.stop();
}
} }
void _bHubCon() { void _bHubCon() {
cProvider.getUserAutoLoginToken().whenComplete(() async { cProvider.getUserAutoLoginToken().whenComplete(() async {
if (!cProvider.disbaleChatForThisUser) { String isAppOpendByChat = await Utils.getStringFromPrefs("isAppOpendByChat");
String isAppOpendByChat = await Utils.getStringFromPrefs("isAppOpendByChat"); if (isAppOpendByChat != null && isAppOpendByChat == "true") {
if (isAppOpendByChat != null && isAppOpendByChat == "true") { Utils.showLoading(context);
Utils.showLoading(context); cProvider.buildHubConnection();
cProvider.buildHubConnection(); Future.delayed(const Duration(seconds: 2), () async {
Future.delayed(const Duration(seconds: 2), () async { cProvider.invokeChatCounter(userId: AppState().chatDetails!.response!.id!);
cProvider.invokeChatCounter(userId: AppState().chatDetails!.response!.id!); gotoChat(context);
gotoChat(context); });
}); } else {
} else { cProvider.buildHubConnection();
cProvider.buildHubConnection(); Future.delayed(const Duration(seconds: 2), () {
Future.delayed(const Duration(seconds: 2), () { cProvider.invokeChatCounter(userId: AppState().chatDetails!.response!.id!);
cProvider.invokeChatCounter(userId: AppState().chatDetails!.response!.id!); });
});
}
} }
}); });
} }
@ -140,25 +135,14 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
// print(value.result!.data!.notificationTitle); // print(value.result!.data!.notificationTitle);
// }); // });
data.fetchListMenu(); data.fetchListMenu();
if (env.dashboard.attendance) { data.fetchAttendanceTracking(context);
data.fetchAttendanceTracking(context);
}
data.fetchWorkListCounter(context); data.fetchWorkListCounter(context);
if (env.dashboard.missingSwipe) { data.fetchMissingSwipe(context);
data.fetchMissingSwipe(context);
}
data.fetchLeaveTicketBalance(context, DateTime.now()); data.fetchLeaveTicketBalance(context, DateTime.now());
data.fetchMenuEntries(); data.fetchMenuEntries();
if (env.offersDiscount) { data.getCategoryOffersListAPI(context);
data.getCategoryOffersListAPI(context); marathonProvider.getMarathonDetailsFromApi();
} if (!isFromInit) checkHubCon();
if (env.marathon) {
marathonProvider.getMarathonDetailsFromApi();
}
if (env.chat) {
marathonProvider.getMarathonDetailsFromApi();
if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon();
}
_refreshController.refreshCompleted(); _refreshController.refreshCompleted();
} }
@ -209,11 +193,10 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
body: Column( body: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Builder(builder: (BuildContext context) { Builder(builder: (BuildContext context) {
return Row( return Row(
// mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Image.memory( Image.memory(
Utils.dataFromBase64String( Utils.dataFromBase64String(
@ -230,6 +213,11 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
height: 34, height: 34,
fit: BoxFit.cover, fit: BoxFit.cover,
).circle(50), ).circle(50),
// CircularAvatar(
// width: 34,
// height: 34,
// url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png",
// ),
8.width, 8.width,
SvgPicture.asset("assets/images/side_nav.svg"), SvgPicture.asset("assets/images/side_nav.svg"),
], ],
@ -237,14 +225,13 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
_scaffoldState.currentState!.openDrawer(); _scaffoldState.currentState!.openDrawer();
}); });
}), }),
Image.asset("assets/images/drawer/moe_logo_full.png", width: 130, height: 45), Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
SizedBox(width: 65), SvgPicture.asset(
// SvgPicture.asset( "assets/images/announcements.svg",
// "assets/images/announcements.svg", matchTextDirection: true,
// matchTextDirection: true, ).onPress(() async {
// ).onPress(() async { await Navigator.pushNamed(context, AppRoutes.announcements);
// await Navigator.pushNamed(context, AppRoutes.announcements); })
// })
], ],
).paddingOnly(left: 21, right: 21, top: 48, bottom: 7), ).paddingOnly(left: 21, right: 21, top: 48, bottom: 7),
Expanded( Expanded(
@ -269,119 +256,118 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
16.height, 16.height,
Row( Row(
children: [ children: [
if (env.dashboard.attendance) Expanded(
Expanded( child: AspectRatio(
child: AspectRatio( aspectRatio: 159 / 159,
aspectRatio: 159 / 159, child: Consumer<DashboardProviderModel>(
child: Consumer<DashboardProviderModel>( builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
builder: (BuildContext context, DashboardProviderModel model, Widget? child) { return (model.isAttendanceTrackingLoading
return (model.isAttendanceTrackingLoading ? GetAttendanceTrackingShimmer()
? GetAttendanceTrackingShimmer() : Container(
: Container( decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.circular(15),
borderRadius: BorderRadius.circular(15), gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [
gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [ MyColors.gradiantEndColor,
MyColors.gradiantEndColor, MyColors.gradiantStartColor,
MyColors.gradiantStartColor, ]),
]), ),
), child: Stack(
child: Stack( alignment: Alignment.center,
alignment: Alignment.center, children: [
children: [ if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"), Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Expanded(
Expanded( child: Column(
child: Column( mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
if (model.isTimeRemainingInSeconds != 0)
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
9.height,
Directionality(
textDirection: ui.TextDirection.ltr,
child: CountdownTimer(
endTime: model.endTime,
onEnd: null,
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
),
),
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
9.height,
ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(20)),
child: LinearProgressIndicator(
value: model.progress,
minHeight: 8,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor: const Color(0xff196D73),
),
),
],
),
],
).paddingOnly(top: 12, right: 15, left: 12),
),
Row(
children: [ children: [
Expanded( LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
child: Column( if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
if (model.isTimeRemainingInSeconds != 0)
Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.checkIn.tr().toText12(color: Colors.white), 9.height,
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn) Directionality(
.toString() textDirection: ui.TextDirection.ltr,
.toText14(color: Colors.white, isBold: true), child: CountdownTimer(
4.height, endTime: model.endTime,
onEnd: null,
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
),
),
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
9.height,
ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(20)),
child: LinearProgressIndicator(
value: model.progress,
minHeight: 8,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor: const Color(0xff196D73),
),
),
], ],
).paddingOnly(left: 12, right: 12),
),
Container(
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
width: 45,
height: 45,
padding: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
color: Color(0xff259EA4),
borderRadius: BorderRadius.only(
bottomRight: AppState().isArabic(context) ? Radius.circular(0) : Radius.circular(15),
bottomLeft: AppState().isArabic(context) ? Radius.circular(15) : Radius.circular(0),
),
), ),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/attendance.svg" : "assets/images/attendance.svg"),
).onPress(() {
showMyBottomSheet(
context,
callBackFunc: () {},
child: MarkAttendanceWidget(model, isFromDashboard: true),
);
}),
], ],
), ).paddingOnly(top: 12, right: 15, left: 12),
], ),
), Row(
], children: [
), Expanded(
).onPress( child: Column(
() { mainAxisSize: MainAxisSize.min,
Navigator.pushNamed(context, AppRoutes.todayAttendance); crossAxisAlignment: CrossAxisAlignment.start,
}, children: [
)) LocaleKeys.checkIn.tr().toText12(color: Colors.white),
.animatedSwither(); (model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn)
}, .toString()
), .toText14(color: Colors.white, isBold: true),
4.height,
],
).paddingOnly(left: 12, right: 12),
),
Container(
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
width: 45,
height: 45,
padding: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
color: Color(0xff259EA4),
borderRadius: BorderRadius.only(
bottomRight: AppState().isArabic(context) ? Radius.circular(0) : Radius.circular(15),
bottomLeft: AppState().isArabic(context) ? Radius.circular(15) : Radius.circular(0),
),
),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/attendance.svg" : "assets/images/attendance.svg"),
).onPress(() {
showMyBottomSheet(
context,
callBackFunc: () {},
child: MarkAttendanceWidget(model, isFromDashboard: true),
);
}),
],
),
],
),
],
),
).onPress(
() {
Navigator.pushNamed(context, AppRoutes.todayAttendance);
},
))
.animatedSwither();
},
), ),
), ),
if (env.dashboard.attendance) 9.width, ),
9.width,
Expanded( Expanded(
child: MenusWidget(), child: MenusWidget(),
), ),
@ -389,150 +375,102 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
), ),
], ],
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21), ).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
if (env.monthlyAttendance) Column(
InkWell( mainAxisSize: MainAxisSize.min,
child: Container( crossAxisAlignment: CrossAxisAlignment.start,
width: double.infinity, children: [
padding: EdgeInsets.all(12), Row(
margin: EdgeInsets.symmetric(horizontal: 21), crossAxisAlignment: CrossAxisAlignment.center,
decoration: const BoxDecoration( children: [
color: MyColors.gradiantStartColor, Expanded(
borderRadius: BorderRadius.all(Radius.circular(12)), child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
child: Row( mainAxisSize: MainAxisSize.min,
children: [ children: [
Expanded( LocaleKeys.offers.tr().toText12(),
child: Column( Row(
mainAxisAlignment: MainAxisAlignment.start, children: [
crossAxisAlignment: CrossAxisAlignment.start, LocaleKeys.discounts.tr().toText24(isBold: true),
children: [ 6.width,
LocaleKeys.employee_leaves_calender.tr().toText18(isBold: true, color: Colors.white), Container(
2.height, padding: const EdgeInsets.only(left: 8, right: 8),
LocaleKeys.view_your_leave_information.tr().toText12(color: Colors.white), decoration: BoxDecoration(
8.height, color: MyColors.yellowColor,
Container( borderRadius: BorderRadius.circular(10),
decoration: BoxDecoration( ),
color: Colors.white.withOpacity(0.4), child: LocaleKeys.newString.tr().toText10(isBold: true)),
borderRadius: const BorderRadius.all(Radius.circular(12)), ],
), ),
padding: EdgeInsets.all(8), ],
child: LocaleKeys.view_details.tr().toText14(color: Colors.white),
),
],
),
),
const Icon(
Icons.calendar_month,
color: Colors.white,
size: 80,
),
],
),
),
onTap: () {
Navigator.pushNamed(context, AppRoutes.monthlyAttendance);
},
),
21.height,
Visibility(
visible: env.offersDiscount,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
LocaleKeys.offers.tr().toText12(),
Row(
children: [
LocaleKeys.discounts.tr().toText24(isBold: true),
6.width,
Container(
padding: const EdgeInsets.only(left: 8, right: 8),
decoration: BoxDecoration(
color: MyColors.yellowColor,
borderRadius: BorderRadius.circular(10),
),
child: LocaleKeys.newString.tr().toText10(isBold: true)),
],
),
],
),
), ),
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() { ),
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
}) Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
], })
).paddingOnly(left: 21, right: 21), ],
Consumer<DashboardProviderModel>( ).paddingOnly(left: 21, right: 21),
builder: (BuildContext context, DashboardProviderModel model, Widget? child) { Consumer<DashboardProviderModel>(
return SizedBox( builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
height: 103 + 33, return SizedBox(
child: ListView.separated( height: 103 + 33,
shrinkWrap: true, child: ListView.separated(
physics: const BouncingScrollPhysics(), shrinkWrap: true,
padding: const EdgeInsets.only(left: 21, right: 21, top: 13), physics: const BouncingScrollPhysics(),
scrollDirection: Axis.horizontal, padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
itemBuilder: (BuildContext cxt, int index) { scrollDirection: Axis.horizontal,
return model.isOffersLoading itemBuilder: (BuildContext cxt, int index) {
? const OffersShimmerWidget() return model.isOffersLoading
: InkWell( ? const OffersShimmerWidget()
onTap: () { : InkWell(
navigateToDetails(data.getOffersList[index]); onTap: () {
}, navigateToDetails(data.getOffersList[index]);
child: SizedBox( },
width: 73, child: SizedBox(
child: Column( width: 73,
crossAxisAlignment: CrossAxisAlignment.center, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.center,
Container( children: [
width: 73, Container(
height: 73, width: 73,
decoration: BoxDecoration( height: 73,
color: Colors.white, decoration: BoxDecoration(
borderRadius: const BorderRadius.all( color: Colors.white,
Radius.circular(100), borderRadius: const BorderRadius.all(
), Radius.circular(100),
border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
), ),
child: ClipRRect( border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
borderRadius: const BorderRadius.all( ),
Radius.circular(50), child: ClipRRect(
), borderRadius: const BorderRadius.all(
child: Hero( Radius.circular(50),
tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!, ),
transitionOnUserGestures: true, child: Hero(
child: Image.network( tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!,
data.getOffersList[index].logo!, transitionOnUserGestures: true,
fit: BoxFit.contain, child: Image.network(
), data.getOffersList[index].bannerImage!,
fit: BoxFit.contain,
), ),
), ),
), ),
4.height, ),
Expanded( 4.height,
child: AppState().isArabic(context) Expanded(
? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1) child: AppState().isArabic(context)
: data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1), ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1)
), : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1),
], ),
), ],
), ),
); ),
}, );
separatorBuilder: (BuildContext cxt, int index) => 8.width, },
itemCount: 9), separatorBuilder: (BuildContext cxt, int index) => 8.width,
); itemCount: 9),
}, );
), },
], ),
), ],
), ),
Container( Container(
width: double.infinity, width: double.infinity,
@ -545,9 +483,8 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (env.marathon)
context.watch<MarathonProvider>().isLoading ? const MarathonBannerShimmer().paddingAll(20) : const MarathonBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 8),
ServicesWidget(), ServicesWidget(),
context.watch<MarathonProvider>().isLoading ? const MarathonBannerShimmer().paddingAll(20) : const MarathonBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 8),
], ],
), ),
), ),
@ -561,116 +498,108 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
drawer: SafeArea( drawer: SafeArea(
child: AppDrawer(onLanguageChange: _onRefresh), child: AppDrawer(onLanguageChange: _onRefresh),
), ),
bottomNavigationBar: !env.bottomBar bottomNavigationBar: SizedBox(
? null height: Platform.isAndroid ? 70 : 100,
: SizedBox( child: BottomNavigationBar(
height: Platform.isAndroid ? 70 : 100, items: <BottomNavigationBarItem>[
child: BottomNavigationBar( BottomNavigationBarItem(
items: <BottomNavigationBarItem>[ icon: SvgPicture.asset(
BottomNavigationBarItem( "assets/icons/home.svg",
icon: SvgPicture.asset( color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color,
"assets/icons/home.svg", ).paddingAll(4),
color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color, label: LocaleKeys.home.tr(),
).paddingAll(4), ),
label: LocaleKeys.home.tr(), BottomNavigationBarItem(
), icon: SvgPicture.asset(
BottomNavigationBarItem( "assets/icons/create_req.svg",
icon: SvgPicture.asset( color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color,
"assets/icons/create_req.svg", ).paddingAll(4),
color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color, label: LocaleKeys.mowadhafhiRequest.tr(),
).paddingAll(4), ),
label: LocaleKeys.mowadhafhiRequest.tr(), BottomNavigationBarItem(
), icon: Stack(
BottomNavigationBarItem( alignment: Alignment.centerLeft,
icon: Stack( children: [
alignment: Alignment.centerLeft, SvgPicture.asset(
children: [ "assets/icons/work_list.svg",
SvgPicture.asset( color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color,
"assets/icons/work_list.svg", ).paddingAll(4),
color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color, Consumer<DashboardProviderModel>(
).paddingAll(4), builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) {
Consumer<DashboardProviderModel>( if (data.workListCounter == 0) {
builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) { return const SizedBox();
if (data.workListCounter == 0) { }
return const SizedBox(); return Positioned(
} right: 0,
return Positioned( top: 0,
right: 0, child: Container(
top: 0, padding: const EdgeInsets.only(left: 4, right: 4),
child: Container( alignment: Alignment.center,
padding: const EdgeInsets.only(left: 4, right: 4), decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
alignment: Alignment.center, child: data.workListCounter.toString().toText10(color: Colors.white),
decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.workListCounter.toString().toText10(color: Colors.white),
),
);
},
), ),
], );
), },
label: LocaleKeys.workList.tr(),
),
BottomNavigationBarItem(
icon: SvgPicture.asset(
"assets/icons/item_for_sale.svg",
color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
label: LocaleKeys.itemsForSale.tr(),
), ),
BottomNavigationBarItem( ],
icon: Stack( ),
alignment: Alignment.centerLeft, label: LocaleKeys.workList.tr(),
children: [ ),
SvgPicture.asset( BottomNavigationBarItem(
"assets/icons/chat/chat.svg", icon: SvgPicture.asset(
color: currentIndex == 4 "assets/icons/item_for_sale.svg",
? MyColors.grey3AColor color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color,
: cProvider.disbaleChatForThisUser ).paddingAll(4),
? MyColors.lightGreyE3Color label: LocaleKeys.itemsForSale.tr(),
: MyColors.grey98Color, ),
).paddingAll(4), BottomNavigationBarItem(
Consumer<ChatProviderModel>( icon: Stack(
builder: (BuildContext cxt, ChatProviderModel data, Widget? child) { alignment: Alignment.centerLeft,
return Positioned( children: [
right: 0, SvgPicture.asset(
top: 0, "assets/icons/chat/chat.svg",
child: Container( color: currentIndex == 4 ? MyColors.grey3AColor : MyColors.grey98Color,
padding: const EdgeInsets.only(left: 4, right: 4), ).paddingAll(4),
alignment: Alignment.center, Consumer<ChatProviderModel>(
decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)), builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
child: data.chatUConvCounter.toString().toText10(color: Colors.white), return Positioned(
), right: 0,
); top: 0,
}, child: Container(
padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.chatUConvCounter.toString().toText10(color: Colors.white),
), ),
], );
), },
label: LocaleKeys.chat.tr(),
), ),
], ],
currentIndex: currentIndex,
selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600),
unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600),
type: BottomNavigationBarType.fixed,
selectedItemColor: MyColors.grey3AColor,
backgroundColor: MyColors.backgroundColor,
selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28),
unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28),
onTap: (int index) {
if (index == 1) {
Navigator.pushNamed(context, AppRoutes.mowadhafhi);
} else if (index == 2) {
Navigator.pushNamed(context, AppRoutes.workList);
} else if (index == 3) {
Navigator.pushNamed(context, AppRoutes.itemsForSale);
} else if (index == 4) {
if (!cProvider.disbaleChatForThisUser) {
Navigator.pushNamed(context, AppRoutes.chat);
}
}
},
), ),
label: LocaleKeys.chat.tr(),
), ),
],
currentIndex: currentIndex,
selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600),
unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600),
type: BottomNavigationBarType.fixed,
selectedItemColor: MyColors.grey3AColor,
backgroundColor: MyColors.backgroundColor,
selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28),
unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28),
onTap: (int index) {
if (index == 1) {
Navigator.pushNamed(context, AppRoutes.mowadhafhi);
} else if (index == 2) {
Navigator.pushNamed(context, AppRoutes.workList);
} else if (index == 3) {
Navigator.pushNamed(context, AppRoutes.itemsForSale);
} else if (index == 4) {
Navigator.pushNamed(context, AppRoutes.chat);
}
},
),
),
); );
} }

@ -1,594 +0,0 @@
// import 'dart:async';
// import 'dart:io';
//
// import 'dart:ui' as ui;
// import 'package:easy_localization/easy_localization.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
// import 'package:flutter_svg/flutter_svg.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/env.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/offers_and_discounts/get_offers_list.dart';
// import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
// import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
// import 'package:mohem_flutter_app/ui/landing/widget/app_drawer.dart';
// import 'package:mohem_flutter_app/ui/landing/widget/menus_widget.dart';
// import 'package:mohem_flutter_app/ui/landing/widget/services_widget.dart';
// import 'package:mohem_flutter_app/ui/marathon/marathon_provider.dart';
// import 'package:mohem_flutter_app/ui/marathon/widgets/marathon_banner.dart';
// import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
// import 'package:mohem_flutter_app/widgets/mark_attendance_widget.dart';
// import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
// import 'package:mohem_flutter_app/widgets/shimmer/offers_shimmer_widget.dart';
// import 'package:provider/provider.dart';
// import 'package:pull_to_refresh/pull_to_refresh.dart';
// import 'package:signalr_netcore/signalr_client.dart';
//
// late HubConnection chatHubConnection;
//
// class DashboardScreen extends StatefulWidget {
// DashboardScreen({Key? key}) : super(key: key);
//
// @override
// _DashboardScreenState createState() {
// return _DashboardScreenState();
// }
// }
//
// class _DashboardScreenState extends State<DashboardScreen> {
// late DashboardProviderModel data;
// late MarathonProvider marathonProvider;
// late ChatProviderModel cProvider;
// final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey();
//
// final RefreshController _refreshController = RefreshController(initialRefresh: false);
//
// int currentIndex = 0;
//
// @override
// void initState() {
// super.initState();
// scheduleMicrotask(() {
// data = Provider.of<DashboardProviderModel>(context, listen: false);
// if (env["marathon"]) {
// marathonProvider = Provider.of<MarathonProvider>(context, listen: false);
// }
// if (env["chat"]) {
// cProvider = Provider.of<ChatProviderModel>(context, listen: false);
// }
// _onRefresh();
// });
// }
//
// @override
// void dispose() {
// super.dispose();
// chatHubConnection.stop();
// }
//
// void _bHubCon() {
// cProvider.getUserAutoLoginToken().whenComplete(() {
// cProvider.buildHubConnection();
// Future.delayed(const Duration(seconds: 2), () {
// cProvider.invokeChatCounter(userId: AppState().chatDetails!.response!.id!);
// });
// });
// }
//
// void _onRefresh() async {
// data.initProvider();
// if (env["chat"]) {
// _bHubCon();
// }
// // data.getITGNotification().then((value) {
// // print("--------------------detail_1-----------------");
// // print(value!.result!.data!.notificationMasterId);
// // print(value.result!.data!.notificationTitle);
// // });
// data.fetchListMenu();
// if (env["dashboard"]["attendance"]) {
// data.fetchAttendanceTracking(context);
// }
// data.fetchWorkListCounter(context);
// if (env["dashboard"]["missingSwipe"]) {
// data.fetchMissingSwipe(context);
// }
// data.fetchLeaveTicketBalance(context, DateTime.now());
// data.fetchMenuEntries();
// data.getCategoryOffersListAPI(context);
// if (env["marathon"]) {
// marathonProvider.getMarathonDetailsFromApi();
// }
// _refreshController.refreshCompleted();
// }
//
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// key: _scaffoldState,
// // appBar: AppBar(
// // actions: [
// // IconButton(
// // onPressed: () {
// // data.getITGNotification().then((val) {
// // if (val!.result!.data != null) {
// // print("-------------------- Survey ----------------------------");
// // if (val.result!.data!.notificationType == "Survey") {
// // Navigator.pushNamed(context, AppRoutes.survey, arguments: val.result!.data);
// // } else {
// // print("------------------------------------------- Ads --------------------");
// // DashboardApiClient().getAdvertisementDetail(val.result!.data!.notificationMasterId ?? "").then(
// // (value) {
// // if (value!.mohemmItgResponseItem!.statusCode == 200) {
// // if (value.mohemmItgResponseItem!.result!.data != null) {
// // Navigator.pushNamed(context, AppRoutes.advertisement, arguments: {
// // "masterId": val.result!.data!.notificationMasterId,
// // "advertisement": value.mohemmItgResponseItem!.result!.data!.advertisement,
// // });
// //
// // // Navigator.push(
// // // context,
// // // MaterialPageRoute(
// // // builder: (BuildContext context) => ITGAdsScreen(
// // // addMasterId: val.result!.data!.notificationMasterId!,
// // // advertisement: value.mohemmItgResponseItem!.result!.data!.advertisement!,
// // // ),
// // // ),
// // // );
// // }
// // }
// // },
// // );
// // }
// // }
// // });
// // },
// // icon: Icon(Icons.add))
// // ],
// // ),
// body: Column(
// children: [
// Row(
// children: [
// Builder(builder: (BuildContext context) {
// return Row(
// mainAxisSize: MainAxisSize.min,
// children: [
// Image.memory(
// Utils.dataFromBase64String(
// AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
// ),
// errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {
// return SvgPicture.asset(
// "assets/images/user.svg",
// height: 34,
// width: 34,
// );
// },
// width: 34,
// height: 34,
// fit: BoxFit.cover,
// ).circle(50),
// // CircularAvatar(
// // width: 34,
// // height: 34,
// // url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png",
// // ),
// 8.width,
// SvgPicture.asset("assets/images/side_nav.svg"),
// ],
// ).onPress(() {
// _scaffoldState.currentState!.openDrawer();
// });
// }),
// Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
// SvgPicture.asset(
// "assets/images/announcements.svg",
// matchTextDirection: true,
// ).onPress(
// () async {
// await Navigator.pushNamed(context, AppRoutes.announcements);
// },
// )
// ],
// ).paddingOnly(left: 21, right: 21, top: 48, bottom: 7),
// Expanded(
// child: SmartRefresher(
// enablePullDown: true,
// enablePullUp: false,
// header: const MaterialClassicHeader(
// color: MyColors.gradiantEndColor,
// ),
// controller: _refreshController,
// onRefresh: _onRefresh,
// child: SingleChildScrollView(
// child: Column(
// children: [
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// LocaleKeys.welcomeBack.tr().toText14(color: MyColors.grey77Color),
// (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true),
// 16.height,
// Row(
// children: [
// if (env["dashboard"]["attendance"])
// Expanded(
// child: AspectRatio(
// aspectRatio: 159 / 159,
// child: Consumer<DashboardProviderModel>(
// builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
// return (model.isAttendanceTrackingLoading
// ? GetAttendanceTrackingShimmer()
// : Container(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(15),
// gradient: const LinearGradient(
// transform: GradientRotation(.46),
// begin: Alignment.topRight,
// end: Alignment.bottomLeft,
// colors: [
// MyColors.gradiantEndColor,
// MyColors.gradiantStartColor,
// ],
// ),
// ),
// child: Stack(
// alignment: Alignment.center,
// children: [
// if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Expanded(
// child: Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
// if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
// if (model.isTimeRemainingInSeconds != 0)
// Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// 9.height,
// Directionality(
// textDirection: ui.TextDirection.ltr,
// child: CountdownTimer(
// endTime: model.endTime,
// onEnd: null,
// endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
// textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
// ),
// ),
// LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
// 9.height,
// ClipRRect(
// borderRadius: const BorderRadius.all(Radius.circular(20)),
// child: LinearProgressIndicator(
// value: model.progress,
// minHeight: 8,
// valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
// backgroundColor: const Color(0xff196D73),
// ),
// ),
// ],
// ),
// ],
// ).paddingOnly(top: 12, right: 15, left: 12),
// ),
// Row(
// children: [
// Expanded(
// child: Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// LocaleKeys.checkIn.tr().toText12(color: Colors.white),
// (model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn)
// .toString()
// .toText14(color: Colors.white, isBold: true),
// 4.height,
// ],
// ).paddingOnly(left: 12, right: 12),
// ),
// Container(
// margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
// width: 45,
// height: 45,
// padding: const EdgeInsets.only(left: 10, right: 10),
// decoration: BoxDecoration(
// color: Color(0xff259EA4),
// borderRadius: BorderRadius.only(
// bottomRight: AppState().isArabic(context) ? Radius.circular(0) : Radius.circular(15),
// bottomLeft: AppState().isArabic(context) ? Radius.circular(15) : Radius.circular(0),
// ),
// ),
// child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/attendance.svg" : "assets/images/attendance.svg"),
// ).onPress(() {
// showMyBottomSheet(
// context,
// callBackFunc: () {},
// child: MarkAttendanceWidget(model, isFromDashboard: true),
// );
// }),
// ],
// ),
// ],
// ),
// ],
// ),
// ).onPress(
// () {
// Navigator.pushNamed(context, AppRoutes.todayAttendance);
// },
// ))
// .animatedSwither();
// },
// ),
// ),
// ),
// if (env["dashboard"]["attendance"]) 9.width,
// Expanded(
// child: MenusWidget(),
// ),
// ],
// ),
// ],
// ).paddingOnly(left: 21, right: 21, top: 7),
// if (env["marathon"])
// context.watch<MarathonProvider>().isLoading
// ? const MarathonBannerShimmer().paddingAll(20)
// : MarathonBanner(isMarathonUpcoming: context.watch<MarathonProvider>().isUpComingMarathon).paddingAll(20),
// ServicesWidget(),
// 8.height,
// if (env["offersDiscount"])
// Container(
// width: double.infinity,
// padding: const EdgeInsets.only(top: 31),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)),
// border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
// ),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Expanded(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// LocaleKeys.offers.tr().toText12(),
// Row(
// children: [
// LocaleKeys.discounts.tr().toText24(isBold: true),
// 6.width,
// Container(
// padding: const EdgeInsets.only(left: 8, right: 8),
// decoration: BoxDecoration(
// color: MyColors.yellowColor,
// borderRadius: BorderRadius.circular(10),
// ),
// child: LocaleKeys.newString.tr().toText10(isBold: true)),
// ],
// ),
// ],
// ),
// ),
// LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
// Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
// })
// ],
// ).paddingOnly(left: 21, right: 21),
// Consumer<DashboardProviderModel>(
// builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
// return SizedBox(
// height: 103 + 33,
// child: ListView.separated(
// shrinkWrap: true,
// physics: const BouncingScrollPhysics(),
// padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
// scrollDirection: Axis.horizontal,
// itemBuilder: (BuildContext cxt, int index) {
// return model.isOffersLoading
// ? const OffersShimmerWidget()
// : InkWell(
// onTap: () {
// navigateToDetails(data.getOffersList[index]);
// },
// child: SizedBox(
// width: 73,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Container(
// width: 73,
// height: 73,
// decoration: BoxDecoration(
// borderRadius: const BorderRadius.all(
// Radius.circular(100),
// ),
// border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
// ),
// child: ClipRRect(
// borderRadius: const BorderRadius.all(
// Radius.circular(50),
// ),
// child: Hero(
// tag: "ItemImage" + data.getOffersList[index].rowID!,
// transitionOnUserGestures: true,
// child: Image.network(
// data.getOffersList[index].bannerImage!,
// fit: BoxFit.contain,
// ),
// ),
// ),
// ),
// 4.height,
// Expanded(
// child: AppState().isArabic(context)
// ? data.getOffersList[index].titleAR!.toText12(isCenter: true, maxLine: 1)
// : data.getOffersList[index].title!.toText12(isCenter: true, maxLine: 1),
// ),
// ],
// ),
// ),
// );
// },
// separatorBuilder: (BuildContext cxt, int index) => 8.width,
// itemCount: 6),
// );
// },
// ),
// ],
// ),
// )
// ],
// ),
// ),
// ),
// )
// ],
// ),
// drawer: SafeArea(
// child: AppDrawer(onLanguageChange: _onRefresh),
// ),
// bottomNavigationBar: !env["bottomBar"]
// ? null
// : SizedBox(
// height: Platform.isAndroid ? 70 : 100,
// child: BottomNavigationBar(
// items: <BottomNavigationBarItem>[
// BottomNavigationBarItem(
// icon: SvgPicture.asset(
// "assets/icons/home.svg",
// color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color,
// ).paddingAll(4),
// label: LocaleKeys.home.tr(),
// ),
// BottomNavigationBarItem(
// icon: SvgPicture.asset(
// "assets/icons/create_req.svg",
// color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color,
// ).paddingAll(4),
// label: LocaleKeys.createRequest.tr(),
// ),
// BottomNavigationBarItem(
// icon: Stack(
// alignment: Alignment.centerLeft,
// children: [
// SvgPicture.asset(
// "assets/icons/work_list.svg",
// color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color,
// ).paddingAll(4),
// Consumer<DashboardProviderModel>(
// builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) {
// if (data.workListCounter == 0) {
// return const SizedBox();
// }
// return Positioned(
// right: 0,
// top: 0,
// child: Container(
// padding: const EdgeInsets.only(left: 4, right: 4),
// alignment: Alignment.center,
// decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
// child: data.workListCounter.toString().toText10(color: Colors.white),
// ),
// );
// },
// ),
// ],
// ),
// label: LocaleKeys.workList.tr(),
// ),
// BottomNavigationBarItem(
// icon: SvgPicture.asset(
// "assets/icons/item_for_sale.svg",
// color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color,
// ).paddingAll(4),
// label: LocaleKeys.itemsForSale.tr(),
// ),
// BottomNavigationBarItem(
// icon: Stack(
// alignment: Alignment.centerLeft,
// children: [
// SvgPicture.asset(
// "assets/icons/chat/chat.svg",
// color: currentIndex == 4 ? MyColors.grey3AColor : MyColors.grey98Color,
// ).paddingAll(4),
// Consumer<ChatProviderModel>(
// builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
// return Positioned(
// right: 0,
// top: 0,
// child: Container(
// padding: const EdgeInsets.only(left: 4, right: 4),
// alignment: Alignment.center,
// decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
// child: data.chatUConvCounter.toString().toText10(color: Colors.white),
// ),
// );
// },
// ),
// ],
// ),
// label: LocaleKeys.chat.tr(),
// ),
// ],
// currentIndex: currentIndex,
// selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600),
// unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600),
// type: BottomNavigationBarType.fixed,
// selectedItemColor: MyColors.grey3AColor,
// backgroundColor: MyColors.backgroundColor,
// selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28),
// unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28),
// onTap: (int index) {
// if (index == 1) {
// Navigator.pushNamed(context, AppRoutes.mowadhafhi);
// } else if (index == 2) {
// Navigator.pushNamed(context, AppRoutes.workList);
// } else if (index == 3) {
// Navigator.pushNamed(context, AppRoutes.itemsForSale);
// } else if (index == 4) {
// Navigator.pushNamed(context, AppRoutes.chat);
// }
// },
// ),
// ),
// );
// }
//
// void navigateToDetails(OffersListModel offersListModelObj) {
// List<OffersListModel> getOffersDetailList = [];
// getOffersDetailList.clear();
// int counter = 1;
//
// getOffersDetailList.add(offersListModelObj);
//
// for (OffersListModel element in data.getOffersList) {
// if (counter <= 4) {
// if (element.rowID != offersListModelObj.rowID) {
// getOffersDetailList.add(element);
// counter++;
// }
// }
// }
//
// Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails, arguments: getOffersDetailList);
// }
// }

@ -5,7 +5,6 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/app_state/app_state.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/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/env.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.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/string_extensions.dart';
@ -30,14 +29,12 @@ class AppDrawer extends StatefulWidget {
class _AppDrawerState extends State<AppDrawer> { class _AppDrawerState extends State<AppDrawer> {
List<DrawerMenuItem> drawerMenuItemList = []; List<DrawerMenuItem> drawerMenuItemList = [];
ChatProviderModel? chatData; late ChatProviderModel chatData;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if (env.chat) { chatData = Provider.of<ChatProviderModel>(context, listen: false);
chatData = Provider.of<ChatProviderModel>(context, listen: false);
}
} }
@override @override
@ -51,9 +48,9 @@ class _AppDrawerState extends State<AppDrawer> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
// Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 24), Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 24),
const Icon(Icons.clear).onPress(() => Navigator.pop(context)), const Icon(Icons.clear).onPress(() => Navigator.pop(context)),
], ],
).paddingOnly(left: 4, right: 14), ).paddingOnly(left: 4, right: 14),
@ -120,37 +117,29 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.pushNamed(context, drawerMenuItemList[index].routeName); Navigator.pushNamed(context, drawerMenuItemList[index].routeName);
}); });
}), }),
// menuItem("assets/images/drawer/employee_id.svg", LocaleKeys.employeeDigitalID.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: EmployeeDigitialIdDialog())), menuItem("assets/images/drawer/employee_id.svg", LocaleKeys.employeeDigitalID.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: EmployeeDigitialIdDialog())),
// if (AppState().businessCardPrivilege) if (AppState().businessCardPrivilege)
// menuItem("assets/images/drawer/view_business_card.svg", LocaleKeys.viewBusinessCard.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: BusinessCardDialog())), menuItem("assets/images/drawer/view_business_card.svg", LocaleKeys.viewBusinessCard.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: BusinessCardDialog())),
//
menuItem("assets/images/drawer/help.png", LocaleKeys.help.tr(), "", closeDrawer: true, onPress: () {
Navigator.pushNamed(context, AppRoutes.help);
}),
menuItem("assets/images/drawer/hierarchy.png", LocaleKeys.hierarchy.tr(), "", closeDrawer: true, onPress: () {
Navigator.pushNamed(context, AppRoutes.hierarchy);
}),
menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: performLogout), menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: performLogout),
// menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: () {Navigator.pushNamed(context, AppRoutes.survey,); // menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: () {Navigator.pushNamed(context, AppRoutes.survey,);
], ],
).expanded, ).expanded,
// const Divider( const Divider(
// height: 1, height: 1,
// thickness: 1, thickness: 1,
// color: MyColors.lightGreyEFColor, color: MyColors.lightGreyEFColor,
// ), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
// RichText( RichText(
// text: TextSpan(text: LocaleKeys.poweredBy.tr() + " ", style: const TextStyle(color: MyColors.grey98Color, fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600), children: [ text: TextSpan(text: LocaleKeys.poweredBy.tr() + " ", style: const TextStyle(color: MyColors.grey98Color, fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600), children: [
// TextSpan( TextSpan(
// text: LocaleKeys.cloudSolutions.tr(), text: LocaleKeys.cloudSolutions.tr(),
// style: const TextStyle(color: MyColors.grey3AColor, fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600), style: const TextStyle(color: MyColors.grey3AColor, fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600),
// ), ),
// ]), ]),
// ).expanded, ).expanded,
Image.asset("assets/images/drawer/moe_logo.png", width: 60, height: 60) Image.asset("assets/images/logos/bn_cloud_soloution.jpg", width: 40, height: 40)
], ],
).paddingOnly(left: 21, right: 21, top: 21) ).paddingOnly(left: 21, right: 21, top: 21)
], ],
@ -161,8 +150,7 @@ class _AppDrawerState extends State<AppDrawer> {
Widget menuItem(String icon, String title, String routeName, {Color? color, bool closeDrawer = true, VoidCallback? onPress}) { Widget menuItem(String icon, String title, String routeName, {Color? color, bool closeDrawer = true, VoidCallback? onPress}) {
return Row( return Row(
children: [ children: [
if (icon.contains("png")) Image.asset(icon, height: 20, width: 20), SvgPicture.asset(icon, height: 20, width: 20),
if (icon.contains("svg")) SvgPicture.asset(icon, height: 20, width: 20),
9.width, 9.width,
title.toText14(color: color, textAlign: AppState().isArabic(context) ? TextAlign.right : null).expanded, title.toText14(color: color, textAlign: AppState().isArabic(context) ? TextAlign.right : null).expanded,
], ],
@ -187,7 +175,7 @@ class _AppDrawerState extends State<AppDrawer> {
AppState().isAuthenticated = false; AppState().isAuthenticated = false;
AppState().isLogged = false; AppState().isLogged = false;
AppState().setPostParamsInitConfig(); AppState().setPostParamsInitConfig();
chatData?.disposeData(); chatData.disposeData();
// SharedPreferences prefs = await SharedPreferences.getInstance(); // SharedPreferences prefs = await SharedPreferences.getInstance();
// await prefs.clear(); // await prefs.clear();
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route<dynamic> route) => false, arguments: null); Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route<dynamic> route) => false, arguments: null);

@ -2,14 +2,12 @@ import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/config/env.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/string_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/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/ui/screens/my_requests/new_request.dart';
import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart'; import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -21,7 +19,7 @@ class MenusWidget extends StatelessWidget {
return Consumer<DashboardProviderModel>( return Consumer<DashboardProviderModel>(
builder: (cxt, data, child) { builder: (cxt, data, child) {
return GridView( return GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 1.75, crossAxisSpacing: 9, mainAxisSpacing: 9), gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 2 / 2, crossAxisSpacing: 9, mainAxisSpacing: 9),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
shrinkWrap: true, shrinkWrap: true,
primary: false, primary: false,
@ -54,52 +52,24 @@ class MenusWidget extends StatelessWidget {
).onPress(() { ).onPress(() {
Navigator.pushNamed(context, AppRoutes.workList); Navigator.pushNamed(context, AppRoutes.workList);
}), }),
if (env.dashboard.missingSwipe) data.isMissingSwipeLoading
data.isMissingSwipeLoading
? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context);
})
: Container(
decoration: BoxDecoration(
color: Color(namesColor[1]),
borderRadius: BorderRadius.circular(10),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.missingSwipes.tr().toText12(color: Colors.white),
Row(
children: [
Expanded(
child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
],
)
],
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));
}),
data.isLeaveTicketBalanceLoading
? MenuShimmer().onPress(() { ? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context); data.fetchWorkListCounter(context);
}) })
: Container( : Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(namesColor[2]), color: Color(namesColor[1]),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.leaveBalance.tr().toText12(color: Colors.white), LocaleKeys.missingSwipes.tr().toText12(color: Colors.white),
Row( Row(
children: [ children: [
Expanded( Expanded(
child: (data.leaveBalance)!.toStringAsFixed(0).toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
), ),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
], ],
@ -107,7 +77,7 @@ class MenusWidget extends StatelessWidget {
], ],
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6), ).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress(() { ).onPress(() {
Navigator.pushNamed(context, AppRoutes.leaveBalance); Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));
}), }),
data.isLeaveTicketBalanceLoading data.isLeaveTicketBalanceLoading
? MenuShimmer().onPress(() { ? MenuShimmer().onPress(() {
@ -122,11 +92,11 @@ class MenusWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.businessTripBalance.tr().toText12(color: Colors.white), LocaleKeys.leaveBalance.tr().toText12(color: Colors.white),
Row( Row(
children: [ children: [
Expanded( Expanded(
child: data.businessTrip.toStringAsFixed(0).toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.leaveBalance.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
), ),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
], ],
@ -134,44 +104,11 @@ class MenusWidget extends StatelessWidget {
], ],
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6), ).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress(() { ).onPress(() {
//Navigator.pushNamed(context, AppRoutes.leaveBalance); Navigator.pushNamed(context, AppRoutes.leaveBalance);
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.business_mission.tr(), "XXX_HR_EIT_BUSINESS_MISSION_SS"));
}), }),
if (env.dashboard.ticketBalance) data.isLeaveTicketBalanceLoading
data.isLeaveTicketBalanceLoading
? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context);
})
: Container(
decoration: BoxDecoration(
color: Color(namesColor[3]),
borderRadius: BorderRadius.circular(10),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.ticketBalance.tr().toText12(color: Colors.white),
Row(
children: [
Expanded(
child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
],
)
],
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress(
() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.ticketBalance.tr(), "HMG_TKT_NEW_EIT_SS"));
},
),
data.isMyRequestLoading
? MenuShimmer().onPress(() { ? MenuShimmer().onPress(() {
data.fetchListMenu(); data.fetchWorkListCounter(context);
}) })
: Container( : Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -182,13 +119,12 @@ class MenusWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.myRequest.tr().toText12(color: Colors.white), LocaleKeys.ticketBalance.tr().toText12(color: Colors.white),
Row( Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
// Expanded( Expanded(
// child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.ticketBalance.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
// ), ),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
], ],
) )
@ -196,7 +132,7 @@ class MenusWidget extends StatelessWidget {
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6), ).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress( ).onPress(
() { () {
Navigator.pushNamed(context, AppRoutes.myRequests, arguments: NewRequestModel(groupID: data.myRequest!.requestGroupId)); Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.ticketBalance.tr(), "HMG_TKT_NEW_EIT_SS"));
}, },
) )
], ],

@ -1,5 +1,3 @@
import 'dart:convert';
import 'package:easy_localization/src/public_ext.dart'; import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
@ -13,7 +11,6 @@ import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/services_menu_list_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/services_menu_list_screen.dart';
import 'package:mohem_flutter_app/ui/screens/my_requests/new_request.dart';
import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart'; import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -33,7 +30,7 @@ class ServicesWidget extends StatelessWidget {
]; ];
return Consumer<DashboardProviderModel>( return Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel data, Widget? child) { builder: (context, data, child) {
return data.isServicesMenusLoading return data.isServicesMenusLoading
? whileLoading() ? whileLoading()
: ListView.separated( : ListView.separated(
@ -72,15 +69,12 @@ class ServicesWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image.memory( SvgPicture.asset(AppState().isArabic(context) ? getMenuIconAr(data.homeMenus![parentIndex].menuEntiesList[index].prompt!) : getMenuIconEn(data.homeMenus![parentIndex].menuEntiesList[index].prompt!)),
const Base64Decoder().convert(data.homeMenus![parentIndex].menuEntiesList[index].icon ?? ""),
scale: 1.25,
),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Expanded( Expanded(
child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText10(isBold: true), child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText11(isBold: true),
), ),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)),
], ],
@ -92,13 +86,13 @@ class ServicesWidget extends StatelessWidget {
}), }),
); );
}, },
separatorBuilder: (BuildContext cxt, int index) => 9.width, separatorBuilder: (cxt, index) => 9.width,
itemCount: data.homeMenus![parentIndex].menuEntiesList.length), itemCount: data.homeMenus![parentIndex].menuEntiesList.length),
), ),
], ],
); );
}, },
separatorBuilder: (BuildContext context, int index) { separatorBuilder: (context, index) {
return 12.height; return 12.height;
}, },
shrinkWrap: true, shrinkWrap: true,
@ -195,25 +189,8 @@ class ServicesWidget extends StatelessWidget {
} }
void handleOnPress(context, GetMenuEntriesList menuEntry) { void handleOnPress(context, GetMenuEntriesList menuEntry) {
print(menuEntry.requestType);
var pro = Provider.of<DashboardProviderModel>(context, listen: false); var pro = Provider.of<DashboardProviderModel>(context, listen: false);
// if (menuEntry.requestType == "PMS") { if (menuEntry.requestType == "MONTHLY_ATTENDANCE") {
// Navigator.pushNamed(context, AppRoutes.newRequest, arguments: NewRequestModel(functionName: menuEntry.functionName, prompt: menuEntry.prompt));
// } else
if (menuEntry.requestType == "CCP") {
Navigator.pushNamed(context, AppRoutes.newRequest, arguments: NewRequestModel(functionName: menuEntry.functionName, prompt: menuEntry.prompt));
} else if (menuEntry.requestType == "PAR") {
Navigator.pushNamed(context, AppRoutes.performanceEvaluation);
} else if (menuEntry.requestType == "BASIC_DETAILS") {
Navigator.pushNamed(context, AppRoutes.basicDetails);
return;
} else if (menuEntry.requestType == "PHONE_NUMBERS") {
Navigator.pushNamed(context, AppRoutes.contactDetails);
return;
} else if (menuEntry.requestType == "ADDRESS") {
Navigator.pushNamed(context, AppRoutes.contactDetails);
return;
} else if (menuEntry.requestType == "MONTHLY_ATTENDANCE") {
Navigator.pushNamed(context, AppRoutes.monthlyAttendance); Navigator.pushNamed(context, AppRoutes.monthlyAttendance);
return; return;
} else if (menuEntry.requestType == "VACATION_RULE") { } else if (menuEntry.requestType == "VACATION_RULE") {
@ -225,7 +202,6 @@ class ServicesWidget extends StatelessWidget {
} }
List<GetMenuEntriesList> menuList = pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION")).toList() ?? []; List<GetMenuEntriesList> menuList = pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION")).toList() ?? [];
menuEntry.icon = ""; menuEntry.icon = "";
menuList = [];
if (menuList.isEmpty) { if (menuList.isEmpty) {
if (menuEntry.requestType == "EIT") { if (menuEntry.requestType == "EIT") {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(menuEntry.prompt!, menuEntry.functionName!)); Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(menuEntry.prompt!, menuEntry.functionName!));
@ -265,13 +241,13 @@ class ServicesWidget extends StatelessWidget {
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13), padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13),
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext cxt, int index) { itemBuilder: (cxt, index) {
return AspectRatio( return AspectRatio(
aspectRatio: 105 / 105, aspectRatio: 105 / 105,
child: ServicesMenuShimmer(), child: ServicesMenuShimmer(),
); );
}, },
separatorBuilder: (BuildContext cxt, int index) => 9.width, separatorBuilder: (cxt, index) => 9.width,
itemCount: 4, itemCount: 4,
), ),
), ),

@ -236,27 +236,27 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
}, },
), ),
12.height, 12.height,
// DynamicTextFieldWidget( DynamicTextFieldWidget(
// LocaleKeys.selectEmployee.tr(), LocaleKeys.selectEmployee.tr(),
// selectedReplacementEmployee == null ? LocaleKeys.searchForEmployee.tr() : selectedReplacementEmployee!.employeeDisplayName ?? "", selectedReplacementEmployee == null ? LocaleKeys.searchForEmployee.tr() : selectedReplacementEmployee!.employeeDisplayName ?? "",
// isEnable: false, isEnable: false,
// onTap: () { onTap: () {
// showMyBottomSheet( showMyBottomSheet(
// context, context,
// callBackFunc: () {}, callBackFunc: () {},
// child: SearchEmployeeBottomSheet( child: SearchEmployeeBottomSheet(
// title: LocaleKeys.searchForEmployee.tr(), title: LocaleKeys.searchForEmployee.tr(),
// apiMode: LocaleKeys.delegate.tr(), apiMode: LocaleKeys.delegate.tr(),
// fromChat: false, fromChat: false,
// onSelectEmployee: (_selectedEmployee) { onSelectEmployee: (_selectedEmployee) {
// // Navigator.pop(context); // Navigator.pop(context);
// selectedReplacementEmployee = _selectedEmployee; selectedReplacementEmployee = _selectedEmployee;
// setState(() {}); setState(() {});
// }, },
// ), ),
// ); );
// }, },
// ), ),
12.height, 12.height,
DynamicTextFieldWidget( DynamicTextFieldWidget(
LocaleKeys.comments.tr(), LocaleKeys.comments.tr(),
@ -313,7 +313,6 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
model.eSERVICESDV?.pIDCOLUMNNAME ?? "", model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y", isReadOnly: model.rEADONLY == "Y",
isInputTypeNum: true, isInputTypeNum: true,
length: model.mAXIMUMSIZE,
onChange: (text) { onChange: (text) {
model.eSERVICESDV ??= ESERVICESDV(); model.eSERVICESDV ??= ESERVICESDV();
model.eSERVICESDV!.pIDCOLUMNNAME = text; model.eSERVICESDV!.pIDCOLUMNNAME = text;
@ -502,7 +501,6 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "", model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y", isReadOnly: model.rEADONLY == "Y",
length: model.mAXIMUMSIZE,
onChange: (text) { onChange: (text) {
//model.fieldAnswer = text; //model.fieldAnswer = text;
}, },

@ -8,7 +8,6 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_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/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/leave_balance/get_absence_transaction_list_model.dart'; import 'package:mohem_flutter_app/models/leave_balance/get_absence_transaction_list_model.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/balances_dashboard_widget.dart'; import 'package:mohem_flutter_app/widgets/balances_dashboard_widget.dart';
import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart';
@ -118,9 +117,7 @@ class _LeaveBalanceState extends State<LeaveBalance> {
), ),
child: const Icon(Icons.add, color: Colors.white, size: 30), child: const Icon(Icons.add, color: Colors.white, size: 30),
).onPress(() { ).onPress(() {
//Navigator.pushNamed(context, AppRoutes.addLeaveBalance, arguments: employeeId); Navigator.pushNamed(context, AppRoutes.addLeaveBalance, arguments: employeeId);
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.create_absence_request.tr(), "XXX_HR_EIT_LOA_CREATE_SS"));
}), }),
); );
} }

@ -8,19 +8,18 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:mohem_flutter_app/api/login_api_client.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/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/consts.dart'; import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/classes/notifications.dart'; import 'package:mohem_flutter_app/classes/notifications.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/env.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.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/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_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/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/main.dart';
import 'package:mohem_flutter_app/models/check_mobile_app_version_model.dart'; import 'package:mohem_flutter_app/models/check_mobile_app_version_model.dart';
import 'package:mohem_flutter_app/models/get_mobile_login_info_list_model.dart'; import 'package:mohem_flutter_app/models/get_mobile_login_info_list_model.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart'; import 'package:mohem_flutter_app/models/member_information_list_model.dart';
@ -28,6 +27,7 @@ import 'package:mohem_flutter_app/models/member_login_list_model.dart';
import 'package:mohem_flutter_app/models/privilege_list_model.dart'; import 'package:mohem_flutter_app/models/privilege_list_model.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/input_widget.dart'; import 'package:mohem_flutter_app/widgets/input_widget.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:safe_device/safe_device.dart'; import 'package:safe_device/safe_device.dart';
import 'package:wifi_iot/wifi_iot.dart'; import 'package:wifi_iot/wifi_iot.dart';
@ -58,12 +58,9 @@ class _LoginScreenState extends State<LoginScreen> {
bool isOnExternalStorage = false; bool isOnExternalStorage = false;
bool isDevelopmentModeEnable = false; bool isDevelopmentModeEnable = false;
late HmsApiAvailability hmsApiAvailability;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
hmsApiAvailability = HmsApiAvailability();
// checkFirebaseToken(); // checkFirebaseToken();
// if (kReleaseMode) { // if (kReleaseMode) {
// checkDeviceSafety(); // checkDeviceSafety();
@ -97,27 +94,21 @@ class _LoginScreenState extends State<LoginScreen> {
Future<void> checkFirebaseToken() async { Future<void> checkFirebaseToken() async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
if (Platform.isAndroid) { await Firebase.initializeApp();
try { _firebaseMessaging = FirebaseMessaging.instance;
await hmsApiAvailability.isHMSAvailable().then((value) async { firebaseToken = await _firebaseMessaging.getToken();
if (value == 0) { AppNotifications().init(firebaseToken);
AppState().setIsHuawei = true; loginInfo = await LoginApiClient().getMobileLoginInfoNEW(firebaseToken ?? "", Platform.isAndroid ? "android" : "ios");
AppNotifications().initHuaweiPush(checkLoginInfo); if (loginInfo == null) {
} else { await checkPrefs();
await Firebase.initializeApp(); _autoLogin = false;
_firebaseMessaging = FirebaseMessaging.instance; Utils.hideLoading(context);
firebaseToken = await _firebaseMessaging.getToken(); return;
AppNotifications().init(firebaseToken);
checkLoginInfo();
}
});
} catch (ex) {}
} else { } else {
await Firebase.initializeApp(); loginInfo!.deviceToken = firebaseToken;
_firebaseMessaging = FirebaseMessaging.instance; await checkPrefs();
firebaseToken = await _firebaseMessaging.getToken(); Utils.hideLoading(context);
AppNotifications().init(firebaseToken); performLogin();
checkLoginInfo();
} }
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
@ -125,24 +116,9 @@ class _LoginScreenState extends State<LoginScreen> {
} }
} }
void checkLoginInfo() async {
loginInfo = await LoginApiClient().getMobileLoginInfoNEW(AppState().getIsHuawei ? AppState().getHuaweiPushToken : firebaseToken ?? "", Platform.isAndroid ? "android" : "ios");
if (loginInfo == null) {
await checkPrefs();
_autoLogin = false;
Utils.hideLoading(context);
return;
} else {
loginInfo!.deviceToken = firebaseToken;
await checkPrefs();
Utils.hideLoading(context);
performLogin();
}
}
Future<void> checkPrefs() async { Future<void> checkPrefs() async {
String username = await Utils.getStringFromPrefs(SharedPrefsConsts.username); String username = await Utils.getStringFromPrefs(SharedPrefsConsts.username);
if (username.isNotEmpty) { // for test purpose i added ! if (username.isNotEmpty) {
String password = await Utils.getStringFromPrefs(SharedPrefsConsts.password); String password = await Utils.getStringFromPrefs(SharedPrefsConsts.password);
// String firebaseToken = await Utils.getStringFromPrefs(SharedPrefsConsts.firebaseToken); // String firebaseToken = await Utils.getStringFromPrefs(SharedPrefsConsts.firebaseToken);
// print("firebaseToken:$firebaseToken"); // print("firebaseToken:$firebaseToken");
@ -152,7 +128,6 @@ class _LoginScreenState extends State<LoginScreen> {
} }
} }
void performLogin() async { void performLogin() async {
Utils.showLoading(context); Utils.showLoading(context);
try { try {
@ -184,35 +159,21 @@ class _LoginScreenState extends State<LoginScreen> {
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
username.text = "1002528733";
password.text = "moe123456";
if (isAppOpenBySystem == null) { if (isAppOpenBySystem == null) {
isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool; isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool;
if (!kReleaseMode) { if (!kReleaseMode) {
// username.text = "1100313582"; // username.text = "15444"; // Maha User
// password.text = "moe123456"; username.text = "15153"; // Tamer User
password.text = "Abcd@12345";
username.text = "1024056812"; // username.text = "206535"; // Hashim User
password.text = "moe123456"; // password.text = "Namira786";
// 1) Normal user : // 13777
// Username: 1100313582 // Ab12345cd
// Employee # and Name: 210624 - شهد خالد ابراهيم الشامخ
// Password: moe123456
//
// 2) Normal user :
// Username: 1002528733
// Employee # and Name: 221142 - فؤاد محمدامين بكر موسى
// moe123456
//
//
// 3) HR User Account
// Username: 1087779144
// Employee # and Name: 190089 - عبدالله عبدالرحمن محمد الشهري
// Password: moe123456
} }
if (isAppOpenBySystem!) checkFirebaseToken(); if (isAppOpenBySystem!) checkFirebaseToken();
} }
@ -230,24 +191,24 @@ class _LoginScreenState extends State<LoginScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Image.asset("assets/images/drawer/moe_logo.png", width: 60, height: 60), Expanded(child: SizedBox()),
Row(
Row(children: [ children: [
LocaleKeys.english.tr().toText14(color: AppState().isArabic(context) ? null : MyColors.textMixColor).onPress(() { LocaleKeys.english.tr().toText14(color: AppState().isArabic(context) ? null : MyColors.textMixColor).onPress(() {
context.setLocale(const Locale("en", "US")); context.setLocale(const Locale("en", "US"));
}), }),
Container( Container(
width: 1, width: 1,
color: MyColors.darkWhiteColor, color: MyColors.darkWhiteColor,
height: 16, height: 16,
margin: const EdgeInsets.only(left: 10, right: 10), margin: const EdgeInsets.only(left: 10, right: 10),
), ),
LocaleKeys.arabic.tr().toText14(color: !AppState().isArabic(context) ? null : MyColors.textMixColor).onPress(() { LocaleKeys.arabic.tr().toText14(color: !AppState().isArabic(context) ? null : MyColors.textMixColor).onPress(() {
context.setLocale(const Locale("ar", "SA")); context.setLocale(const Locale("ar", "SA"));
}), }),
],) ],
),
], ],
), ),
Expanded( Expanded(
@ -263,13 +224,12 @@ class _LoginScreenState extends State<LoginScreen> {
12.height, 12.height,
InputWidget(LocaleKeys.password.tr(), "xxxxxx", password, isTextIsPassword: true), InputWidget(LocaleKeys.password.tr(), "xxxxxx", password, isTextIsPassword: true),
9.height, 9.height,
if (env.login.forgetPassword) Align(
Align( alignment: Alignment.centerRight,
alignment: Alignment.centerRight, child: LocaleKeys.forgotPassword.tr().toText12(isUnderLine: true, color: MyColors.textMixColor).onPress(() {
child: LocaleKeys.forgotPassword.tr().toText12(isUnderLine: true, color: MyColors.textMixColor).onPress(() { Navigator.pushNamed(context, AppRoutes.forgotPassword);
Navigator.pushNamed(context, AppRoutes.forgotPassword); }),
}), ),
),
20.height, 20.height,
// DefaultButton( // DefaultButton(
// "Connect HMG Network", // "Connect HMG Network",

@ -11,7 +11,6 @@ import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/date_uitl.dart'; import 'package:mohem_flutter_app/classes/date_uitl.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/env.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/dialogs/otp_dialog.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/int_extensions.dart';
@ -21,7 +20,10 @@ 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/basic_member_information_model.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/get_mobile_login_info_list_model.dart'; import 'package:mohem_flutter_app/models/get_mobile_login_info_list_model.dart';
import 'package:mohem_flutter_app/ui/dialogs/id/business_card_dialog.dart';
import 'package:mohem_flutter_app/ui/dialogs/id/employee_digital_id_dialog.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/dialogs/dialogs.dart';
// WhatsApp 4 // WhatsApp 4
// SMS 1 // SMS 1
@ -60,54 +62,29 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
String empName = mobileLoginInfoListModel!.employeeName!; String empName = mobileLoginInfoListModel!.employeeName!;
return Scaffold( return Scaffold(
// appBar: AppBar( appBar: AppBar(
// backgroundColor: Colors.transparent,
// backgroundColor: Colors.transparent, automaticallyImplyLeading: false,
// automaticallyImplyLeading: false, title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false)
// title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false) ? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {
// ? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { showMDialog(context, child: BusinessCardDialog());
// showMDialog(context, child: BusinessCardDialog()); })
// }) : Container(),
// : Container(), actions: [
// actions: [ Center(
// Center( child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {
// child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { showMDialog(context, child: EmployeeDigitialIdDialog());
// showMDialog(context, child: EmployeeDigitialIdDialog()); })),
// })), 21.width
// 21.width ],
// ], ),
// ),
body: Column( body: Column(
children: [ children: [
ListView( ListView(
padding: const EdgeInsets.all(21), padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
children: [ children: [
12.height, //12.height,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.asset("assets/images/drawer/moe_logo.png", width: 60, height: 60),
Row(
children: [
LocaleKeys.english.tr().toText14(color: AppState().isArabic(context) ? null : 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(color: !AppState().isArabic(context) ? null : MyColors.textMixColor).onPress(() {
context.setLocale(const Locale("ar", "SA"));
}),
],
)
],
),
12.height,
if (true) if (true)
Column( Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -164,7 +141,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
children: [ children: [
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3), if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3),
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4), if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4),
if (env.login.verificationMethod.whatsapp) getButton(2), getButton(2),
getButton(1), getButton(1),
], ],
) )
@ -312,7 +289,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
width: 38, width: 38,
color: isDisable ? MyColors.darkTextColor.withOpacity(0.7) : null, color: isDisable ? MyColors.darkTextColor.withOpacity(0.7) : null,
), ),
_title.toText16(height: 20 / 16, maxlines: 2), _title.toText16(height: 20/16)
], ],
), ),
), ),
@ -347,22 +324,20 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
Future<void> performApiCall(String _title, String _icon, int _flag, int sendVerificationFlat, {bool isDirectLogin = false}) async { Future<void> performApiCall(String _title, String _icon, int _flag, int sendVerificationFlat, {bool isDirectLogin = false}) async {
try { try {
if (isDirectLogin) { if (isDirectLogin)
setState(() { setState(() {
Utils.showLoading(context); Utils.showLoading(context);
}); });
} else { else
Utils.showLoading(context); Utils.showLoading(context);
}
await LoginApiClient().checkMobileAppVersion(); await LoginApiClient().checkMobileAppVersion();
await LoginApiClient().memberLogin(AppState().getUserName!, AppState().password!); await LoginApiClient().memberLogin(AppState().getUserName!, AppState().password!);
if (!isDirectLogin) { if (!isDirectLogin)
BasicMemberInformationModel? memberInformationModel = BasicMemberInformationModel? memberInformationModel =
await LoginApiClient().mohemmSendActivationCodeByOTPNotificationType(0, AppState().memberLoginList?.pMOBILENUMBER, sendVerificationFlat, AppState().getUserName); await LoginApiClient().mohemmSendActivationCodeByOTPNotificationType(0, AppState().memberLoginList?.pMOBILENUMBER, sendVerificationFlat, AppState().getUserName);
}
if (isDirectLogin) performDirectApiCall(_title, _icon, _flag, "", null); if (isDirectLogin) performDirectApiCall(_title, _icon, _flag, "", null);
if (!isDirectLogin) Utils.hideLoading(context); if (!isDirectLogin) Utils.hideLoading(context);
if (!isDirectLogin) { if (!isDirectLogin)
OtpDialog( OtpDialog(
context, context,
sendVerificationFlat, sendVerificationFlat,
@ -378,7 +353,6 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
performApiCall(_title, _icon, _flag, sendVerificationFlat, isDirectLogin: isDirectLogin); performApiCall(_title, _icon, _flag, sendVerificationFlat, isDirectLogin: isDirectLogin);
}, },
).displayDialog(context); ).displayDialog(context);
}
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
@ -387,7 +361,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
Future<void> performDirectApiCall(String _title, String _icon, int _flag, String value, TextEditingController? _pinPutController, {bool isDirectLogin = false}) async { Future<void> performDirectApiCall(String _title, String _icon, int _flag, String value, TextEditingController? _pinPutController, {bool isDirectLogin = false}) async {
try { try {
GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(true, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName); GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(false, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName);
GenericResponseModel? genericResponseModel1 = await LoginApiClient().insertMobileLoginInfoNEW( GenericResponseModel? genericResponseModel1 = await LoginApiClient().insertMobileLoginInfoNEW(
AppState().memberLoginList?.pEMAILADDRESS ?? "", AppState().memberLoginList?.pEMAILADDRESS ?? "",
genericResponseModel?.pSESSIONID ?? 0, genericResponseModel?.pSESSIONID ?? 0,
@ -395,10 +369,9 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
_flag, _flag,
AppState().memberLoginList?.pMOBILENUMBER ?? "", AppState().memberLoginList?.pMOBILENUMBER ?? "",
AppState().getUserName!, AppState().getUserName!,
AppState().getIsHuawei ? AppState().getHuaweiPushToken : mobileLoginInfoListModel!.deviceToken!, mobileLoginInfoListModel!.deviceToken!,
Platform.isAndroid ? "android" : "ios"); Platform.isAndroid ? "android" : "ios");
AppState().setMemberInformationListModel = genericResponseModel!.memberInformationList?.first; AppState().setMemberInformationListModel = genericResponseModel!.memberInformationList?.first;
AppState().setPrivilegeListModel = genericResponseModel!.privilegeList ?? [];
if (genericResponseModel.errorMessage != null) { if (genericResponseModel.errorMessage != null) {
Utils.showToast(genericResponseModel.errorMessage ?? ""); Utils.showToast(genericResponseModel.errorMessage ?? "");
// Navigator.pop(context); // Navigator.pop(context);

@ -11,9 +11,9 @@ import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/consts.dart'; import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/env.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/dialogs/otp_dialog.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/string_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.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/basic_member_information_model.dart';
@ -78,7 +78,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
children: [ children: [
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3), if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3),
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4), if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4),
if (env.login.verificationMethod.whatsapp) getButton(2), getButton(2),
getButton(1), getButton(1),
], ],
) )
@ -572,7 +572,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
width: 38, width: 38,
color: isDisable ? MyColors.darkTextColor.withOpacity(0.7) : null, color: isDisable ? MyColors.darkTextColor.withOpacity(0.7) : null,
), ),
_title.toText16(height: 20 / 16, maxlines: 2) _title.toText16(height: 20/16)
], ],
), ),
), ),
@ -619,7 +619,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
int.tryParse(AppState().memberLoginList?.pMOBILENUMBER ?? ""), int.tryParse(AppState().memberLoginList?.pMOBILENUMBER ?? ""),
(value, TextEditingController _pinPutController) async { (value, TextEditingController _pinPutController) async {
Utils.showLoading(context); Utils.showLoading(context);
try { try {
GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(true, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName); GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(true, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName);
GenericResponseModel? genericResponseModel1 = await LoginApiClient().insertMobileLoginInfoNEW( GenericResponseModel? genericResponseModel1 = await LoginApiClient().insertMobileLoginInfoNEW(
AppState().memberLoginList?.pEMAILADDRESS ?? "", AppState().memberLoginList?.pEMAILADDRESS ?? "",
@ -628,7 +628,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
_flag, _flag,
AppState().memberLoginList?.pMOBILENUMBER ?? "", AppState().memberLoginList?.pMOBILENUMBER ?? "",
AppState().getUserName!, AppState().getUserName!,
AppState().getIsHuawei ? AppState().getHuaweiPushToken : firebaseToken!, firebaseToken!,
Platform.isAndroid ? "android" : "ios"); Platform.isAndroid ? "android" : "ios");
if (genericResponseModel?.errorMessage != null) { if (genericResponseModel?.errorMessage != null) {
Utils.showToast(genericResponseModel?.errorMessage ?? ""); Utils.showToast(genericResponseModel?.errorMessage ?? "");
@ -637,13 +637,13 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
AppState().setMemberInformationListModel = genericResponseModel.memberInformationList?.first; AppState().setMemberInformationListModel = genericResponseModel.memberInformationList?.first;
MemberInformationListModel.saveToPrefs(genericResponseModel.memberInformationList ?? []); MemberInformationListModel.saveToPrefs(genericResponseModel.memberInformationList ?? []);
PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []); PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []);
// AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID; AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID;
// AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword; AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
// AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword; AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
Utils.saveStringFromPrefs(SharedPrefsConsts.username, AppState().getUserName!); Utils.saveStringFromPrefs(SharedPrefsConsts.username, AppState().getUserName!);
Utils.saveStringFromPrefs(SharedPrefsConsts.password, AppState().password!); Utils.saveStringFromPrefs(SharedPrefsConsts.password, AppState().password!);
// Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID, genericResponseModel.mohemmWifiSSID ?? ""); Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID, genericResponseModel.mohemmWifiSSID!);
// Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiPassword, genericResponseModel.mohemmWifiPassword!); Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiPassword, genericResponseModel.mohemmWifiPassword!);
} }
Utils.hideLoading(context); Utils.hideLoading(context);
Navigator.pop(context); Navigator.pop(context);

@ -1,5 +1,4 @@
import 'dart:async'; import 'dart:async';
import 'dart:developer';
import 'package:appinio_swiper/appinio_swiper.dart'; import 'package:appinio_swiper/appinio_swiper.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -135,7 +134,6 @@ class MarathonProvider extends ChangeNotifier {
late VideoPlayerController videoController; late VideoPlayerController videoController;
Future<void> initializeVideoPlayer() async { Future<void> initializeVideoPlayer() async {
log("VIDEO PLAYER INITIALIZED!!!");
videoController = VideoPlayerController.network(ApiConsts.marathonBaseUrlServices + marathonDetailModel.sponsors!.first.video!); videoController = VideoPlayerController.network(ApiConsts.marathonBaseUrlServices + marathonDetailModel.sponsors!.first.video!);
await videoController.initialize(); await videoController.initialize();
await videoController.play(); await videoController.play();
@ -192,7 +190,6 @@ class MarathonProvider extends ChangeNotifier {
oneSec, oneSec,
(Timer timer) async { (Timer timer) async {
if (totalSecondsToWaitForMarathon == 0) { if (totalSecondsToWaitForMarathon == 0) {
timer.cancel();
if (isUserWaiting) { if (isUserWaiting) {
MarathonApiClient().joinMarathonAsParticipant().whenComplete(() async { MarathonApiClient().joinMarathonAsParticipant().whenComplete(() async {
await callNextQuestionApi(); await callNextQuestionApi();
@ -200,6 +197,7 @@ class MarathonProvider extends ChangeNotifier {
} else { } else {
isButtonEnabled = false; isButtonEnabled = false;
} }
timer.cancel();
return; return;
} else { } else {
totalSecondsToWaitForMarathon--; totalSecondsToWaitForMarathon--;
@ -212,24 +210,20 @@ class MarathonProvider extends ChangeNotifier {
int totalCurrentQuestionTime = 0; int totalCurrentQuestionTime = 0;
int currentGapTime = 0; int currentGapTime = 0;
Timer timerForQuestion = Timer.periodic(const Duration(seconds: 1), (Timer timer) {}); Timer timerForQuestion = Timer.periodic(const Duration(seconds: 1), (Timer timer) {});
int callCountThreshold = 0;
void startTimerForQuestion() { void startTimerForQuestion() {
const Duration oneSec = Duration(seconds: 1); const Duration oneSec = Duration(seconds: 1);
timerForQuestion = Timer.periodic( timerForQuestion = Timer.periodic(
oneSec, oneSec,
(Timer timer) async { (Timer timer) async {
// This 1 is just to show the color of answer tile for 1 and then update card status // This 2 is just to show the color of answer tile for 1 and then update card status
if (totalCurrentQuestionTime - currentGapTime == 1) { if (totalCurrentQuestionTime - currentGapTime == 1) {
if (callCountThreshold == 0) { getCorrectAnswerAndUpdateAnswerColor();
getCorrectAnswerAndUpdateAnswerColor();
}
} }
if (totalCurrentQuestionTime - currentGapTime == -2) { if (totalCurrentQuestionTime - currentGapTime == -2) {
if (callCountThreshold == 0) { updateCardStatusToAnswer();
updateCardStatusToAnswer();
}
// scheduleMicrotask(() async { // scheduleMicrotask(() async {
// if (AppState().getIsDemoMarathon || isUserOutOfGame) { // if (AppState().getIsDemoMarathon || isUserOutOfGame) {
// await callNextQuestionApi(); // await callNextQuestionApi();
@ -249,7 +243,6 @@ class MarathonProvider extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
totalCurrentQuestionTime--; totalCurrentQuestionTime--;
callCountThreshold = 0;
} }
if (totalCurrentQuestionTime == 0) { if (totalCurrentQuestionTime == 0) {
@ -262,7 +255,6 @@ class MarathonProvider extends ChangeNotifier {
} else { } else {
if (totalCurrentQuestionTime - currentGapTime != -2) { if (totalCurrentQuestionTime - currentGapTime != -2) {
totalCurrentQuestionTime--; totalCurrentQuestionTime--;
callCountThreshold = 0;
} }
} }
@ -421,7 +413,6 @@ class MarathonProvider extends ChangeNotifier {
} }
void getCorrectAnswerAndUpdateAnswerColor() { void getCorrectAnswerAndUpdateAnswerColor() {
callCountThreshold = 1;
if (selectedOptionIndex != null) { if (selectedOptionIndex != null) {
scheduleMicrotask(() async { scheduleMicrotask(() async {
if (AppState().getIsDemoMarathon) { if (AppState().getIsDemoMarathon) {
@ -456,7 +447,7 @@ class MarathonProvider extends ChangeNotifier {
if (currentQuestionNumber == 0) { if (currentQuestionNumber == 0) {
return; return;
} }
callCountThreshold = 1;
scheduleMicrotask(() async { scheduleMicrotask(() async {
await callNextQuestionApi(); await callNextQuestionApi();
}); });
@ -487,7 +478,6 @@ class MarathonProvider extends ChangeNotifier {
void resetValues() async { void resetValues() async {
_currentQuestionNumber = 0; _currentQuestionNumber = 0;
iAmWinner = false;
cardContentList.clear(); cardContentList.clear();
itsMarathonTime = false; itsMarathonTime = false;
timerForWinnerSelection.cancel(); timerForWinnerSelection.cancel();

@ -169,36 +169,26 @@ class MarathonScreen extends StatelessWidget {
], ],
) )
: const SizedBox(), : const SizedBox(),
36.height,
if (provider.selectedWinners != null) ...<Widget>[ if (provider.selectedWinners != null) ...<Widget>[
provider.selectedWinners!.length == 1 ListView.separated(
? Column( shrinkWrap: true,
children: <Widget>[ itemCount: provider.selectedWinners!.length,
(AppState().isArabic(context) ? provider.selectedWinners![0].nameEn : provider.selectedWinners![0].nameEn)!.toText24( separatorBuilder: (BuildContext context, int index) {
color: MyColors.grey3AColor, return const Divider();
isCentered: true, },
), itemBuilder: (BuildContext context, int index) {
8.height, return Column(
provider.selectedWinners![0].employeeId!.toText22(color: MyColors.grey57Color), crossAxisAlignment: CrossAxisAlignment.start,
], children: <Widget>[
) (AppState().isArabic(context) ? provider.selectedWinners![index].nameEn : provider.selectedWinners![index].nameEn)!.toText16(
: ListView.separated( color: MyColors.grey3AColor,
shrinkWrap: true, ),
itemCount: provider.selectedWinners!.length, provider.selectedWinners!.first.employeeId!.toText16(color: MyColors.grey57Color),
separatorBuilder: (BuildContext context, int index) { ],
return const Divider(); );
}, },
itemBuilder: (BuildContext context, int index) { ),
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
(AppState().isArabic(context) ? provider.selectedWinners![index].nameEn : provider.selectedWinners![index].nameEn)!.toText16(
color: MyColors.grey3AColor,
),
provider.selectedWinners!.first.employeeId!.toText16(color: MyColors.grey57Color),
],
);
},
),
], ],
60.height, 60.height,
if (provider.marathonDetailModel.sponsors != null && provider.marathonDetailModel.sponsors!.isNotEmpty) ...<Widget>[ if (provider.marathonDetailModel.sponsors != null && provider.marathonDetailModel.sponsors!.isNotEmpty) ...<Widget>[
@ -309,7 +299,7 @@ class MarathonScreen extends StatelessWidget {
else ...<Widget>[ else ...<Widget>[
MarathonProgressContainer(provider: provider).paddingOnly(left: 21, right: 21), MarathonProgressContainer(provider: provider).paddingOnly(left: 21, right: 21),
], ],
if (provider.questionCardStatus == QuestionCardStatus.findingWinner && !provider.isUserOutOfGame) ...<Widget>[ if (provider.questionCardStatus == QuestionCardStatus.findingWinner) ...<Widget>[
getNameContainer(context), getNameContainer(context),
], ],
QuestionCardBuilder( QuestionCardBuilder(
@ -336,7 +326,7 @@ class MarathonScreen extends StatelessWidget {
subTitle: LocaleKeys.youMissedTheQuestion.tr().toText18(color: MyColors.darkTextColor, isCentered: true), subTitle: LocaleKeys.youMissedTheQuestion.tr().toText18(color: MyColors.darkTextColor, isCentered: true),
), ),
onFindingWinner: (BuildContext context) => CustomStatusWidget( onFindingWinner: (BuildContext context) => CustomStatusWidget(
asset: Lottie.asset(MyLottieConsts.winnerLottie, height: 168, reverse: false, repeat: true), asset: Lottie.asset(MyLottieConsts.winnerLottie, height: 168, reverse: false),
title: LocaleKeys.fingersCrossed.tr().toText22(color: MyColors.greenColor), title: LocaleKeys.fingersCrossed.tr().toText22(color: MyColors.greenColor),
subTitle: LocaleKeys.winnerSelectedRandomly.tr().toText18(color: MyColors.darkTextColor, isCentered: true), subTitle: LocaleKeys.winnerSelectedRandomly.tr().toText18(color: MyColors.darkTextColor, isCentered: true),
), ),

@ -123,13 +123,10 @@ class CountdownTimerForDetailScreen extends StatelessWidget {
Widget buildCountdownTimer(CurrentRemainingTime? time) { Widget buildCountdownTimer(CurrentRemainingTime? time) {
if (provider.marathonDetailModel.startTime != null) { if (provider.marathonDetailModel.startTime != null) {
int remainingTimeInMinutes = DateTime.parse(provider.marathonDetailModel.startTime!).difference(DateTime.now()).inMinutes; int remainingTimeInMinutes = DateTime.parse(provider.marathonDetailModel.startTime!).difference(DateTime.now()).inMinutes;
if (remainingTimeInMinutes <= 30 && provider.canPlayDemo == true) { if (remainingTimeInMinutes <= 30) {
// scheduleMicrotask(() { scheduleMicrotask(() {
// print("Timer TRUE!!!: ${time?.min.toString()}");
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
provider.canPlayDemo = false; provider.canPlayDemo = false;
}); });
// });
} }
} }

@ -347,10 +347,7 @@ class MarathonBanner extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
MarathonProvider provider = context.read<MarathonProvider>(); MarathonProvider provider = context.read<MarathonProvider>();
// if(provider.isUserWaiting) {
// provider.isUserWaiting = false;
// provider.getMarathonDetailsFromApi();
// }
return !provider.isPrivilegedWithMarathon return !provider.isPrivilegedWithMarathon
? getUnPrivilegedMarathon(context) ? getUnPrivilegedMarathon(context)
: provider.isUpComingMarathon : provider.isUpComingMarathon
@ -434,7 +431,7 @@ class MarathonBanner extends StatelessWidget {
), ),
Flexible( Flexible(
child: Text( child: Text(
(AppState().isArabic(context) ? provider.marathonDetailModel.titleAr ?? "" : provider.marathonDetailModel.titleEn ?? "").trimString(isTablet ? 25 : 15), (AppState().isArabic(context) ? provider.marathonDetailModel.titleAr ?? "" : provider.marathonDetailModel.titleEn ?? "").trimString(15),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontStyle: FontStyle.italic, fontStyle: FontStyle.italic,
@ -527,8 +524,6 @@ class MarathonBanner extends StatelessWidget {
int remainingTimeInMinutes = DateTime.parse(provider.marathonDetailModel.startTime!).difference(DateTime.now()).inMinutes; int remainingTimeInMinutes = DateTime.parse(provider.marathonDetailModel.startTime!).difference(DateTime.now()).inMinutes;
if (remainingTimeInMinutes > 5 && provider.marathonDetailModel.sponsors != null && provider.marathonDetailModel.sponsors!.isNotEmpty) { if (remainingTimeInMinutes > 5 && provider.marathonDetailModel.sponsors != null && provider.marathonDetailModel.sponsors!.isNotEmpty) {
log("IF CALLED!!!");
log("Remaining Time: $remainingTimeInMinutes");
Utils.showLoading(context); Utils.showLoading(context);
try { try {
await provider.initializeVideoPlayer().then((_) { await provider.initializeVideoPlayer().then((_) {
@ -537,19 +532,14 @@ class MarathonBanner extends StatelessWidget {
Navigator.pushNamed(context, AppRoutes.marathonSponsorVideoScreen); Navigator.pushNamed(context, AppRoutes.marathonSponsorVideoScreen);
}); });
} catch (e) { } catch (e) {
// if (kDebugMode) { if (kDebugMode) {
log("Error in VideoPlayer: ${e.toString()}"); log("Error in VideoPlayer: ${e.toString()}");
// } }
Utils.hideLoading(context); Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.marathonIntroScreen).then((value) { Navigator.pushNamed(context, AppRoutes.marathonIntroScreen);
print("Back to home!!!");
});
} }
} else { } else {
log("ELSE CALLED!!!"); Navigator.pushNamed(context, AppRoutes.marathonIntroScreen);
Navigator.pushNamed(context, AppRoutes.marathonIntroScreen).then((value) {
print("Back to home!!!");
});
} }
}), }),
) )

@ -66,11 +66,7 @@ class MarathonProgressContainer extends StatelessWidget {
stepper( stepper(
provider.currentQuestionNumber, provider.currentQuestionNumber,
provider.answerStatusesList, provider.answerStatusesList,
(provider.demoMarathonDetailModel.totalQuestions != null || provider.marathonDetailModel.totalQuestions != null) AppState().getIsDemoMarathon ? provider.demoMarathonDetailModel.totalQuestions! : provider.marathonDetailModel.totalQuestions!,
? AppState().getIsDemoMarathon
? provider.demoMarathonDetailModel.totalQuestions!
: provider.marathonDetailModel.totalQuestions!
: 10,
provider.isUserOutOfGame, provider.isUserOutOfGame,
), ),
8.height, 8.height,

@ -67,8 +67,8 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? ""; tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? "";
if (tempVar.isNotEmpty) { if (tempVar.isNotEmpty) {
if (!tempVar.contains("/")) { if (!tempVar.contains("/")) {
DateTime date = DateFormat('yyyy-MM-dd', "en_US").parse(tempVar); DateTime date = DateFormat('yyyy-MM-dd').parse(tempVar);
tempVar = DateFormat('yyyy/MM/dd HH:mm:ss', "en_US").format(date); tempVar = DateFormat('yyyy/MM/dd HH:mm:ss').format(date);
} }
} }
} }
@ -156,58 +156,55 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
Future getDefaultValues(GetEITDFFStructureList structureList, {bool showLoading = true}) async { Future getDefaultValues(GetEITDFFStructureList structureList, {bool showLoading = true}) async {
try { try {
if (showLoading) Utils.showLoading(context); if (showLoading) Utils.showLoading(context);
for (int i = 0; i < (structureList.cHILDSEGMENTSDVSplited?.length ?? 0); i++) { for (int i = 0; i < (structureList.cHILDSEGMENTSDVSplited?.length ?? 0); i++) {
String segmentId = structureList.cHILDSEGMENTSDVSplited![i]; String segmentId = structureList.cHILDSEGMENTSDVSplited![i];
GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId); GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId);
List<PARENTSEGMENTSDVSplited> parentDvRequired = parent.pARENTSEGMENTSDVSplited ?? []; List<PARENTSEGMENTSDVSplited> parentDvRequired = parent.pARENTSEGMENTSDVSplited ?? [];
List<PARENTSEGMENTSVSSplitedVS> parentVsRequired = parent.pARENTSEGMENTSVSSplitedVS ?? []; List<PARENTSEGMENTSVSSplitedVS> parentVsRequired = parent.pARENTSEGMENTSVSSplitedVS ?? [];
List<GetEITDFFStructureList> filteredList =
getEitDffStructureList!.where((outerElement) => parentDvRequired.any((element) => outerElement.sEGMENTNAME == element.name && element.isRequired == "REQUIRED")).toList();
List<Map<String, dynamic>> values = filteredList.map((e) {
if (e.fORMATTYPE == "X" && e.isDefaultTypeIsCDPS && e.eSERVICESDV!.pIDCOLUMNNAME!=null) {
e.eSERVICESDV!.pVALUECOLUMNNAME = Utils.reverseFormatDate(e.eSERVICESDV!.pIDCOLUMNNAME ?? "");
e.eSERVICESDV!.pIDCOLUMNNAME = Utils.reverseFormatDate(e.eSERVICESDV!.pIDCOLUMNNAME ?? "");
}
return GetSetValuesRequestModel(
sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME)
.toJson();
}).toList();
List<Map<String, dynamic>> getSetList = getDefaultValuesIonicLogic(parent); List<GetEITDFFStructureList> filteredList =
if (getSetList.isNotEmpty) { getEitDffStructureList!.where((outerElement) => parentDvRequired.any((element) => outerElement.sEGMENTNAME == element.name && element.isRequired == "REQUIRED")).toList();
ESERVICESDV defaultValue =
await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, getSetList, empID: dynamicParams!.selectedEmp); List<Map<String, dynamic>> values = filteredList
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId); .map((e) => GetSetValuesRequestModel(
getEitDffStructureList![index].eSERVICESDV = defaultValue; sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME)
GetEITDFFStructureList defaultValueCheck = getEitDffStructureList!.where((GetEITDFFStructureList element) => element.sEGMENTNAME == segmentId).toList().first; .toJson())
.toList();
if (defaultValueCheck.cHILDSEGMENTSDVSplited!.isNotEmpty && defaultValueCheck.rEADONLY == 'Y') {
await getDefaultValues(defaultValueCheck, showLoading: false); List<Map<String, dynamic>> getSetList = getDefaultValuesIonicLogic(parent);
if (getSetList.isNotEmpty) {
// GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId); ESERVICESDV defaultValue =
// List<Map<String, dynamic>> getSetList = getDefaultValuesIonicLogic(parent); await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, getSetList, empID: dynamicParams!.selectedEmp);
// ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, defaultValueCheck.dESCFLEXCONTEXTCODE!, defaultValueCheck.dESCFLEXNAME!, getSetList); int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
// int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId); getEitDffStructureList![index].eSERVICESDV = defaultValue;
// getEitDffStructureList![index].eSERVICESDV = defaultValue; GetEITDFFStructureList defaultValueCheck = getEitDffStructureList!.where((GetEITDFFStructureList element) => element.sEGMENTNAME == segmentId).toList().first;
} else if (defaultValueCheck.cHILDSEGMENTSVSSplited!.isNotEmpty && defaultValueCheck.rEADONLY == 'Y') {
await calGetValueSetValues(defaultValueCheck, showLoading: false); if (defaultValueCheck.cHILDSEGMENTSDVSplited!.isNotEmpty && defaultValueCheck.rEADONLY == 'Y') {
// Utils.hideLoading(context); await getDefaultValues(defaultValueCheck, showLoading: false);
// GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId);
// List<Map<String, dynamic>> getSetList = getDefaultValuesIonicLogic(parent);
// ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, defaultValueCheck.dESCFLEXCONTEXTCODE!, defaultValueCheck.dESCFLEXNAME!, getSetList);
// int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
// getEitDffStructureList![index].eSERVICESDV = defaultValue;
} else if (defaultValueCheck.cHILDSEGMENTSVSSplited!.isNotEmpty && defaultValueCheck.rEADONLY == 'Y') {
await calGetValueSetValues(defaultValueCheck, showLoading: false);
// Utils.hideLoading(context);
}
} else if (values.isNotEmpty) {
ESERVICESDV defaultValue =
await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values, empID: dynamicParams!.selectedEmp);
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
getEitDffStructureList![index].eSERVICESDV = defaultValue;
} }
} else if (values.isNotEmpty) {
ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values, empID: dynamicParams!.selectedEmp);
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
getEitDffStructureList![index].eSERVICESDV = defaultValue;
} }
} if (showLoading) {
if (showLoading) { await Future.delayed(const Duration(seconds: 1));
await Future.delayed(const Duration(seconds: 1)); Utils.hideLoading(context);
Utils.hideLoading(context); }
}
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {
if (showLoading) Utils.hideLoading(context); if (showLoading) Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
@ -225,79 +222,79 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
// } // }
List<Map<String, dynamic>> getDefaultValuesIonicLogic(GetEITDFFStructureList structureElement) { List<Map<String, dynamic>> getDefaultValuesIonicLogic(GetEITDFFStructureList structureElement) {
// try { try {
List<PARENTSEGMENTSVSSplitedVS> parentValue = structureElement.pARENTSEGMENTSVSSplitedVS ?? []; List<PARENTSEGMENTSVSSplitedVS> parentValue = structureElement.pARENTSEGMENTSVSSplitedVS ?? [];
List<PARENTSEGMENTSDVSplited> parentsList = structureElement.pARENTSEGMENTSDVSplited ?? []; List<PARENTSEGMENTSDVSplited> parentsList = structureElement.pARENTSEGMENTSDVSplited ?? [];
List<Map<String, dynamic>> dependenciesList = []; List<Map<String, dynamic>> dependenciesList = [];
String? parentVal; String? parentVal;
bool isStandardDate = false; bool isStandardDate = false;
bool isStandardTimeDate = false; bool isStandardTimeDate = false;
bool isStandardTime = false; bool isStandardTime = false;
bool isHidden = false; bool isHidden = false;
bool isReadOnlyList = false; bool isReadOnlyList = false;
bool isSelectElement = false; bool isSelectElement = false;
// isStandardDate = this.isStandardDate(obj); // isStandardDate = this.isStandardDate(obj);
// isStandardTimeDate = this.isStandardDateTime(obj); // isStandardTimeDate = this.isStandardDateTime(obj);
// isStandardTime = this.isStandardTime(obj); // isStandardTime = this.isStandardTime(obj);
if (structureElement.dISPLAYFLAG == "N") isHidden = true; if (structureElement.dISPLAYFLAG == "N") isHidden = true;
if (structureElement.vALIDATIONTYPE != "N" && structureElement.rEADONLY == "Y") { if (structureElement.vALIDATIONTYPE != "N" && structureElement.rEADONLY == "Y") {
isReadOnlyList = true; isReadOnlyList = true;
} }
if (structureElement.vALIDATIONTYPE != "N" && structureElement.rEADONLY == "N") { if (structureElement.vALIDATIONTYPE != "N" && structureElement.rEADONLY == "N") {
isSelectElement = true; isSelectElement = true;
} }
if (parentValue.isNotEmpty && (structureElement.vALIDATIONTYPE == "D" || structureElement.vALIDATIONTYPE == "Y")) { if (parentValue.isNotEmpty && (structureElement.vALIDATIONTYPE == "D" || structureElement.vALIDATIONTYPE == "Y")) {
List parValue = getDependenciesParams(parentValue); List parValue = getDependenciesParams(parentValue);
if (parValue.isNotEmpty) { if (parValue.isNotEmpty) {
parentVal = parValue.first.ID_COLUMN_NAME; parentVal = parValue.first.ID_COLUMN_NAME;
} }
if (parentVal == null) { if (parentVal == null) {
return []; return [];
}
} }
} if (parentsList.isNotEmpty) {
if (parentsList.isNotEmpty) { if (parentValue.isNotEmpty) {
if (parentValue.isNotEmpty) { parentsList = parentsList + parentValue.map((e) => PARENTSEGMENTSDVSplited.fromJson(e.toJson())).toList();
parentsList = parentsList + parentValue.map((e) => PARENTSEGMENTSDVSplited.fromJson(e.toJson())).toList(); // parentsList.addAll(parentValue.map((e) => PARENTSEGMENTSDVSplited.fromJson(e.toJson())));
// parentsList.addAll(parentValue.map((e) => PARENTSEGMENTSDVSplited.fromJson(e.toJson()))); // parentsList.concat(parentValue);
// parentsList.concat(parentValue); }
dependenciesList = getDependenciesParams(parentsList);
} }
dependenciesList = getDependenciesParams(parentsList); return dependenciesList;
// for (int i = 0; i < (structureList.cHILDSEGMENTSDVSplited?.length ?? 0); i++) {
// String segmentId = structureList.cHILDSEGMENTSDVSplited![i];
// print("segmentId:$segmentId");
// print("segmentName:${structureList.sEGMENTNAME}");
// GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId);
// List<PARENTSEGMENTSDVSplited> parentDvRequired = parent.pARENTSEGMENTSDVSplited ?? [];
// List<PARENTSEGMENTSVSSplitedVS> parentVsRequired = parent.pARENTSEGMENTSVSSplitedVS ?? [];
//
// List<GetEITDFFStructureList> filteredList =
// getEitDffStructureList!.where((outerElement) => parentDvRequired.any((element) => outerElement.sEGMENTNAME == element.name && element.isRequired == "REQUIRED")).toList();
//
// List<Map<String, dynamic>> values = filteredList
// .map((e) => GetSetValuesRequestModel(
// sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME)
// .toJson())
// .toList();
// print("values:$values");
//
// ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
// int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
// getEitDffStructureList![index].eSERVICESDV = defaultValue;
// }
// Utils.hideLoading(context);
// setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
return [];
} }
return dependenciesList;
// for (int i = 0; i < (structureList.cHILDSEGMENTSDVSplited?.length ?? 0); i++) {
// String segmentId = structureList.cHILDSEGMENTSDVSplited![i];
// print("segmentId:$segmentId");
// print("segmentName:${structureList.sEGMENTNAME}");
// GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId);
// List<PARENTSEGMENTSDVSplited> parentDvRequired = parent.pARENTSEGMENTSDVSplited ?? [];
// List<PARENTSEGMENTSVSSplitedVS> parentVsRequired = parent.pARENTSEGMENTSVSSplitedVS ?? [];
//
// List<GetEITDFFStructureList> filteredList =
// getEitDffStructureList!.where((outerElement) => parentDvRequired.any((element) => outerElement.sEGMENTNAME == element.name && element.isRequired == "REQUIRED")).toList();
//
// List<Map<String, dynamic>> values = filteredList
// .map((e) => GetSetValuesRequestModel(
// sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME)
// .toJson())
// .toList();
// print("values:$values");
//
// ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
// int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
// getEitDffStructureList![index].eSERVICESDV = defaultValue;
// }
// Utils.hideLoading(context);
// setState(() {});
// } catch (ex) {
// Utils.hideLoading(context);
// Utils.handleException(ex, context, null);
// return [];
// }
} }
List<Map<String, dynamic>> getDependenciesParams(parentsList) { List<Map<String, dynamic>> getDependenciesParams(parentsList) {
@ -343,10 +340,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
idColName = val; idColName = val;
if (getEitDffStructureList![j].fORMATTYPE == "X") { if (getEitDffStructureList![j].fORMATTYPE == "X") {
if(!getEitDffStructureList![j].isDefaultTypeIsCDPS) { idColName = Utils.formatDateDefault(idColName!);
idColName = Utils.formatDateDefault(idColName!);
}
// commenting to test // commenting to test
// DateTime date = DateFormat('yyyy-MM-dd').parse(idColName!); // DateTime date = DateFormat('yyyy-MM-dd').parse(idColName!);
// idColName = DateFormat('yyyy-MM-dd HH:mm:ss').format(date); // idColName = DateFormat('yyyy-MM-dd HH:mm:ss').format(date);
@ -486,7 +480,6 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "", model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y", isReadOnly: model.rEADONLY == "Y",
toolTip: model.rEQCOLTIP,
onChange: (text) { onChange: (text) {
model.fieldAnswer = text; model.fieldAnswer = text;
model.eSERVICESDV ??= ESERVICESDV(); model.eSERVICESDV ??= ESERVICESDV();
@ -499,8 +492,6 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
model.eSERVICESDV?.pIDCOLUMNNAME ?? "", model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y", isReadOnly: model.rEADONLY == "Y",
isInputTypeNum: true, isInputTypeNum: true,
length: model.mAXIMUMSIZE,
toolTip: model.rEQCOLTIP,
onChange: (text) { onChange: (text) {
model.fieldAnswer = text; model.fieldAnswer = text;
model.eSERVICESDV ??= ESERVICESDV(); model.eSERVICESDV ??= ESERVICESDV();
@ -515,7 +506,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
displayText = displayText.replaceAll(" 00:00:00", ""); displayText = displayText.replaceAll(" 00:00:00", "");
} }
if (displayText.contains("/")) { if (displayText.contains("/")) {
displayText = DateFormat('yyyy-MM-dd', "en_US").format(DateFormat("yyyy/MM/dd", "en_US").parse(displayText)); displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
} }
} }
return DynamicTextFieldWidget( return DynamicTextFieldWidget(
@ -523,15 +514,10 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
displayText, displayText,
suffixIconData: Icons.calendar_today, suffixIconData: Icons.calendar_today,
isEnable: false, isEnable: false,
isReadOnly: model.rEADONLY == "Y",
toolTip: model.rEQCOLTIP,
onTap: () async { onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) { if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
// Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) selectedDate = DateFormat("yyyy/MM/dd").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
// selectedDate = DateFormat("yyyy/MM/dd", "en_US").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else { } else {
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!); selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
} }
@ -581,8 +567,6 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
displayText, displayText,
suffixIconData: Icons.calendar_today, suffixIconData: Icons.calendar_today,
toolTip: model.rEQCOLTIP,
isReadOnly: model.rEADONLY == "Y",
isEnable: false, isEnable: false,
onTap: () async { onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
@ -592,9 +576,9 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
tempDate = tempDate.replaceAll("00:00:00", '').trim(); tempDate = tempDate.replaceAll("00:00:00", '').trim();
} }
if (tempDate.contains("/")) { if (tempDate.contains("/")) {
selectedDate = DateFormat("yyyy/MM/dd", "en_US").parse(tempDate); selectedDate = DateFormat("yyyy/MM/dd").parse(tempDate);
} else { } else {
selectedDate = DateFormat("yyyy-MM-dd", "en_US").parse(tempDate); selectedDate = DateFormat("yyyy-MM-dd").parse(tempDate);
} }
} else { } else {
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!); selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
@ -636,7 +620,6 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
child: DynamicTextFieldWidget( child: DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pVALUECOLUMNNAME ?? "", model.eSERVICESDV?.pVALUECOLUMNNAME ?? "",
toolTip: model.rEQCOLTIP,
isEnable: false, isEnable: false,
isPopup: true, isPopup: true,
isInputTypeNum: true, isInputTypeNum: true,
@ -681,7 +664,6 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
model.eSERVICESDV?.pVALUECOLUMNNAME ?? "", model.eSERVICESDV?.pVALUECOLUMNNAME ?? "",
isEnable: false, isEnable: false,
isPopup: true, isPopup: true,
toolTip: model.rEQCOLTIP,
isInputTypeNum: true, isInputTypeNum: true,
isReadOnly: model.rEADONLY == "Y", isReadOnly: model.rEADONLY == "Y",
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),
@ -707,8 +689,6 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "", model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y", isReadOnly: model.rEADONLY == "Y",
length: model.mAXIMUMSIZE,
toolTip: model.rEQCOLTIP,
onChange: (text) { onChange: (text) {
model.fieldAnswer = text; model.fieldAnswer = text;
}, },
@ -720,7 +700,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
displayText = displayText.replaceAll(" 00:00:00", ""); displayText = displayText.replaceAll(" 00:00:00", "");
} }
if (!displayText.contains("-")) { if (!displayText.contains("-")) {
displayText = DateFormat('yyyy-MM-dd', "en_US").format(DateFormat("yyyy/MM/dd", "en_US").parse(displayText)); displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
} }
} }
return DynamicTextFieldWidget( return DynamicTextFieldWidget(
@ -728,8 +708,6 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
displayText, displayText,
suffixIconData: Icons.calendar_today, suffixIconData: Icons.calendar_today,
isEnable: false, isEnable: false,
isReadOnly: model.rEADONLY == "Y",
toolTip: model.rEQCOLTIP,
onTap: () async { onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) { if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
@ -741,7 +719,6 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
DateTime date = await _selectDate(context); DateTime date = await _selectDate(context);
String dateString = date.toString().split(' ').first; String dateString = date.toString().split(' ').first;
getEitDffStructureList![index].fieldAnswer = date.toString(); getEitDffStructureList![index].fieldAnswer = date.toString();
ESERVICESDV eservicesdv = ESERVICESDV( ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: dateString, pIDCOLUMNNAME: dateString,
pRETURNMSG: "null", pRETURNMSG: "null",
@ -763,8 +740,6 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? ""), model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? ""),
suffixIconData: Icons.access_time_filled_rounded, suffixIconData: Icons.access_time_filled_rounded,
isEnable: false, isEnable: false,
isReadOnly: model.rEADONLY == "Y",
toolTip: model.rEQCOLTIP,
onTap: () async { onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
var timeString = getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.split(":"); var timeString = getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.split(":");

@ -159,7 +159,7 @@ class _ViewAttendanceState extends State<ViewAttendance> {
children: [ children: [
Row( Row(
children: [ children: [
"${DateFormat("MMMM-yyyy", "en_US").format(formattedDate)}".toText16(color: MyColors.grey3AColor), "${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.grey3AColor),
const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.grey3AColor), const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.grey3AColor),
], ],
).onPress( ).onPress(
@ -439,7 +439,7 @@ class _ViewAttendanceState extends State<ViewAttendance> {
expand: false, expand: false,
builder: (_, controller) { builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss", "en_US").parse(dmyString); DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString);
return Column( return Column(
children: [ children: [
Container( Container(
@ -468,7 +468,7 @@ class _ViewAttendanceState extends State<ViewAttendance> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"${DateFormat("MMMM-dd-yyyy", "en_US").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white), "${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white),
LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor), LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor),
12.height, 12.height,
CircularStepProgressBar( CircularStepProgressBar(

@ -105,7 +105,7 @@ class _MonthlyPaySlipScreenState extends State<MonthlyPaySlipScreen> {
Container(alignment: Alignment.centerLeft, child: LocaleKeys.month.tr().toText17(isBold: true, color: MyColors.darkIconColor)), Container(alignment: Alignment.centerLeft, child: LocaleKeys.month.tr().toText17(isBold: true, color: MyColors.darkIconColor)),
Row( Row(
children: [ children: [
DateFormat("MMMM-yyyy", "en_US").format(DateFormat("MM/dd/yyyy", "en_US").parse(paySlipList[selectedMonthIndex!].pAYMENTDATE!)).toText16(color: MyColors.greyACColor), DateFormat("MMMM-yyyy").format(DateFormat("MM/dd/yyyy").parse(paySlipList[selectedMonthIndex!].pAYMENTDATE!)).toText16(color: MyColors.greyACColor),
const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.greyACColor), const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.greyACColor),
], ],
).onPress(() async { ).onPress(() async {

@ -238,7 +238,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
isEnable: false, isEnable: false,
onTap: () async { onTap: () async {
DateTime dateValue = await _selectDate(context); DateTime dateValue = await _selectDate(context);
date = (DateFormat('yyyy-MM-dd', "en_US").format(dateValue)); date = (DateFormat('yyyy-MM-dd').format(dateValue));
model!.getContactDetailsList!.sEGMENTVALUEDSP = date; model!.getContactDetailsList!.sEGMENTVALUEDSP = date;
setState(() {}); setState(() {});
}, },
@ -286,7 +286,6 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.getContactDetailsList!.sEGMENTVALUEDSP ?? "", model.getContactDetailsList!.sEGMENTVALUEDSP ?? "",
isInputTypeNum: true, isInputTypeNum: true,
length: model.mAXIMUMSIZE,
onChange: (String text) { onChange: (String text) {
model.getContactDetailsList!.sEGMENTVALUEDSP = text; model.getContactDetailsList!.sEGMENTVALUEDSP = text;
}, },
@ -299,7 +298,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
isEnable: false, isEnable: false,
onTap: () async { onTap: () async {
DateTime dateValue = await _selectDate(context); DateTime dateValue = await _selectDate(context);
date = (DateFormat('yyyy-MM-dd', "en_US").format(dateValue)); date = (DateFormat('yyyy-MM-dd').format(dateValue));
model!.getContactDetailsList!.sEGMENTVALUEDSP = date; model!.getContactDetailsList!.sEGMENTVALUEDSP = date;
setState(() {}); setState(() {});
}, },
@ -346,7 +345,6 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.getContactDetailsList!.sEGMENTVALUEDSP ?? "", model.getContactDetailsList!.sEGMENTVALUEDSP ?? "",
isInputTypeNum: true, isInputTypeNum: true,
length: model.mAXIMUMSIZE,
onChange: (String text) { onChange: (String text) {
model.getContactDetailsList!.sEGMENTVALUEDSP = text; model.getContactDetailsList!.sEGMENTVALUEDSP = text;
}, },
@ -359,7 +357,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
isEnable: false, isEnable: false,
onTap: () async { onTap: () async {
DateTime dateValue = await _selectDate(context); DateTime dateValue = await _selectDate(context);
date = (DateFormat('yyyy-MM-dd', "en_US").format(dateValue)); date = (DateFormat('yyyy-MM-dd').format(dateValue));
model!.getContactDetailsList!.sEGMENTVALUEDSP = date; model!.getContactDetailsList!.sEGMENTVALUEDSP = date;
setState(() {}); setState(() {});
}, },

@ -12,7 +12,6 @@ import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart'; import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart'; import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:mohem_flutter_app/models/profile/employee_qualifications_list.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_basic_details_screen.dart'; import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_basic_details_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
@ -36,7 +35,6 @@ class _BasicDetailsState extends State<BasicDetails> {
String? employeeNo = ""; String? employeeNo = "";
int correctOrNew = 1; int correctOrNew = 1;
List<GetEmployeeBasicDetailsList>? getEmployeeBasicDetailsList; List<GetEmployeeBasicDetailsList>? getEmployeeBasicDetailsList;
List<EmployeeQualificationsList>? getEmployeeQualificationsList;
late MemberInformationListModel memberInformationList; late MemberInformationListModel memberInformationList;
GetMenuEntriesList menuEntries = GetMenuEntriesList(); GetMenuEntriesList menuEntries = GetMenuEntriesList();
@ -62,7 +60,6 @@ class _BasicDetailsState extends State<BasicDetails> {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
getEmployeeBasicDetailsList = await ProfileApiClient().getEmployeeBasicDetails(); getEmployeeBasicDetailsList = await ProfileApiClient().getEmployeeBasicDetails();
getEmployeeQualificationsList = await ProfileApiClient().getEmployeeQualifications();
Utils.hideLoading(context); Utils.hideLoading(context);
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {
@ -88,58 +85,22 @@ class _BasicDetailsState extends State<BasicDetails> {
? const SizedBox() ? const SizedBox()
: (getEmployeeBasicDetailsList!.isEmpty : (getEmployeeBasicDetailsList!.isEmpty
? Utils.getNoDataWidget(context) ? Utils.getNoDataWidget(context)
: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ : Column(
LocaleKeys.profile_basicDetails.tr().toText20(isBold: true), crossAxisAlignment: CrossAxisAlignment.start,
14.height, children: getEmployeeBasicDetailsList!
...getEmployeeBasicDetailsList! .map((e) => Column(
.map((e) => Column( children: [
children: [ e.dISPLAYFLAG == "Y"
e.dISPLAYFLAG == "Y" ? Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
? Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ "${e.sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor),
"${e.sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), "${e.sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor),
"${e.sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), 12.height
12.height ])
]) : Container(),
: Container(), ],
],
))
.toList()
]).objectContainerView()),
20.height,
getEmployeeQualificationsList == null
? const SizedBox()
: ((getEmployeeQualificationsList!.isEmpty && getEmployeeBasicDetailsList!.isEmpty)
? Utils.getNoDataWidget(context)
: getEmployeeQualificationsList!.isEmpty
? Container()
: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
LocaleKeys.qualification.tr().toText20(isBold: true),
14.height,
...getEmployeeQualificationsList!
.map((e) => SizedBox(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.esteblishmentName.tr().toText13(color: MyColors.lightGrayColor),
"${e.establishment}".toText16(isBold: true, color: MyColors.blackColor),
12.height,
LocaleKeys.grade.tr().toText13(color: MyColors.lightGrayColor),
"${e.grade}".toText16(isBold: true, color: MyColors.blackColor),
12.height,
LocaleKeys.gradeDescription.tr().toText13(color: MyColors.lightGrayColor),
"${e.gradeDescription}".toText16(isBold: true, color: MyColors.blackColor),
12.height,
LocaleKeys.type.tr().toText13(color: MyColors.lightGrayColor),
"${e.qualificationType}".toText16(isBold: true, color: MyColors.blackColor),
12.height,
LocaleKeys.status.tr().toText13(color: MyColors.lightGrayColor),
"${e.status}".toText16(isBold: true, color: MyColors.blackColor),
],
),
)) ))
.toList() .toList())
]).objectContainerView()) .objectContainerView())
], ],
), ),
), ),
@ -170,7 +131,7 @@ class _BasicDetailsState extends State<BasicDetails> {
); );
StatefulBuilder alert = StatefulBuilder(builder: (context, setState) { StatefulBuilder alert = StatefulBuilder(builder: (context, setState) {
return AlertDialog( return AlertDialog(
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))), shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
title: Text(LocaleKeys.confirm.tr()), title: Text(LocaleKeys.confirm.tr()),
content: Builder(builder: (context) { content: Builder(builder: (context) {
// Get available height and width of the build area of this widget. Make a choice depending on the size. // Get available height and width of the build area of this widget. Make a choice depending on the size.
@ -182,7 +143,7 @@ class _BasicDetailsState extends State<BasicDetails> {
LocaleKeys.selectType.tr(), LocaleKeys.selectType.tr(),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
), ),
const Divider(), Divider(),
Column( Column(
children: [ children: [
ListTile( ListTile(

@ -5,7 +5,6 @@ import 'package:mohem_flutter_app/api/profile_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.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/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/env.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.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/string_extensions.dart';
@ -101,7 +100,6 @@ class _ContactDetailsState extends State<ContactDetails> {
), ),
separatorBuilder: (cxt, index) => 12.height, separatorBuilder: (cxt, index) => 12.height,
itemCount: getEmployeePhonesList.length), itemCount: getEmployeePhonesList.length),
if(env.canEdit)
if (menuEntriesPhone.updateButton == 'Y') if (menuEntriesPhone.updateButton == 'Y')
AppState().isArabic(context) AppState().isArabic(context)
? Positioned( ? Positioned(
@ -133,7 +131,6 @@ class _ContactDetailsState extends State<ContactDetails> {
), ),
separatorBuilder: (cxt, index) => 12.height, separatorBuilder: (cxt, index) => 12.height,
itemCount: getEmployeeAddressList.length), itemCount: getEmployeeAddressList.length),
if(env.canEdit)
if (menuEntriesAddress.updateButton == 'Y') if (menuEntriesAddress.updateButton == 'Y')
AppState().isArabic(context) AppState().isArabic(context)
? Positioned( ? Positioned(
@ -151,7 +148,6 @@ class _ContactDetailsState extends State<ContactDetails> {
else else
Stack( Stack(
children: [ children: [
if(env.canEdit)
if (menuEntriesAddress.addButton == 'Y') if (menuEntriesAddress.addButton == 'Y')
AppState().isArabic(context) AppState().isArabic(context)
? Positioned( ? Positioned(

@ -88,8 +88,8 @@ class _DeleteFamilyMemberState extends State<DeleteFamilyMember> {
isEnable: false, isEnable: false,
onTap: () async { onTap: () async {
DateTime dateValue = await _selectDate(context); DateTime dateValue = await _selectDate(context);
date = DateFormat('yyyy/MM/dd', "en_US").format(dateValue); date = DateFormat('yyyy/MM/dd').format(dateValue);
datePar = DateFormat('yyyy/MM/dd hh:mm:ss', "en_US").format(dateValue); datePar = DateFormat('yyyy/MM/dd hh:mm:ss').format(dateValue);
setState(() {}); setState(() {});
}, },
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),

@ -227,7 +227,6 @@ class _DynamicInputScreenState extends State<DynamicInputScreenAddress> {
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.getEmployeeAddressList?.sEGMENTVALUEDSP ?? "", model.getEmployeeAddressList?.sEGMENTVALUEDSP ?? "",
isReadOnly: model.rEADONLY == "Y", isReadOnly: model.rEADONLY == "Y",
length: model.mAXIMUMSIZE,
onChange: (text) { onChange: (text) {
model.getEmployeeAddressList?.sEGMENTVALUEDSP = text; model.getEmployeeAddressList?.sEGMENTVALUEDSP = text;
}, },
@ -243,10 +242,10 @@ class _DynamicInputScreenState extends State<DynamicInputScreenAddress> {
DateTime date1 = DateTime(date.year, date.month, date.day); DateTime date1 = DateTime(date.year, date.month, date.day);
getAddressDffStructureList![index].dESCFLEXCONTEXTNAME = date.toString(); getAddressDffStructureList![index].dESCFLEXCONTEXTNAME = date.toString();
ESERVICESDV eservicesdv = ESERVICESDV( ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd', "en_US").format(date1), pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
pRETURNMSG: "null", pRETURNMSG: "null",
pRETURNSTATUS: getAddressDffStructureList![index].dEFAULTVALUE, pRETURNSTATUS: getAddressDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: DateFormat('yyyy-MM-ddThh:mm:ss.s', "en_US").format(date)); pVALUECOLUMNNAME: DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
getAddressDffStructureList![index].eSERVICESDV = eservicesdv; getAddressDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {}); setState(() {});
if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
@ -271,8 +270,8 @@ class _DynamicInputScreenState extends State<DynamicInputScreenAddress> {
// for date format type, date format is changed // for date format type, date format is changed
tempVar = e.eSERVICESDV?.pVALUECOLUMNNAME ?? ""; tempVar = e.eSERVICESDV?.pVALUECOLUMNNAME ?? "";
if (tempVar.isNotEmpty) { if (tempVar.isNotEmpty) {
DateTime date = DateFormat('yyyy-MM-dd', "en_US").parse(tempVar); DateTime date = DateFormat('yyyy-MM-dd').parse(tempVar);
tempVar = DateFormat('dd-MMM-yyy', "en_US").format(date); tempVar = DateFormat('dd-MMM-yyy').format(date);
if (e.aPPLICATIONCOLUMNNAME == null) { if (e.aPPLICATIONCOLUMNNAME == null) {
effectiveDate = tempVar; effectiveDate = tempVar;
} }
@ -295,7 +294,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenAddress> {
values, values,
dynamicParams!.correctOrNew, dynamicParams!.correctOrNew,
countryCode, countryCode,
effectiveDate.isEmpty ? DateFormat('dd-MMM-yyy', "en_US").format(DateTime.now()) : effectiveDate, effectiveDate.isEmpty ? DateFormat('dd-MMM-yyy').format(DateTime.now()) : effectiveDate,
); );
Utils.hideLoading(context); Utils.hideLoading(context);

@ -233,10 +233,10 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
DateTime date1 = DateTime(date.year, date.month, date.day); DateTime date1 = DateTime(date.year, date.month, date.day);
getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = date.toString(); getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = date.toString();
ESERVICESDV eservicesdv = ESERVICESDV( ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd', "en_US").format(date1), pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
pRETURNMSG: "null", pRETURNMSG: "null",
pRETURNSTATUS: getBasicDetDffStructureList![index].dEFAULTVALUE, pRETURNSTATUS: getBasicDetDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: DateFormat('yyyy-MM-ddThh:mm:ss.s', "en_US").format(date)); pVALUECOLUMNNAME: DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
getBasicDetDffStructureList![index].eSERVICESDV = eservicesdv; getBasicDetDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {}); setState(() {});
if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
@ -371,8 +371,8 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
// for date format type, date format is changed // for date format type, date format is changed
tempVar = e.eSERVICESDV?.pVALUECOLUMNNAME ?? ""; tempVar = e.eSERVICESDV?.pVALUECOLUMNNAME ?? "";
if (tempVar.isNotEmpty) { if (tempVar.isNotEmpty) {
DateTime date = DateFormat('yyyy-MM-dd', "en_US").parse(tempVar); DateTime date = DateFormat('yyyy-MM-dd').parse(tempVar);
tempVar = DateFormat('yyyy/MM/dd HH:mm:ss', "en_US").format(date); tempVar = DateFormat('yyyy/MM/dd HH:mm:ss').format(date);
} }
} }
return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: tempVar.toString()).toJson(); return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: tempVar.toString()).toJson();

@ -1,34 +0,0 @@
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/classes/colors.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/widgets/app_bar_widget.dart';
class HelpScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBarWidget(
context,
title: LocaleKeys.help.tr(),
),
backgroundColor: MyColors.backgroundColor,
body: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
(LocaleKeys.dear.tr() + " " + AppState().memberInformationList!.eMPLOYEENAME!).toText18(isBold: true),
12.height,
LocaleKeys.assistant.tr().toText14(),
],
),
),
);
}
}

@ -1,298 +0,0 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/api/profile_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/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/hierarchy_lists.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:url_launcher/url_launcher.dart';
class HierarchyScreen extends StatefulWidget {
@override
State<HierarchyScreen> createState() => _HierarchyScreenState();
}
class _HierarchyScreenState extends State<HierarchyScreen> {
SupervisorHierarchyLists? hierarchyList;
@override
void initState() {
super.initState();
getData("221142");
}
void getData(String selectedId) async {
Utils.showLoading(context);
try {
hierarchyList = await ProfileApiClient().getHierarchy(selectedId);
hierarchyList!.supervisorHierarchyList!.removeWhere((element) => element.lvl == 1);
hierarchyList!.supervisorHierarchyList = hierarchyList!.supervisorHierarchyList!.reversed.toList();
// hierarchyList!.subordinateHierarchyList!.clear();
setState(() {});
Utils.hideLoading(context);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBarWidget(
context,
title: LocaleKeys.profile_personalInformation.tr(),
),
backgroundColor: MyColors.backgroundColor,
body: hierarchyList == null
? const Center(child: SizedBox())
: SizedBox(
height: double.infinity,
width: double.infinity,
child: SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemBuilder: (BuildContext context, int index) {
return Row(
children: [
SizedBox(
height: 78 + 12,
child: Stack(
children: [
Align(
alignment: (index == 0) ? Alignment.bottomCenter : Alignment.topCenter,
child: SizedBox(
// height: index == 0
// ? 40 + 6
// : (index == hierarchyList!.supervisorHierarchyList!.length - 1)
// ? 40 + 6
// : 78 + 6,
height: index == 0
? 40 + 6
: (index == hierarchyList!.supervisorHierarchyList!.length - 1)
? 40 + 6
: 78 + 6 + 6,
child: Container(
height: double.infinity,
color: Colors.black,
width: 2,
),
),
),
],
),
),
const SizedBox(
width: 16,
child: Divider(
color: Colors.black,
thickness: 2,
),
),
Expanded(
child: Container(
width: double.infinity,
padding: const EdgeInsets.all(12),
margin: const EdgeInsets.only(top: 12),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.all(Radius.circular(12)),
border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
),
child: Row(
children: [
hierarchyList?.supervisorHierarchyList![index].employeeImage == null
? SvgPicture.asset(
"assets/images/user.svg",
height: 52,
width: 52,
)
: CircleAvatar(
radius: 52 / 2,
backgroundImage: MemoryImage(Utils.dataFromBase64String(hierarchyList?.supervisorHierarchyList![index].employeeImage)),
backgroundColor: Colors.black,
),
12.width,
Expanded(
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
hierarchyList!.supervisorHierarchyList![index].employeeName.toString().toText14(isBold: true, maxlines: 1),
hierarchyList!.supervisorHierarchyList![index].positionName.toString().toText12(isBold: false, maxLine: 1),
],
),
),
IconButton(
onPressed: () {
launch("tel://${hierarchyList!.supervisorHierarchyList![index].employeeMobileNumber}");
},
icon: Icon(
Icons.phone,
color: MyColors.gradiantEndColor,
),
),
],
),
),
],
),
),
),
],
);
},
itemCount: hierarchyList?.supervisorHierarchyList?.length ?? 0,
padding: const EdgeInsets.only(left: 12, right: 12, top: 12),
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
),
ListView.builder(
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: (hierarchyList!.subordinateHierarchyList![index].numOfSubordinates == 0)
? null
: () {
getData(hierarchyList!.subordinateHierarchyList![index].employeeNumber.toString());
},
child: Padding(
padding: EdgeInsets.only(
left: AppState().isArabic(context)
? 0
: index == 0
? 28
: 58,
right: !AppState().isArabic(context)
? 0
: index == 0
? 28
: 58),
child: Row(
children: [
SizedBox(
height: 78 + 12,
child: Stack(
children: [
Align(
alignment: (index == 0) ? Alignment.topCenter : Alignment.topCenter,
child: SizedBox(
height: index == 0
? 40 + 6
: (index == hierarchyList!.subordinateHierarchyList!.length - 1)
? 40 + 6
: 78 + 6 + 6,
child: Container(
height: double.infinity,
color: Colors.black,
width: 2,
),
),
),
],
),
),
const SizedBox(
width: 18,
child: Divider(
color: Colors.black,
thickness: 2,
),
),
Expanded(
child: Container(
width: double.infinity,
padding: const EdgeInsets.all(12),
margin: const EdgeInsets.only(top: 12),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.all(Radius.circular(12)),
border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
),
child: Row(
children: [
hierarchyList?.subordinateHierarchyList![index].employeeImage == null
? SvgPicture.asset(
"assets/images/user.svg",
height: 52,
width: 52,
)
: CircleAvatar(
radius: 52 / 2,
backgroundImage: MemoryImage(Utils.dataFromBase64String(hierarchyList?.subordinateHierarchyList![index].employeeImage)),
backgroundColor: Colors.black,
),
12.width,
Expanded(
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
hierarchyList!.subordinateHierarchyList![index].employeeName.toString().toText14(isBold: true, maxlines: 1),
hierarchyList!.subordinateHierarchyList![index].positionName.toString().toText12(isBold: false, maxLine: 1),
],
),
),
8.width,
Column(
children: [
InkWell(
onTap: () {
launch("tel://${hierarchyList!.subordinateHierarchyList![index].employeeMobileNumber}");
},
child: const Padding(
padding: EdgeInsets.only(bottom: 10),
child: Icon(
Icons.phone,
color: MyColors.gradiantEndColor,
),
),
),
if (hierarchyList!.subordinateHierarchyList![index].numOfSubordinates != 0)
Container(
decoration: const BoxDecoration(
color: MyColors.gradiantEndColor,
borderRadius: BorderRadius.all(Radius.circular(12)),
),
width: 18,
height: 18,
alignment: Alignment.center,
child: hierarchyList!.subordinateHierarchyList![index].numOfSubordinates.toString().toTextAuto(isBold: true, color: Colors.white, fontSize: 10),
),
],
),
],
),
),
],
),
),
),
],
),
),
);
},
itemCount: hierarchyList?.subordinateHierarchyList?.length ?? 0,
padding: const EdgeInsets.only(left: 12, right: 12, bottom: 12),
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
),
],
),
),
),
);
}
}

@ -46,7 +46,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
backgroundColor: const Color(0xffefefef), backgroundColor: const Color(0xffefefef),
body: Stack( body: Stack(
children: [ children: [
memberInformationList.eMPLOYEEIMAGE != null memberInformationList!.eMPLOYEEIMAGE != null
? Container( ? Container(
height: 300, height: 300,
margin: const EdgeInsets.only(top: 50), margin: const EdgeInsets.only(top: 50),

@ -29,7 +29,7 @@ class ProfileInFo extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
16.height, 16.height,
memberInfo.eMPLOYEENAME!.toText22(isCentered: true), memberInfo.eMPLOYEENAME!.toText22(),
("${memberInfo.eMPLOYEENUMBER!} | ${memberInfo.getPositionName()}").toText13(color: MyColors.grey80Color), ("${memberInfo.eMPLOYEENUMBER!} | ${memberInfo.getPositionName()}").toText13(color: MyColors.grey80Color),
memberInfo.eMPLOYEEEMAILADDRESS!.toText13(), memberInfo.eMPLOYEEEMAILADDRESS!.toText13(),
12.height, 12.height,

@ -16,7 +16,6 @@ import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/my_requests/get_ccp_output_model.dart'; import 'package:mohem_flutter_app/models/my_requests/get_ccp_output_model.dart';
import 'package:mohem_flutter_app/models/my_requests/get_ccp_transactions_model.dart'; import 'package:mohem_flutter_app/models/my_requests/get_ccp_transactions_model.dart';
import 'package:mohem_flutter_app/models/my_requests/get_concurrent_programs_model.dart'; import 'package:mohem_flutter_app/models/my_requests/get_concurrent_programs_model.dart';
import 'package:mohem_flutter_app/ui/screens/my_requests/new_request.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
@ -34,29 +33,21 @@ class _MyRequestsState extends State<MyRequests> {
List<GetCCPTransactionsModel> getCCPTransactionsList = []; List<GetCCPTransactionsModel> getCCPTransactionsList = [];
NewRequestModel? requestModel;
bool isNewRequest = false; bool isNewRequest = false;
@override @override
void initState() { void initState() {
getConcurrentPrograms();
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (requestModel == null) {
requestModel = ModalRoute.of(context)!.settings.arguments as NewRequestModel;
if (requestModel!.groupID != null) {
getConcurrentPrograms();
} else {
getCCPTransactions(requestModel!.functionName);
}
}
return Scaffold( return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget( appBar: AppBarWidget(
context, context,
title: LocaleKeys.concurrentReports.tr(), title: LocaleKeys.concurrentReports,
), ),
body: Column( body: Column(
children: [ children: [
@ -69,89 +60,86 @@ class _MyRequestsState extends State<MyRequests> {
child: PopupMenuButton( child: PopupMenuButton(
child: DynamicTextFieldWidget( child: DynamicTextFieldWidget(
LocaleKeys.templateName.tr(), LocaleKeys.templateName.tr(),
selectedConcurrentProgramList?.uSERCONCURRENTPROGRAMNAME ?? requestModel?.prompt ?? LocaleKeys.selectTemplate.tr(), selectedConcurrentProgramList?.uSERCONCURRENTPROGRAMNAME ?? LocaleKeys.selectTemplate.tr(),
isEnable: false, isEnable: false,
isPopup: true, isPopup: true,
isInputTypeNum: true, isInputTypeNum: true,
isReadOnly: getConcurrentProgramsList.isEmpty ? true : false, isReadOnly: false,
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[ itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < getConcurrentProgramsList.length; i++) PopupMenuItem<int>(child: Text(getConcurrentProgramsList![i].uSERCONCURRENTPROGRAMNAME!), value: i), for (int i = 0; i < getConcurrentProgramsList!.length; i++) PopupMenuItem<int>(child: Text(getConcurrentProgramsList![i].uSERCONCURRENTPROGRAMNAME!), value: i),
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
selectedConcurrentProgramList = getConcurrentProgramsList[popupIndex]; selectedConcurrentProgramList = getConcurrentProgramsList![popupIndex];
requestModel!.functionName = getConcurrentProgramsList[popupIndex].cONCURRENTPROGRAMNAME;
getCCPTransactions(selectedConcurrentProgramList?.cONCURRENTPROGRAMNAME); getCCPTransactions(selectedConcurrentProgramList?.cONCURRENTPROGRAMNAME);
setState(() {}); setState(() {});
}), }),
), ),
12.height, 12.height,
getCCPTransactionsList.isNotEmpty getCCPTransactionsList.isNotEmpty ? Expanded(
? Expanded( child: ListView.separated(
child: ListView.separated( physics: const BouncingScrollPhysics(),
physics: const BouncingScrollPhysics(), shrinkWrap: true,
shrinkWrap: true, itemBuilder: (BuildContext context, int index) {
itemBuilder: (BuildContext context, int index) { return Container(
return Container( width: double.infinity,
width: double.infinity, padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 12),
padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 12), margin: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 0),
margin: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 0), decoration: BoxDecoration(
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.circular(10),
borderRadius: BorderRadius.circular(10), boxShadow: [
boxShadow: [ BoxShadow(
BoxShadow( color: const Color(0xff000000).withOpacity(.05),
color: const Color(0xff000000).withOpacity(.05), blurRadius: 26,
blurRadius: 26, offset: const Offset(0, -3),
offset: const Offset(0, -3), ),
), ],
], ),
), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Row(
Row( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [ ("Request ID: " + getCCPTransactionsList[index].rEQUESTID.toString()).toText12(color: MyColors.grey57Color),
("Request ID: " + getCCPTransactionsList[index].rEQUESTID.toString()).toText12(color: MyColors.grey57Color), DateUtil.formatDateToDate(DateUtil.convertStringToDate(getCCPTransactionsList[index].rEQUESTDATE!), false).toText12(color: MyColors.grey70Color),
DateUtil.formatDateToDate(DateUtil.convertStringToDate(getCCPTransactionsList[index].rEQUESTDATE!), false).toText12(color: MyColors.grey70Color), ],
], ),
), Container(
Container( padding: const EdgeInsets.only(top: 10.0),
padding: const EdgeInsets.only(top: 10.0), child: ("Phase: " + getCCPTransactionsList[index].cCPPHASE!).toText12(color: MyColors.grey57Color, isBold: true),
child: ("Phase: " + getCCPTransactionsList[index].cCPPHASE!).toText12(color: MyColors.grey57Color, isBold: true), ),
), Container(
Container( padding: const EdgeInsets.only(top: 10.0),
padding: const EdgeInsets.only(top: 10.0), child: "Program Name: ".toText12(color: MyColors.grey57Color, isBold: true),
child: "Program Name: ".toText12(color: MyColors.grey57Color, isBold: true), ),
), getCCPTransactionsList[index].cONCURRENTPROGRAMNAME!.toText12(color: MyColors.gradiantEndColor),
getCCPTransactionsList[index].cONCURRENTPROGRAMNAME!.toText12(color: MyColors.gradiantEndColor), Container(
Container( padding: const EdgeInsets.only(top: 10.0),
padding: const EdgeInsets.only(top: 10.0), child: InkWell(
child: InkWell( onTap: () {
onTap: () { getCCPOutput(getCCPTransactionsList[index].rEQUESTID.toString());
getCCPOutput(getCCPTransactionsList[index].rEQUESTID.toString()); },
}, child: Row(
child: Row( children: [
children: [ "Output: ".toText12(color: MyColors.grey57Color),
"Output: ".toText12(color: MyColors.grey57Color), 8.width,
8.width, "Open PDF".toText12(color: MyColors.grey57Color),
"Open PDF".toText12(color: MyColors.grey57Color), 6.width,
6.width, const Icon(Icons.launch, size: 16.0),
const Icon(Icons.launch, size: 16.0), ],
], ),
),
),
),
],
), ),
); ),
}, ],
separatorBuilder: (BuildContext context, int index) => 12.height, ),
itemCount: getCCPTransactionsList.length), );
) },
: Container(), separatorBuilder: (BuildContext context, int index) => 12.height,
itemCount: getCCPTransactionsList.length),
) : Container(),
], ],
).expanded, ).expanded,
1.divider, 1.divider,
@ -164,17 +152,15 @@ class _MyRequestsState extends State<MyRequests> {
} }
void openNewRequest() async { void openNewRequest() async {
await Navigator.pushNamed(context, AppRoutes.newRequest, arguments: NewRequestModel(groupID: requestModel!.groupID, functionName: requestModel!.functionName)).then((value) { await Navigator.pushNamed(context, AppRoutes.newRequest).then((value) {
if (value != null && value == "refresh") { // getOpenTickets();
getCCPTransactions(requestModel!.functionName);
}
}); });
} }
void getConcurrentPrograms() async { void getConcurrentPrograms() async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
getConcurrentProgramsList = await MyRequestsApiClient().getConcurrentPrograms(requestModel!.groupID!); getConcurrentProgramsList = await MyRequestsApiClient().getConcurrentPrograms();
Utils.hideLoading(context); Utils.hideLoading(context);
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {

@ -11,7 +11,6 @@ import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_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/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/dyanmic_forms/validate_eit_transaction_model.dart'; import 'package:mohem_flutter_app/models/dyanmic_forms/validate_eit_transaction_model.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart'; import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
import 'package:mohem_flutter_app/models/my_requests/get_ccp_transactions_model.dart'; import 'package:mohem_flutter_app/models/my_requests/get_ccp_transactions_model.dart';
import 'package:mohem_flutter_app/models/my_requests/get_ccp_transations_list_model.dart'; import 'package:mohem_flutter_app/models/my_requests/get_ccp_transations_list_model.dart';
@ -20,14 +19,6 @@ import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
class NewRequestModel {
int? groupID;
String? functionName;
String? prompt;
NewRequestModel({this.groupID, this.functionName, this.prompt});
}
class NewRequest extends StatefulWidget { class NewRequest extends StatefulWidget {
const NewRequest({Key? key}) : super(key: key); const NewRequest({Key? key}) : super(key: key);
@ -43,29 +34,20 @@ class _NewRequestState extends State<NewRequest> {
List<GetEITDFFStructureList>? getCCPDFFStructureModelList; List<GetEITDFFStructureList>? getCCPDFFStructureModelList;
DateTime selectedDate = DateTime.now(); DateTime selectedDate = DateTime.now();
NewRequestModel? requestModel;
@override @override
void initState() { void initState() {
getConcurrentPrograms();
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (requestModel == null) {
requestModel = ModalRoute.of(context)!.settings.arguments as NewRequestModel;
if (requestModel!.groupID != null) {
getConcurrentPrograms();
} else {
getCCPDFFStructure(requestModel!.functionName);
}
}
return Scaffold( return Scaffold(
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBar: AppBarWidget( appBar: AppBarWidget(
context, context,
title: LocaleKeys.concurrentReports.tr(), title: LocaleKeys.concurrentReports,
), ),
body: Column( body: Column(
children: [ children: [
@ -76,17 +58,17 @@ class _NewRequestState extends State<NewRequest> {
PopupMenuButton( PopupMenuButton(
child: DynamicTextFieldWidget( child: DynamicTextFieldWidget(
LocaleKeys.templateName.tr(), LocaleKeys.templateName.tr(),
selectedConcurrentProgramList?.uSERCONCURRENTPROGRAMNAME ?? requestModel?.prompt ?? LocaleKeys.selectTemplate.tr(), selectedConcurrentProgramList?.uSERCONCURRENTPROGRAMNAME ?? LocaleKeys.selectTemplate.tr(),
isEnable: false, isEnable: false,
isPopup: true, isPopup: true,
isInputTypeNum: true, isInputTypeNum: true,
isReadOnly: getConcurrentProgramsList.isEmpty ? true : false, isReadOnly: false,
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[ itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < getConcurrentProgramsList.length; i++) PopupMenuItem<int>(child: Text(getConcurrentProgramsList[i].uSERCONCURRENTPROGRAMNAME!), value: i), for (int i = 0; i < getConcurrentProgramsList!.length; i++) PopupMenuItem<int>(child: Text(getConcurrentProgramsList![i].uSERCONCURRENTPROGRAMNAME!), value: i),
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
selectedConcurrentProgramList = getConcurrentProgramsList[popupIndex]; selectedConcurrentProgramList = getConcurrentProgramsList![popupIndex];
getCCPDFFStructure(selectedConcurrentProgramList?.cONCURRENTPROGRAMNAME); getCCPDFFStructure(selectedConcurrentProgramList?.cONCURRENTPROGRAMNAME);
setState(() {}); setState(() {});
}), }),
@ -119,11 +101,8 @@ class _NewRequestState extends State<NewRequest> {
List<Map<String, dynamic>> values = getCCPDFFStructureModelList!.map((e) { List<Map<String, dynamic>> values = getCCPDFFStructureModelList!.map((e) {
String? dateVal = ''; String? dateVal = '';
String? vatcherVal = ''; String? vatcherVal = '';
print(e.aPPLICATIONCOLUMNNAME);
print(e.fORMATTYPE);
print(e.eSERVICESDV!.pIDCOLUMNNAME);
int? numberVal; int? numberVal;
if (e.fORMATTYPE == 'N') { if (e!.fORMATTYPE == 'N') {
dateVal = null; dateVal = null;
vatcherVal = e.eSERVICESDV!.pIDCOLUMNNAME; vatcherVal = e.eSERVICESDV!.pIDCOLUMNNAME;
numberVal = null; numberVal = null;
@ -131,10 +110,6 @@ class _NewRequestState extends State<NewRequest> {
dateVal = null; dateVal = null;
vatcherVal = e.eSERVICESDV!.pIDCOLUMNNAME; vatcherVal = e.eSERVICESDV!.pIDCOLUMNNAME;
numberVal = null; numberVal = null;
} else if (e.fORMATTYPE == 'C') {
dateVal = null;
numberVal = null;
vatcherVal = e.eSERVICESDV!.pIDCOLUMNNAME;
} else { } else {
dateVal = null; dateVal = null;
numberVal = null; numberVal = null;
@ -143,13 +118,14 @@ class _NewRequestState extends State<NewRequest> {
return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson(); return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson();
}).toList(); }).toList();
Utils.showLoading(context); Utils.showLoading(context);
GenericResponseModel responseData = await MyRequestsApiClient().getSubmitNewRequest(values, functionName: requestModel?.functionName ?? "HMG_EMP_BUS_TRIP_SET_SS"); submitCcpTransactionList = await MyRequestsApiClient().getSubmitNewRequest(values);
getCCPTransactionsList = await MyRequestsApiClient().getCcpTransactions(values);
Utils.hideLoading(context); Utils.hideLoading(context);
if (responseData.messageStatus == 1) { Navigator.pushNamed(
Navigator.pop(context, "refresh"); context,
} else { AppRoutes.myRequests,
Utils.showToast(responseData.errorEndUserMessage ?? ""); );
} setState(() {});
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
@ -159,7 +135,7 @@ class _NewRequestState extends State<NewRequest> {
void getConcurrentPrograms() async { void getConcurrentPrograms() async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
getConcurrentProgramsList = await MyRequestsApiClient().getConcurrentPrograms(requestModel!.groupID!); getConcurrentProgramsList = await MyRequestsApiClient().getConcurrentPrograms();
Utils.hideLoading(context); Utils.hideLoading(context);
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {
@ -200,7 +176,6 @@ class _NewRequestState extends State<NewRequest> {
model.eSERVICESDV?.pIDCOLUMNNAME ?? "", model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y", isReadOnly: model.rEADONLY == "Y",
isInputTypeNum: true, isInputTypeNum: true,
length: model.mAXIMUMSIZE,
onChange: (text) { onChange: (text) {
model.fieldAnswer = text; model.fieldAnswer = text;
model.eSERVICESDV ??= ESERVICESDV(); model.eSERVICESDV ??= ESERVICESDV();
@ -214,7 +189,7 @@ class _NewRequestState extends State<NewRequest> {
displayText = displayText.replaceAll(" 00:00:00", ""); displayText = displayText.replaceAll(" 00:00:00", "");
} }
if (!displayText.contains("-")) { if (!displayText.contains("-")) {
displayText = DateFormat('yyyy-MM-dd', "en_US").format(DateFormat("yyyy/MM/dd", "en_US").parse(displayText)); displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
} }
} }
return DynamicTextFieldWidget( return DynamicTextFieldWidget(
@ -225,7 +200,7 @@ class _NewRequestState extends State<NewRequest> {
onTap: () async { onTap: () async {
if ((getCCPDFFStructureModelList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { if ((getCCPDFFStructureModelList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS) { if (getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS) {
selectedDate = DateFormat("yyyy/MM/dd", "en_US").parse(getCCPDFFStructureModelList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", "")); selectedDate = DateFormat("yyyy/MM/dd").parse(getCCPDFFStructureModelList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else { } else {
selectedDate = DateTime.parse(getCCPDFFStructureModelList![index].eSERVICESDV!.pVALUECOLUMNNAME!); selectedDate = DateTime.parse(getCCPDFFStructureModelList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
} }
@ -236,18 +211,16 @@ class _NewRequestState extends State<NewRequest> {
ESERVICESDV eservicesdv; ESERVICESDV eservicesdv;
if (getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS) { if (getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS) {
eservicesdv = ESERVICESDV( eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: DateFormat('yyyy/MM/dd HH:MM:SS', "en_US").format(date1), pIDCOLUMNNAME: DateFormat('yyyy/MM/dd HH:MM:SS').format(date1),
pRETURNMSG: "null", pRETURNMSG: "null",
pRETURNSTATUS: getCCPDFFStructureModelList![index].dEFAULTVALUE, pRETURNSTATUS: getCCPDFFStructureModelList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: pVALUECOLUMNNAME: getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy/MM/dd HH:MM:SS').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy/MM/dd HH:MM:SS', "en_US").format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
} else { } else {
eservicesdv = ESERVICESDV( eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd', "en_US").format(date1), pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
pRETURNMSG: "null", pRETURNMSG: "null",
pRETURNSTATUS: getCCPDFFStructureModelList![index].dEFAULTVALUE, pRETURNSTATUS: getCCPDFFStructureModelList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: pVALUECOLUMNNAME: getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss', "en_US").format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
} }
getCCPDFFStructureModelList![index].eSERVICESDV = eservicesdv; getCCPDFFStructureModelList![index].eSERVICESDV = eservicesdv;
setState(() {}); setState(() {});
@ -350,7 +323,6 @@ class _NewRequestState extends State<NewRequest> {
isPopup: true, isPopup: true,
isInputTypeNum: true, isInputTypeNum: true,
isReadOnly: model.rEADONLY == "Y", isReadOnly: model.rEADONLY == "Y",
length: model.mAXIMUMSIZE,
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[ itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i), for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i),

@ -85,7 +85,7 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
getOffersList[0].discountDescription!.toText16(isBold: true), getOffersList[0].discount!.toText16(isBold: true),
InkWell( InkWell(
onTap: () { onTap: () {
_shareOfferAsImage(); _shareOfferAsImage();

@ -107,8 +107,8 @@ class _EndEmploymentScreenState extends State<EndEmploymentScreen> {
tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? ""; tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? "";
if (tempVar.isNotEmpty) { if (tempVar.isNotEmpty) {
if (!tempVar.contains("/")) { if (!tempVar.contains("/")) {
DateTime date = DateFormat('yyyy-MM-dd', "en_US").parse(tempVar); DateTime date = DateFormat('yyyy-MM-dd').parse(tempVar);
tempVar = DateFormat('yyyy/MM/dd HH:mm:ss', "en_US").format(date); tempVar = DateFormat('yyyy/MM/dd HH:mm:ss').format(date);
} }
} }
} }
@ -303,7 +303,6 @@ class _EndEmploymentScreenState extends State<EndEmploymentScreen> {
model.eSERVICESDV?.pIDCOLUMNNAME ?? "", model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y", isReadOnly: model.rEADONLY == "Y",
isInputTypeNum: true, isInputTypeNum: true,
length: model.mAXIMUMSIZE,
onChange: (text) { onChange: (text) {
model.eSERVICESDV ??= ESERVICESDV(); model.eSERVICESDV ??= ESERVICESDV();
model.eSERVICESDV!.pIDCOLUMNNAME = text; model.eSERVICESDV!.pIDCOLUMNNAME = text;
@ -476,7 +475,6 @@ class _EndEmploymentScreenState extends State<EndEmploymentScreen> {
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "", model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y", isReadOnly: model.rEADONLY == "Y",
length: model.mAXIMUMSIZE,
onChange: (text) { onChange: (text) {
//model.fieldAnswer = text; //model.fieldAnswer = text;
}, },

@ -127,7 +127,7 @@ class SelectedItemSheet extends StatelessWidget {
if (favoriteReplacements != null) empID = favoriteReplacements!.userName; if (favoriteReplacements != null) empID = favoriteReplacements!.userName;
if (replacementList != null) empID = replacementList!.userName; if (replacementList != null) empID = replacementList!.userName;
try { try {
memberInformationListModel = await WorkListApiClient().getUserInformation(-999, empID!, notificationID.toString()); memberInformationListModel = await WorkListApiClient().getUserInformation(-999, empID!);
if (actionHistoryList != null) empID = actionHistoryList!.eMPLOYEEIMAGE = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp; if (actionHistoryList != null) empID = actionHistoryList!.eMPLOYEEIMAGE = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp;
if (favoriteReplacements != null) empID = favoriteReplacements!.employeeImage = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp; if (favoriteReplacements != null) empID = favoriteReplacements!.employeeImage = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp;
if (replacementList != null) empID = replacementList!.employeeImage = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp; if (replacementList != null) empID = replacementList!.employeeImage = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp;
@ -140,8 +140,7 @@ class SelectedItemSheet extends StatelessWidget {
Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async { Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async {
Utils.showLoading(context); Utils.showLoading(context);
try { try {
await WorkListApiClient().submitComment( await WorkListApiClient().submitComment(comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode, approverIndex: actionHistoryList != null ? actionHistoryList!.sEQUENCE : null);
comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode, approverIndex: actionHistoryList != null ? actionHistoryList!.sEQUENCE : null);
Utils.hideLoading(context); Utils.hideLoading(context);
// Navigator.pop(context); // Navigator.pop(context);
// Navigator.pop(context); // Navigator.pop(context);

@ -753,7 +753,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
memberInformationListModel = null; memberInformationListModel = null;
memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!, workListData!.nOTIFICATIONID.toString()); memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
Utils.hideLoading(context); Utils.hideLoading(context);

@ -93,7 +93,7 @@ class ActionsFragment extends StatelessWidget {
], ],
), ),
10.height, 10.height,
// getActionDuration(index).toText11(maxLine: 1, color: const Color(0xff1FA269)) getActionDuration(index).toText11(maxLine: 1, color: const Color(0xff1FA269))
], ],
), ),
) )

@ -13,7 +13,7 @@ class AppLogo extends StatelessWidget {
return Row( return Row(
children: [ children: [
SvgPicture.asset( SvgPicture.asset(
"assets/moe_logo.svg", "assets/mohemm_logo.svg",
height: 48, height: 48,
width: 48, width: 48,
alignment: Alignment.centerRight, alignment: Alignment.centerRight,

@ -45,8 +45,8 @@ class BalancesDashboardWidget extends StatefulWidget {
class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> { class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
List<PieChartModel> chartModelList = []; List<PieChartModel> chartModelList = [];
late DateTime accrualDateTime; late DateTime accrualDateTime;
List<GetAccrualBalancesList>? leaveBalanceAccrual =[]; GetAccrualBalancesList? leaveBalanceAccrual;
List<GetAccrualBalancesList>? ticketBalanceAccrualList =[]; List<GetAccrualBalancesList>? ticketBalanceAccrualList;
@override @override
void initState() { void initState() {
@ -63,23 +63,20 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
void changeAccrualDate(bool showLoading) async { void changeAccrualDate(bool showLoading) async {
try { try {
if (showLoading) Utils.showLoading(context); if (showLoading) Utils.showLoading(context);
List<GetAccrualBalancesList> accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy", "en_US").format(accrualDateTime), empID: widget.selectedEmp); List<GetAccrualBalancesList> accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy").format(accrualDateTime), empID: widget.selectedEmp);
if (accrualList.isNotEmpty) { if (accrualList.isNotEmpty) {
if (widget.isLeaveBalance) { if (widget.isLeaveBalance) {
leaveBalanceAccrual = accrualList; leaveBalanceAccrual = accrualList[0];
chartModelList = [ chartModelList = [
PieChartModel(LocaleKeys.currentBalance.tr(), ((leaveBalanceAccrual![0]?.accrualNetEntitlement! ?? 0)! + (leaveBalanceAccrual![1]?.accrualNetEntitlement! ??0)!).toDouble() , MyColors.textMixColor, titleAppend: ""), PieChartModel(LocaleKeys.currentBalance.tr(), leaveBalanceAccrual?.accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.usedBalance.tr(), ((leaveBalanceAccrual![0]?.accrualUsedEntitlement! ?? 0)! + (leaveBalanceAccrual![1]?.accrualUsedEntitlement! ??0)!).toDouble() , MyColors.backgroundBlackColor, titleAppend: ""), PieChartModel(LocaleKeys.usedBalance.tr(), leaveBalanceAccrual?.accrualUsedEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
]; ];
} } else {
else if(accrualList.isNotEmpty){
chartModelList = [ chartModelList = [
PieChartModel(LocaleKeys.adult.tr(), accrualList[1].accrualNetEntitlement?.toDouble() ?? 0, MyColors.textMixColor, titleAppend: ""), PieChartModel(LocaleKeys.adult.tr(), accrualList[1].accrualNetEntitlement?.toDouble() ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.child.tr(), accrualList[2].accrualNetEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""), PieChartModel(LocaleKeys.child.tr(), accrualList[2].accrualNetEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
PieChartModel(LocaleKeys.infants.tr(), accrualList[3].accrualNetEntitlement?.toDouble() ?? 0, MyColors.pinkColor, titleAppend: ""), PieChartModel(LocaleKeys.infants.tr(), accrualList[3].accrualNetEntitlement?.toDouble() ?? 0, MyColors.pinkColor, titleAppend: ""),
]; ];
} }
} }
if (showLoading) Utils.hideLoading(context); if (showLoading) Utils.hideLoading(context);
@ -92,15 +89,15 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// if (leaveBalanceAccrual == null && widget.isLeaveBalance) { if (leaveBalanceAccrual == null && widget.isLeaveBalance) {
// leaveBalanceAccrual = Provider.of<DashboardProviderModel>(context, listen: false).leaveBalanceAccrual; leaveBalanceAccrual = Provider.of<DashboardProviderModel>(context, listen: false).leaveBalanceAccrual;
// chartModelList = [ chartModelList = [
// PieChartModel(LocaleKeys.currentBalance.tr(), leaveBalanceAccrual?.accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""), PieChartModel(LocaleKeys.currentBalance.tr(), leaveBalanceAccrual?.accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
// PieChartModel(LocaleKeys.usedBalance.tr(), leaveBalanceAccrual?.accrualUsedEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""), PieChartModel(LocaleKeys.usedBalance.tr(), leaveBalanceAccrual?.accrualUsedEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
// ]; ];
// } }
if (ticketBalanceAccrualList!.isEmpty && !widget.isLeaveBalance) { if (ticketBalanceAccrualList == null && !widget.isLeaveBalance) {
ticketBalanceAccrualList = Provider.of<DashboardProviderModel>(context, listen: false).accrualList ?? []; ticketBalanceAccrualList = Provider.of<DashboardProviderModel>(context, listen: false).accrualList ?? [];
if (ticketBalanceAccrualList!.isNotEmpty) { if (ticketBalanceAccrualList!.isNotEmpty) {
chartModelList = [ chartModelList = [
@ -133,7 +130,7 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
], ],
), ),
8.height, 8.height,
(leaveBalanceAccrual!.isNotEmpty || ticketBalanceAccrualList!.isNotEmpty) ? Row( Row(
children: [ children: [
ListView.separated( ListView.separated(
shrinkWrap: true, shrinkWrap: true,
@ -147,7 +144,7 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
.expanded, .expanded,
getChart(chartModelList) getChart(chartModelList)
], ],
) :const Center(child:CircularProgressIndicator(backgroundColor:MyColors.gradiantStartColor,)) )
], ],
).paddingOnly(top: 19, bottom: 11, right: 6, left: 14).objectContainerView(disablePadding: true, radius: 10); ).paddingOnly(top: 19, bottom: 11, right: 6, left: 14).objectContainerView(disablePadding: true, radius: 10);
} }

@ -12,9 +12,8 @@ class ConfirmDialog extends StatelessWidget {
final String message; final String message;
final String? okTitle; final String? okTitle;
final VoidCallback? onTap; final VoidCallback? onTap;
final VoidCallback? onCloseTap;
const ConfirmDialog({Key? key, this.title, required this.message, this.okTitle, this.onTap, this.onCloseTap}) : super(key: key); const ConfirmDialog({Key? key, this.title, required this.message, this.okTitle, this.onTap}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -42,8 +41,9 @@ class ConfirmDialog extends StatelessWidget {
icon: const Icon(Icons.close), icon: const Icon(Icons.close),
color: MyColors.darkTextColor, color: MyColors.darkTextColor,
constraints: const BoxConstraints(), constraints: const BoxConstraints(),
onPressed: () => onCloseTap ?? Navigator.pop(context), onPressed: () {
// onPressed: () => Navigator.pop(context), Navigator.pop(context);
},
) )
], ],
), ),

@ -1,8 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
class DynamicTextFieldWidget extends StatelessWidget { class DynamicTextFieldWidget extends StatelessWidget {
final String labelText; final String labelText;
@ -20,8 +17,6 @@ class DynamicTextFieldWidget extends StatelessWidget {
final bool isInputTypeNumSigned; final bool isInputTypeNumSigned;
final bool isObscureText; final bool isObscureText;
final bool isBackgroundEnable; final bool isBackgroundEnable;
final int? length;
final String? toolTip;
final void Function(String)? onChange; final void Function(String)? onChange;
DynamicTextFieldWidget(this.labelText, this.hintText, //this.controller, DynamicTextFieldWidget(this.labelText, this.hintText, //this.controller,
@ -36,8 +31,6 @@ class DynamicTextFieldWidget extends StatelessWidget {
this.onChange, this.onChange,
this.isInputTypeNum = false, this.isInputTypeNum = false,
this.isInputTypeNumSigned = true, this.isInputTypeNumSigned = true,
this.length,
this.toolTip = "",
this.isBackgroundEnable = false}); this.isBackgroundEnable = false});
@override @override
@ -54,7 +47,7 @@ class DynamicTextFieldWidget extends StatelessWidget {
), ),
), ),
child: InkWell( child: InkWell(
onTap: isReadOnly ? null : onTap, onTap: onTap,
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
@ -75,18 +68,13 @@ class DynamicTextFieldWidget extends StatelessWidget {
enabled: isEnable, enabled: isEnable,
scrollPadding: EdgeInsets.zero, scrollPadding: EdgeInsets.zero,
readOnly: isReadOnly, readOnly: isReadOnly,
keyboardType: (isInputTypeNum) keyboardType: (isInputTypeNum) ? (isInputTypeNumSigned ? const TextInputType.numberWithOptions(signed: true, decimal: true) : TextInputType.numberWithOptions(signed: true, decimal: true)) : TextInputType.text,
? (isInputTypeNumSigned ? const TextInputType.numberWithOptions(signed: true, decimal: true) : TextInputType.numberWithOptions(signed: true, decimal: true))
: TextInputType.text,
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
//controller: controller, //controller: controller,
maxLines: lines, maxLines: lines,
obscuringCharacter: "*", obscuringCharacter: "*",
obscureText: isObscureText, obscureText: isObscureText,
onChanged: onChange, onChanged: onChange,
inputFormatters: [
LengthLimitingTextInputFormatter(length),
],
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
height: 21 / 14, height: 21 / 14,
@ -119,10 +107,6 @@ class DynamicTextFieldWidget extends StatelessWidget {
), ),
if (isPopup) const Icon(Icons.keyboard_arrow_down_outlined, color: MyColors.darkIconColor), if (isPopup) const Icon(Icons.keyboard_arrow_down_outlined, color: MyColors.darkIconColor),
if (onTap != null) Icon(suffixIconData ?? Icons.keyboard_arrow_down_outlined, color: MyColors.darkIconColor), if (onTap != null) Icon(suffixIconData ?? Icons.keyboard_arrow_down_outlined, color: MyColors.darkIconColor),
if (toolTip!.isNotEmpty)
Icon(Icons.help_outline_rounded, color: MyColors.darkIconColor).onPress(() {
Utils.showToast(toolTip!);
}).paddingOnly(left: 6),
], ],
), ),
), ),

@ -36,7 +36,7 @@ class _LoadingDialogState extends State<LoadingDialog> {
textDirection: TextDirection.rtl, textDirection: TextDirection.rtl,
child: Center( child: Center(
child: Image.asset( child: Image.asset(
"assets/images/logos/loading_moe.gif", "assets/images/logos/loading_mohemm_logo.gif",
height: 96.0, height: 96.0,
width: 96.0, width: 96.0,
), ),

@ -1,11 +1,22 @@
import 'dart:async'; import 'dart:async';
import 'dart:math';
import 'dart:ui';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_directions_api/google_directions_api.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:mohem_flutter_app/classes/app_permissions.dart'; import 'package:mohem_flutter_app/classes/app_permissions.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/theme/colors.dart';
// import 'package:geodesy/geodesy.dart' as geodesy;
//Created By Mr.Zohaib
class Location { class Location {
static _Map map = _Map();
static void havePermission(Function(bool) callback) { static void havePermission(Function(bool) callback) {
Geolocator.checkPermission().then((value) async { Geolocator.checkPermission().then((value) async {
if (value == LocationPermission.denied) { if (value == LocationPermission.denied) {
@ -35,11 +46,12 @@ class Location {
}); });
} }
static void getCurrentLocation(Function(Position position, bool isMocked) callback, BuildContext context) { static void getCurrentLocation(Function(LatLng?, bool isMocked) callback, BuildContext context) {
void done(Position position) { void done(Position position) {
//AppStorage.sp.saveLocation(position); //AppStorage.sp.saveLocation(position);
bool isMocked = position.isMocked; bool isMocked = position.isMocked;
callback(position, isMocked); LatLng? myCurrentLocation = LatLng(position.latitude, position.longitude);
callback(myCurrentLocation, isMocked);
} }
AppPermissions.location((granted) { AppPermissions.location((granted) {
@ -58,4 +70,182 @@ class Location {
} }
}, context); }, context);
} }
// static LatLng locationAwayFrom(
// {required LatLng loc1, num distanceMeters = 200.0, num bearing = 270.0}) {
// geodesy.LatLng l1 = geodesy.LatLng(loc1.latitude, loc1.longitude);
// geodesy.LatLng destinationPoint = geodesy.Geodesy()
// .destinationPointByDistanceAndBearing(l1, distanceMeters, bearing);
// return LatLng(destinationPoint.latitude, destinationPoint.longitude);
// }
static Future<double> distanceTo(LatLng destination) async {
var myLoc = await Geolocator.getLastKnownPosition();
var distance = 0.0;
if (myLoc != null) {
distance = Geolocator.distanceBetween(destination.latitude, destination.longitude, myLoc.latitude, myLoc.longitude);
}
return distance;
}
}
class _Map {
Marker createMarker(
String id, {
required LatLng coordinates,
BitmapDescriptor? icon,
VoidCallback? onTap,
}) {
MarkerId markerId = MarkerId(id);
return Marker(
icon: icon ?? BitmapDescriptor.defaultMarker,
markerId: markerId,
position: coordinates,
flat: false,
// infoWindow: InfoWindow(title: id, snippet: '*'),
onTap: onTap,
);
}
CameraPosition initialCamera({required Completer<GoogleMapController> mapController, LatLng? position, double zoom = 12}) {
position = position ?? LatLng(24.7249303, 46.5416656);
CameraPosition riyadhEye = CameraPosition(
target: position,
zoom: zoom,
);
mapController.future.then((controller) {
controller.animateCamera(CameraUpdate.newCameraPosition(riyadhEye));
});
return riyadhEye;
}
CameraPosition moveTo(LatLng location, {double zoom = 12, double direction = 0.0, required Completer<GoogleMapController> mapController, bool? animation}) {
var camera = CameraPosition(target: location, zoom: zoom, bearing: direction);
mapController.future.then((controller) {
animation ?? false ? controller.animateCamera(CameraUpdate.newCameraPosition(camera)) : controller.moveCamera(CameraUpdate.newCameraPosition(camera));
});
return camera;
}
void moveCamera(CameraPosition camera, @required Completer<GoogleMapController> mapController, bool animation) {
mapController.future.then((controller) {
animation ? controller.animateCamera(CameraUpdate.newCameraPosition(camera)) : controller.moveCamera(CameraUpdate.newCameraPosition(camera));
});
}
void scrollBy({double x = 0, double y = 0, required Completer<GoogleMapController> mapController, bool animation = true}) {
var camera = CameraUpdate.scrollBy(x, y);
mapController.future.then((controller) {
animation ? controller.animateCamera(camera) : controller.moveCamera(camera);
});
}
// void goToCurrentLocation({Completer<GoogleMapController>? mapController, double? direction = 0.0, bool? animation}) {
// Location.getCurrentLocation((location) {
// moveTo(location!, zoom: 17, mapController: mapController!, animation: animation, direction: direction!);
// });
// }
var routes = Map<String, DirectionsRoute>();
void setRoutePolylines(LatLng? source, LatLng? destination, Set<Polyline> polylines, Completer<GoogleMapController> mapController, Function(DirectionsRoute?) completion) {
if (source == null || destination == null) {
completion(null);
return;
}
var origin = '${source.latitude},${source.longitude}';
var destin = '${destination.latitude},${destination.longitude}';
var routeId = '$origin->$destination';
void createPolyline(DirectionsRoute results) {
List<LatLng> polylineCoordinates = results.overviewPath!.map((e) => LatLng(e.latitude, e.longitude)).toList();
PolylineId id = PolylineId("route");
Polyline polyline = Polyline(
polylineId: id,
color: accentColor,
width: 5,
jointType: JointType.round,
startCap: Cap.roundCap,
endCap: Cap.roundCap,
points: polylineCoordinates,
);
polylines.removeWhere((element) => true);
polylines.add(polyline);
LatLngBounds bound = getBounds(coordinates: polylineCoordinates);
focusCameraToLatLngBounds(bound: bound, mapController: mapController, padding: 100);
completion(routes[routeId]);
}
var availableRoute = routes[routeId];
if (availableRoute == null) {
var request = DirectionsRequest(origin: origin, destination: destin);
DirectionsService().route(request, (response, status) {
if (status == DirectionsStatus.ok && response.routes!.isNotEmpty) {
routes[routeId] = response.routes!.first;
createPolyline(response.routes!.first);
}
});
} else {
createPolyline(availableRoute);
}
}
LatLngBounds getBounds({required List<LatLng> coordinates}) {
var lngs = coordinates.map<double>((c) => c.longitude).toList();
var lats = coordinates.map<double>((c) => c.latitude).toList();
double bottomMost = lngs.reduce(min);
double topMost = lngs.reduce(max);
double leftMost = lats.reduce(min);
double rightMost = lats.reduce(max);
LatLngBounds bounds = LatLngBounds(
northeast: LatLng(rightMost, topMost),
southwest: LatLng(leftMost, bottomMost),
);
return bounds;
double? x0, x1, y0, y1;
for (LatLng latLng in coordinates) {
if (x0 == null) {
x0 = x1 = latLng.latitude;
y0 = y1 = latLng.longitude;
} else {
if (latLng.latitude > x1!) x1 = latLng.latitude;
if (latLng.latitude < x0) x0 = latLng.latitude;
if (latLng.longitude > y1!) y1 = latLng.longitude;
if (latLng.longitude < y0!) y0 = latLng.longitude;
}
}
return LatLngBounds(northeast: LatLng(x1!, y1!), southwest: LatLng(x0!, y0!));
}
void focusCameraToLatLngBounds({LatLngBounds? bound, Completer<GoogleMapController>? mapController, double? padding}) async {
if (bound == null) return;
CameraUpdate camera = CameraUpdate.newLatLngBounds(bound, padding!);
GoogleMapController controller = await mapController!.future;
controller.animateCamera(camera);
}
void focusCameraTo2Points({LatLng? point1, LatLng? point2, Completer<GoogleMapController>? mapController, double? padding}) async {
var source = point1;
var destination = point2;
if (source != null && destination != null) {
// 'package:google_maps_flutter_platform_interface/src/types/location.dart': Failed assertion: line 72 pos 16: 'southwest.latitude <= northeast.latitude': is not true.
LatLngBounds bound;
if (source.latitude <= destination.latitude) {
bound = LatLngBounds(southwest: source, northeast: destination);
} else {
bound = LatLngBounds(southwest: destination, northeast: source);
}
if (bound == null) return;
focusCameraToLatLngBounds(bound: bound, mapController: mapController, padding: padding);
}
}
} }

@ -3,7 +3,7 @@ import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:mohem_flutter_app/api/dashboard_api_client.dart'; import 'package:mohem_flutter_app/api/dashboard_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.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/colors.dart';
@ -95,11 +95,11 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
// if (isNfcEnabled) // if (isNfcEnabled)
attendanceMethod("NFC", "assets/images/nfc.svg", isNfcEnabled, () { attendanceMethod("NFC", "assets/images/nfc.svg", isNfcEnabled, () {
if (isNfcLocationEnabled) { if (isNfcLocationEnabled) {
Location.getCurrentLocation((Position position, bool isMocked) { Location.getCurrentLocation((LatLng? latlng, bool isMocked) {
if (isMocked) { if (isMocked) {
markFakeAttendance("NFC", position.latitude.toString() ?? "", position.longitude.toString() ?? ""); markFakeAttendance("NFC", latlng?.latitude.toString() ?? "", latlng?.longitude.toString() ?? "");
} else { } else {
performNfcAttendance(widget.model, lat: position.latitude.toString() ?? "", lng: position.longitude.toString() ?? ""); performNfcAttendance(widget.model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
} }
}, context); }, context);
} else { } else {
@ -109,11 +109,11 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
if (isWifiEnabled) if (isWifiEnabled)
attendanceMethod("Wifi", "assets/images/wufu.svg", isWifiEnabled, () { attendanceMethod("Wifi", "assets/images/wufu.svg", isWifiEnabled, () {
if (isWifiLocationEnabled) { if (isWifiLocationEnabled) {
Location.getCurrentLocation((Position position, bool isMocked) { Location.getCurrentLocation((LatLng? latlng, bool isMocked) {
if (isMocked) { if (isMocked) {
markFakeAttendance("WIFI", position.latitude.toString() ?? "", position.longitude.toString() ?? ""); markFakeAttendance("WIFI", latlng?.latitude.toString() ?? "", latlng?.longitude.toString() ?? "");
} else { } else {
performWifiAttendance(widget.model, lat: position.latitude.toString() ?? "", lng: position.longitude.toString() ?? ""); performWifiAttendance(widget.model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
} }
}, context); }, context);
} else { } else {
@ -124,11 +124,11 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
if (isQrEnabled) if (isQrEnabled)
attendanceMethod("QR", "assets/images/ic_qr.svg", isQrEnabled, () async { attendanceMethod("QR", "assets/images/ic_qr.svg", isQrEnabled, () async {
if (isQrLocationEnabled) { if (isQrLocationEnabled) {
Location.getCurrentLocation((Position position, bool isMocked) { Location.getCurrentLocation((LatLng? latlng, bool isMocked) {
if (isMocked) { if (isMocked) {
markFakeAttendance("QR", position.latitude.toString() ?? "", position.longitude.toString() ?? ""); markFakeAttendance("QR", latlng?.latitude.toString() ?? "", latlng?.longitude.toString() ?? "");
} else { } else {
performQrCodeAttendance(widget.model, lat: position.latitude.toString() ?? "", lng: position.longitude.toString() ?? ""); performQrCodeAttendance(widget.model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
} }
}, context); }, context);
} else { } else {
@ -145,6 +145,7 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
Future<void> performNfcAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async { Future<void> performNfcAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async {
if (Platform.isIOS) { if (Platform.isIOS) {
Utils.readNFc(onRead: (String nfcId) async { Utils.readNFc(onRead: (String nfcId) async {
Utils.showLoading(context); Utils.showLoading(context);
try { try {
@ -213,25 +214,7 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
} }
} }
Future<bool> checkSession() async {
try {
Utils.showLoading(context);
await DashboardApiClient().getOpenMissingSwipes();
Utils.hideLoading(context);
return true;
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
return false;
}
}
Future<void> performWifiAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async { Future<void> performWifiAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async {
if (Platform.isAndroid) {
if (!(await checkSession())) {
return;
}
}
Utils.showLoading(context); Utils.showLoading(context);
bool isConnected = await WiFiForIoTPlugin.connect(AppState().getMohemmWifiSSID ?? "", bool isConnected = await WiFiForIoTPlugin.connect(AppState().getMohemmWifiSSID ?? "",
password: AppState().getMohemmWifiPassword ?? "", joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false); password: AppState().getMohemmWifiPassword ?? "", joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false);
@ -244,13 +227,23 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
} }
} }
if (isConnected && AppState().isAuthenticated) { if (isConnected) {
// if (Platform.isIOS) {
// await closeWifiRequest();
// await Future.delayed(Duration(seconds: 6));
// } else {
// await WiFiForIoTPlugin.forceWifiUsage(true);
// }
await WiFiForIoTPlugin.forceWifiUsage(true); await WiFiForIoTPlugin.forceWifiUsage(true);
await Future.delayed(const Duration(seconds: 6)); await Future.delayed(const Duration(seconds: 6));
try { try {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 3, nfcValue: "", isGpsRequired: isWifiLocationEnabled, lat: lat, long: lng); GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 3, nfcValue: "", isGpsRequired: isWifiLocationEnabled, lat: lat, long: lng);
bool status = await model.fetchAttendanceTracking(context); bool status = await model.fetchAttendanceTracking(context);
Utils.hideLoading(context); Utils.hideLoading(context);
// if (Platform.isAndroid) {
// await closeWifiRequest();
// }
await closeWifiRequest(); await closeWifiRequest();
showMDialog( showMDialog(
context, context,
@ -264,12 +257,8 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
} }
} else { } else {
if (AppState().isAuthenticated) { Utils.hideLoading(context);
Utils.hideLoading(context); Utils.confirmDialog(context, LocaleKeys.comeNearHMGWifi.tr());
Utils.confirmDialog(context, LocaleKeys.comeNearHMGWifi.tr());
} else {
await closeWifiRequest();
}
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save