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: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.huawei.agconnect'
android {
compileSdkVersion 33
@ -59,12 +58,6 @@ android {
}
signingConfigs {
// debug {
// keyAlias keystoreProperties['keyAlias']
// keyPassword keystoreProperties['keyPassword']
// storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
// storePassword keystoreProperties['storePassword']
// }
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
@ -75,9 +68,6 @@ android {
buildTypes {
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.NFC" />
<uses-permission android:name="android.permission.CAMERA" />
<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" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<application
android:allowBackup="false"

@ -3,14 +3,12 @@ buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.8'
classpath 'com.huawei.agconnect:agcp:1.8.0.300'
}
}
@ -18,7 +16,6 @@ allprojects {
repositories {
google()
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": "تحقق في",
"workList": "قائمة العمل",
"leaveBalance": "رصيد الاجازات",
"businessTripBalance": "رصيد رحلة العمل",
"missingSwipes": "تسجيل بصمة حضور",
"ticketBalance": "رصيد التذكرة",
"other": "آخر",
@ -307,7 +306,6 @@
"actionBy": "الرد بواسطة",
"pending": "معلق",
"pendingTransactions": "المعاملات المعلقه",
"notices": "إشعارات",
"selectRequestType": "الرجاء اختيار نوع الطلب",
"dateFrom": "من تاريخ",
"dateTo": "الى تاريخ",
@ -526,19 +524,5 @@
"fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية",
"noWinner": "حزين! لم يفز أحد اليوم.",
"myTeam" : "فريقي",
"youCanPlayDemo": "لكن يمكنك لعب العرض",
"qualification": "مؤهلات",
"esteblishmentName": "اسم المؤسسة",
"gradeDescription": "وصف الصف",
"type": "يكتب",
"status": "حالة",
"leaveType": "نوع الإجازة",
"attendanceType": "نوع الحضور",
"help": "يساعد",
"dear": "عزيزي",
"assistant": "للحصول على المساعدة ، يمكنك تقديم الطلب على نظام سعيد أو الاتصال بمركز الاتصال الموحد على 8310200",
"employee_leaves_calender": "تقويم أوراق الموظفين",
"view_your_leave_information": "عرض معلومات إجازتك",
"view_details": "عرض التفاصيل",
"hierarchy": "تَسَلسُل"
"youCanPlayDemo": "لكن يمكنك لعب العرض"
}

@ -25,7 +25,6 @@
"checkIn": "Check In",
"workList": "Work List",
"leaveBalance": "Leave Balance",
"businessTripBalance": "Business Trip Balance",
"missingSwipes": "Missing Swipes",
"ticketBalance": "Ticket Balance",
"other": "Other",
@ -303,7 +302,6 @@
"topic": "Topic",
"actionBy": "Action By",
"pendingTransactions": "Pending Transactions",
"notices": "Notices",
"selectRequestType": "Please select request type",
"dateFrom": "Date From",
"dateTo": "Date To",
@ -426,7 +424,7 @@
"typeCurrentPasswordBelow": "Type Your Current password below",
"currentPassword": "Current password",
"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",
"SelectChangeWantToMake": "Select the type of change you want to make",
"profile": {
@ -471,7 +469,7 @@
"gameTime": "Game Time:",
"joinMarathon": "Join Marathon",
"joinDemoMarathon": "Join Demo Marathon",
"demo": "Demo",
"demo":"Demo",
"minutes": "Minutes",
"seconds": "Seconds",
"note": "Note:",
@ -519,27 +517,12 @@
"startingIn": "Starting in",
"youAreOutOfContest": "You are out of the contest.",
"winners": "WINNERS!!!",
"expireAfter": "Expires After",
"oneWeek": "1 Week",
"twoWeek": "2 Week",
"expireAfter":"Expires After",
"oneWeek":"1 Week",
"twoWeek":"2 Week",
"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.",
"noWinner": "Sad! No one won today.",
"myTeam": "My Team",
"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"
"myTeam" : "My Team",
"youCanPlayDemo": "But you can play demo"
}

@ -1,7 +1,6 @@
import UIKit
import Flutter
import Firebase
import flutter_local_notifications
@UIApplicationMain
@ -10,13 +9,7 @@ import flutter_local_notifications
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
FirebaseApp.configure()
FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in
GeneratedPluginRegistrant.register(with: registry)
}
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
}
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
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">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsForMedia</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
@ -42,7 +33,7 @@
<key>NFCReaderUsageDescription</key>
<string>This App requires access to NFC to mark your attendance.</string>
<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>
<string>This app requires Face ID to allow biometric authentication for app login.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
@ -55,13 +46,15 @@
<string>This app requires photo library access to select image as document &amp; upload it.</string>
<key>NSMicrophoneUsageDescription</key>
<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>
<array>
<string>fetch</string>
<string>fetch</string>
<string>remote-notification</string>
</array>
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
<false/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
@ -87,9 +80,14 @@
</array>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>TAG</string>
</array>
<key>com.apple.developer.nfc.readersession.felica.systemcodes</key>
<array>
<string>0000</string>
</array>
</dict>
</plist>

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

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

@ -1,13 +1,14 @@
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/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/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_time_card_summary_list_model.dart';
import 'package:mohem_flutter_app/api/api_client.dart';
class MonthlyAttendanceApiClient {
static final MonthlyAttendanceApiClient _instance = MonthlyAttendanceApiClient._internal();
@ -51,24 +52,6 @@ class MonthlyAttendanceApiClient {
}, 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 {
String url = "${ApiConsts.erpRest}GET_SCHEDULE_SHIFTS_DETAILS";
@ -83,4 +66,5 @@ class MonthlyAttendanceApiClient {
return (responseData.getScheduleShiftsDetailsList?.length ?? 0) > 0 ? responseData.getScheduleShiftsDetailsList!.first : null;
}, url, postParams);
}
}

@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:convert';
import 'package:mohem_flutter_app/api/api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
@ -75,14 +74,6 @@ class MyAttendanceApiClient {
};
postParams.addAll(AppState().postParamsJson);
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) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return ESERVICESDV.fromJson(responseData.getDefaultValueList!.toJson());

@ -16,9 +16,9 @@ class MyRequestsApiClient {
factory MyRequestsApiClient() => _instance;
Future<List<GetConcurrentProgramsModel>> getConcurrentPrograms(int id) async {
Future<List<GetConcurrentProgramsModel>> getConcurrentPrograms() async {
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);
return await ApiClient().postJsonForObject((json) {
@ -60,28 +60,30 @@ class MyRequestsApiClient {
}, 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";
Map<String, dynamic> postParams = {
"P_MENU_TYPE": "E",
"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["EITTransactionTBL"] = list;
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData;
return responseData.submitCcpTransactionList;
}, 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";
Map<String, dynamic> postParams = {
"P_MENU_TYPE": "E",
"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);
@ -91,4 +93,5 @@ class MyRequestsApiClient {
return responseData.getCCPTransactionsModel ?? [];
}, 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_contacts.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/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_details_list.dart';
import 'package:mohem_flutter_app/models/profile/get_countries_list_model.dart';
@ -60,19 +58,6 @@ class ProfileApiClient {
}, 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 {
String url = "${ApiConsts.erpRest}GET_EMPLOYEE_PHONES";
Map<String, dynamic> postParams = {
@ -418,19 +403,4 @@ class ProfileApiClient {
return responseData.getPerformanceAppraisalList ?? [];
}, 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);
}
Future<MemberInformationListModel> getUserInformation(int pSelectedResopID, String selectedEmployeeNumber, String noficationId) async {
String url = "${ApiConsts.erpRest}Get_Notification_UserInformation";
Future<MemberInformationListModel> getUserInformation(int pSelectedResopID, String selectedEmployeeNumber) async {
String url = "${ApiConsts.erpRest}Get_UserInformation";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": pSelectedResopID,
"P_PAGE_LIMIT": 100,
"P_PAGE_NUM": 1,
"P_NOTIFICATION_ID": noficationId,
};
postParams.addAll(AppState().postParamsJson);
if (selectedEmployeeNumber != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = selectedEmployeeNumber;
@ -414,7 +413,7 @@ class WorkListApiClient {
"EmployeeNumber": employeeNumber,
"Comments": "",
"AdditionalFields": null,
"NewUserEMPId": newUserEMPId
"NewUserEMPId":newUserEMPId
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {

@ -1,6 +1,7 @@
import 'dart:io';
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/itg_forms_models/request_detail_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/worklist_response_model.dart';
class AppState {
static final AppState _instance = AppState._internal();
@ -79,19 +77,7 @@ class AppState {
bool get getIsDemoMarathon => _isDemoMarathon;
bool _isHuawei = false;
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");
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 3.9, mobileType: Platform.isAndroid ? "android" : "ios");
void setPostParamsInitConfig() {
isAuthenticated = false;
@ -194,4 +180,5 @@ class AppState {
}
bool cancelRequestTrancsection = true;
}

@ -6,8 +6,8 @@ class MyColors {
static const Color darkTextColor = Color(0xff2B353E);
static const Color normalTextColor = Color(0xff5A5A5A);
static const Color lightTextColor = Color(0xffBFBFBF);
static const Color gradiantStartColor = Color(0xff259db7);
static const Color gradiantEndColor = Color(0xff33c0a5);
static const Color gradiantStartColor = Color(0xff33c0a5);
static const Color gradiantEndColor = Color(0xff259db7);
static const Color textMixColor = Color(0xff2BB8A6);
static const Color backgroundColor = Color(0xffF8F8F8);
static const Color grey41Color = Color(0xff414141);
@ -30,7 +30,7 @@ class MyColors {
static const Color darkWhiteColor = Color(0xffE0E0E0);
static const Color redColor = Color(0xffD02127);
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 orange = Color(0xFFCC9B14);
static const Color yellowFavColor = Color(0xffEAC321);
@ -41,7 +41,6 @@ class MyColors {
static const Color borderColor = Color(0xffE8E8E8);
static const Color borderE3Color = Color(0xffE3E3E3);
static const Color borderCEColor = Color(0xffCECECE);
//static const Color grey67Color = Color(0xff676767);
static const Color whiteColor = Color(0xFFEEEEEE);
static const Color greenColor = Color(0xff1FA269);
@ -56,7 +55,7 @@ class MyColors {
static const Color lightGreyColor = Color(0xffC7C7C7);
static const Color green69Color = Color(0xff1FA169);
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 greyC4Color = Color(0xffC4C4C4);
static const Color grey35Color = Color(0xff535353);

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

@ -60,13 +60,13 @@ class DateUtil {
}
}
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;
}
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) {
@ -123,7 +123,7 @@ class DateUtil {
}
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) {
@ -419,7 +419,7 @@ class DateUtil {
/// [dateTime] convert DateTime to data formatted
static String getDayMonthDateFormatted(DateTime dateTime) {
if (dateTime != null)
return DateFormat('dd/MM', "en_US").format(dateTime);
return DateFormat('dd/MM').format(dateTime);
else
return "";
}
@ -466,7 +466,7 @@ class DateUtil {
/// [dateTime] convert DateTime to data formatted
static String getDayMonthYearHourMinuteDateFormatted(DateTime dateTime) {
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
return "";
}
@ -491,11 +491,11 @@ class DateUtil {
}
static String getFormattedDate(DateTime dateTime, String formattedString) {
return DateFormat(formattedString, "en_US").format(dateTime);
return DateFormat(formattedString).format(dateTime);
}
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) {

@ -1,155 +1,13 @@
// import 'dart:io';
//
// 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:convert';
import 'dart:io';
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:mohem_flutter_app/main.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:firebase_core/firebase_core.dart';
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
@ -160,10 +18,6 @@ class AppNotifications {
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);
@ -181,10 +35,6 @@ class AppNotifications {
}
void init(String? firebaseToken) async {
// if (Platform.isAndroid) {
// hmsApiAvailability = HmsApiAvailability();
// }
await requestPermissions();
AppState().setDeviceToken = firebaseToken;
await Permission.notification.isDenied.then((bool value) {
@ -207,59 +57,15 @@ class AppNotifications {
FirebaseMessaging.instance.onTokenRefresh.listen((String 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) {
Utils.saveStringFromPrefs("isAppOpendByChat", "false");
Utils.saveStringFromPrefs("isAppOpendByChat", "true");
}
void _handleOpenApp(RemoteMessage message) {
if (message.data.isNotEmpty && message.data["type"] == 'chat') {
Utils.saveStringFromPrefs("isAppOpendByChat", "true");
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
}
Utils.saveStringFromPrefs("isAppOpendByChat", "true");
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
}
}
@ -271,9 +77,7 @@ AndroidNotificationChannel channel = const AndroidNotificationChannel(
Future<dynamic> backgroundMessageHandler(RemoteMessage message) async {
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());
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_svg/flutter_svg.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/classes/colors.dart';
import 'package:mohem_flutter_app/config/routes.dart';
@ -99,8 +98,7 @@ class Utils {
static void handleException(dynamic exception, cxt, Function(String)? onErrorMessage) {
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);
} else {
if (exception is APIException) {
@ -117,14 +115,12 @@ class Utils {
} else {
if (!AppState().isAuthenticated) {
showDialog(
barrierDismissible: false,
context: cxt,
builder: (cxt) => ConfirmDialog(
message: errorMessage,
onTap: () {
Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route<dynamic> route) => false);
},
onCloseTap: () {},
),
);
} else {
@ -268,7 +264,7 @@ class Utils {
static String getMonthNamedFormat(DateTime date) {
/// 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) {
@ -337,17 +333,10 @@ class Utils {
}
return date;
} else {
if(date.toLowerCase().split("-").length == 1 && date.contains("/")) {
return reverseFormatDate(date);
}
else
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 {
if(date.contains(" ")) {
date = date.split(" ").first;
}
return DateFormat('dd-MM-yyyy', "en_US").format(DateFormat('yyyy-MM-dd', "en_US").parseLoose(date));
return DateFormat('dd-MM-yyyy').format(DateFormat('yyyy-MM-dd').parseLoose(date));
}
// return DateFormat('yyyy-MM-dd').format(DateFormat('dd-MM-yyyy').parseLoose(date));
}
@ -399,15 +388,4 @@ class Utils {
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: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/moe_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/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_basic_details_screen.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/profile_screen.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 appUpdateScreen = "/appUpdateScreen";
static const String help = "/help";
static const String hierarchy = "/hierarchy";
static final Map<String, WidgetBuilder> routes = {
login: (BuildContext context) => LoginScreen(),
@ -231,8 +226,7 @@ class AppRoutes {
// addWorkFromHome: (BuildContext context) => AddWorkFromHomeScreen(),
profile: (BuildContext context) => ProfileScreen(),
//Attendance
// monthlyAttendance: (BuildContext context) => MonthlyAttendanceScreen(),
monthlyAttendance: (BuildContext context) => MoeMonthlyAttendanceScreen(),
monthlyAttendance: (BuildContext context) => MonthlyAttendanceScreen(),
vacationRule: (BuildContext context) => VacationRuleScreen(),
addVacationRule: (BuildContext context) => AddVacationRuleScreen(),
@ -309,7 +303,5 @@ class AppRoutes {
unsafeDeviceScreen: (BuildContext context) => const UnsafeDeviceScreen(),
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/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/otp_widget.dart';
import 'package:sizer/sizer.dart';
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(
this,
maxLines: maxlines,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: color ?? MyColors.darkTextColor,
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),
);
Widget toText24({Color? color, bool isBold = false, bool isCentered = false}) => Text(
Widget toText24({Color? color, bool isBold = false}) => Text(
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),
);
Widget toText30({Color? color, bool isBold = false, bool isCentered = false}) => Text(
Widget toText30({Color? color, bool isBold = false}) => Text(
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),
);
@ -222,7 +219,7 @@ extension EmailValidator on String {
String date = this.split("T")[0];
String time = this.split("T")[1];
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) {

@ -41,7 +41,6 @@ class CodegenLoader extends AssetLoader{
"checkIn": "تحقق في",
"workList": "قائمة العمل",
"leaveBalance": "رصيد الاجازات",
"businessTripBalance": "رصيد رحلة العمل",
"missingSwipes": "تسجيل بصمة حضور",
"ticketBalance": "رصيد التذكرة",
"other": "آخر",
@ -534,29 +533,11 @@ class CodegenLoader extends AssetLoader{
"startingIn": "يبدأ في",
"youAreOutOfContest": "أنت خارج المسابقة.",
"winners": "الفائزين!!!",
"expireAfter": "تنتهي بعد",
"oneWeek": "أسبوع 1",
"twoWeek": "2 أسبوع",
"noUpcoming": "لا يوجد قادم",
"fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية",
"noWinner": "حزين! لم يفز أحد اليوم.",
"myTeam": "فريقي",
"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": "طلب مهمة العمل"
"youCanPlayDemo": "لكن يمكنك لعب العرض"
};
static const Map<String,dynamic> en_US = {
"mohemm": "Mohemm",
@ -585,7 +566,6 @@ static const Map<String,dynamic> en_US = {
"checkIn": "Check In",
"workList": "Work List",
"leaveBalance": "Leave Balance",
"businessTripBalance": "Business Trip Balance",
"missingSwipes": "Missing Swipes",
"ticketBalance": "Ticket Balance",
"other": "Other",
@ -1078,29 +1058,11 @@ static const Map<String,dynamic> en_US = {
"startingIn": "Starting in",
"youAreOutOfContest": "You are out of the contest.",
"winners": "WINNERS!!!",
"expireAfter": "Expires After",
"oneWeek": "1 Week",
"twoWeek": "2 Week",
"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.",
"noWinner": "Sad! No one won today.",
"myTeam": "My Team",
"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"
"youCanPlayDemo": "But you can play demo"
};
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
abstract class LocaleKeys {
abstract class LocaleKeys {
static const mohemm = 'mohemm';
static const english = 'english';
static const arabic = 'arabic';
@ -27,7 +27,6 @@ abstract class LocaleKeys {
static const checkIn = 'checkIn';
static const workList = 'workList';
static const leaveBalance = 'leaveBalance';
static const businessTripBalance = 'businessTripBalance';
static const missingSwipes = 'missingSwipes';
static const ticketBalance = 'ticketBalance';
static const services = 'services';
@ -251,7 +250,7 @@ abstract class LocaleKeys {
static const Payroll = 'Payroll';
static const civilIdentityNumber = 'civilIdentityNumber';
static const dateOfBirth = 'dateOfBirth';
static const maritalStatus = 'maritalStatus ';
static const maritalStatus = 'maritalStatus ';
static const fullName = 'fullName';
static const remove = 'remove';
static const submit = 'submit';
@ -281,7 +280,7 @@ abstract class LocaleKeys {
static const enterNewInfo = 'enterNewInfo';
static const endDate = 'endDate';
static const removeThisMember = 'removeThisMember';
static const wantUpdateThisMember = 'wantUpdateThisMember ';
static const wantUpdateThisMember = 'wantUpdateThisMember ';
static const addNewFamilyMember = 'addNewFamilyMember';
static const addRow = 'addRow';
static const pleaseSelect = 'pleaseSelect';
@ -504,30 +503,12 @@ abstract class LocaleKeys {
static const startingIn = 'startingIn';
static const youAreOutOfContest = 'youAreOutOfContest';
static const winners = 'winners';
static const noUpcoming = 'noUpcoming';
static const fakeLocation = 'fakeLocation';
static const expireAfter = 'expireAfter';
static const oneWeek = 'oneWeek';
static const twoWeek = 'twoWeek';
static const noUpcoming = 'noUpcoming';
static const fakeLocation = 'fakeLocation';
static const noWinner = 'noWinner';
static const myTeam = 'myTeam';
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:mohem_flutter_app/app_state/app_state.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/generated/codegen_loader.g.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/dashboard_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';
Logger logger = Logger(
// filter: null, // Use the default LogFilter (-> only log in debug mode)
printer: PrettyPrinter(
lineLength: 0,
),
), // Use the PrettyPrinter to format and print log
// output: null, // U
);
class MyHttpOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext? context) {
@ -63,17 +64,12 @@ Future<void> main() async {
ChangeNotifierProvider<EITProviderModel>(
create: (_) => EITProviderModel(),
),
if (env.chat)
ChangeNotifierProvider<ChatProviderModel>(
create: (_) => ChatProviderModel(),
),
if (env.marathon)
ChangeNotifierProvider<MarathonProvider>(
create: (_) => MarathonProvider(),
),
// ChangeNotifierProvider<ChatCallProvider>(
// create: (_) => ChatCallProvider(),
// ),
ChangeNotifierProvider<ChatProviderModel>(
create: (_) => ChatProviderModel(),
),
ChangeNotifierProvider<MarathonProvider>(
create: (_) => MarathonProvider(),
)
],
child: const MyApp(),
),
@ -265,3 +261,4 @@ class MyApp extends StatelessWidget {
// });
// }
// }

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

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

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

@ -1,6 +1,6 @@
class GetMobileLoginInfoListModel {
int? iD;
String? employeeID;
int? employeeID;
int? channelID;
int? companyID;
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 = [];
Material.TextDirection textDirection = Material.TextDirection.ltr;
bool isRTL = false;
String msgText = "";
//Chat Home Page Counter
int chatUConvCounter = 0;
@ -79,8 +77,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
List<ChatUser>? chatUsersList = [];
int pageNo = 1;
bool disbaleChatForThisUser = false;
Future<void> getUserAutoLoginToken() async {
userLoginToken.UserAutoLoginModel userLoginResponse = await ChatApiClient().getUserLoginToken();
if (userLoginResponse.response != null) {
@ -90,8 +86,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
Utils.showToast(
userLoginResponse.errorResponses!.first.fieldName.toString() + " Erorr",
);
disbaleChatForThisUser = true;
notifyListeners();
}
}
@ -123,7 +117,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
// chatHubConnection.on("OnUpdateUserChatHistoryWindowsAsync", updateChatHistoryWindow);
chatHubConnection.on("OnGetUserChatHistoryNotDeliveredAsync", chatNotDelivered);
chatHubConnection.on("OnUpdateUserChatHistoryStatusAsync", updateUserChatStatus);
if (kDebugMode) {
logger.i("All listeners registered");
}
@ -919,7 +912,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
}
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);
return f.format(data);
}
@ -1014,25 +1007,23 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
}
void disposeData() {
if (!disbaleChatForThisUser) {
search.clear();
isChatScreenActive = false;
receiverID = 0;
paginationVal = 0;
message.text = '';
isTextMsg = false;
isAttachmentMsg = false;
isVoiceMsg = false;
isReplyMsg = false;
repliedMsg = [];
sFileType = "";
deleteData();
favUsersList.clear();
searchedChats?.clear();
pChatHistory?.clear();
chatHubConnection.stop();
AppState().chatDetails = null;
}
search.clear();
isChatScreenActive = false;
receiverID = 0;
paginationVal = 0;
message.text = '';
isTextMsg = false;
isAttachmentMsg = false;
isVoiceMsg = false;
isReplyMsg = false;
repliedMsg = [];
sFileType = "";
deleteData();
favUsersList.clear();
searchedChats?.clear();
pChatHistory?.clear();
chatHubConnection.stop();
AppState().chatDetails = null;
}
void deleteData() {
@ -1416,16 +1407,17 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void inputBoxDirection(String val) {
if (val.isNotEmpty) {
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 {
isTextMsg = false;
}
msgText = val;
notifyListeners();
}
void onDirectionChange(bool val) {
isRTL = val;
notifyListeners();
}
Material.TextDirection getTextDirection(String v) {
@ -1459,19 +1451,19 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
}
void openChatByNoti(BuildContext context) async {
SingleUserChatModel nUser = SingleUserChatModel();
SingleUserChatModel nUser = SingleUserChatModel.fromJson(
jsonDecode(await Utils.getStringFromPrefs("notificationData")),
);
Utils.saveStringFromPrefs("isAppOpendByChat", "false");
if (await Utils.getStringFromPrefs("notificationData") != "null") {
nUser = SingleUserChatModel.fromJson(jsonDecode(await Utils.getStringFromPrefs("notificationData")));
Utils.saveStringFromPrefs("notificationData", "null");
Future.delayed(const Duration(seconds: 2));
for (ChatUser user in searchedChats!) {
if (user.id == nUser.targetUserId) {
Navigator.pushNamed(context, AppRoutes.chatDetailed, arguments: ChatDetailedScreenParams(user, false));
return;
}
Utils.saveStringFromPrefs("notificationData", "null");
Future.delayed(const Duration(seconds: 1));
for (ChatUser user in searchedChats!) {
if (user.id == nUser.targetUserId) {
Navigator.pushNamed(context, AppRoutes.chatDetailed, arguments: ChatDetailedScreenParams(user, false));
return;
} else {
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/app_state/app_state.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/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/main.dart';
@ -41,23 +40,12 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
bool isMissingSwipeLoading = true;
int missingSwipeCounter = 0;
bool isMyRequestLoading = true;
ListMenu? myRequest;
//Leave and Ticket Balance
bool isLeaveTicketBalanceLoading = true;
List<GetAccrualBalancesList>? accrualList;
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;
//Menu Entries
@ -98,19 +86,12 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
isWorkListLoading = true;
workListCounter = 0;
isMyRequestLoading = true;
myRequest = null;
isMissingSwipeLoading = true;
missingSwipeCounter = 0;
isWorkListLoading = true;
isLeaveTicketBalanceLoading = true;
accrualList = null;
leaveBalanceAccrual = null;
oldLeaveBalanceAccrual = null;
businessTripAccrual = null;
ticketBalance = 0;
isServicesMenusLoading = true;
@ -120,13 +101,12 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
getOffersList = [];
drawerMenuItemList = [
DrawerMenuItem("assets/images/drawer/profile_icon.png", LocaleKeys.myProfile.tr(), AppRoutes.profile),
// 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/notices.png", LocaleKeys.notices.tr(), AppRoutes.pendingTransactions),
// // 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/my_profile.svg", LocaleKeys.myProfile.tr(), AppRoutes.profile),
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/pending_trasactions.svg", LocaleKeys.pendingTransactions.tr(), AppRoutes.pendingTransactions),
// DrawerMenuItem("assets/images/drawer/drawer_marathon.svg", LocaleKeys.brainMarathon.tr(), AppRoutes.marathonIntroScreen),
DrawerMenuItem("assets/images/drawer/change_password.svg", LocaleKeys.changePassword.tr(), AppRoutes.changePassword),
];
notifyListeners();
@ -158,17 +138,15 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
getOpenNotificationsList = genericResponseModel?.getOpenNotificationsList;
workListCounter = genericResponseModel?.pOPENNTFNUMBER ?? 0;
if (env.itg) itgFormsModel = await DashboardApiClient().getItgFormsPendingTask();
itgFormsModel = await DashboardApiClient().getItgFormsPendingTask();
workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0);
if (env.itg) {
GenericResponseModel? cocGenericResponseModel = await DashboardApiClient().getCOCNotifications();
cocCount = cocGenericResponseModel?.mohemmITGPendingTaskResponseItem;
if (cocCount != null) {
cocFinalCount = (cocCount?.escalation ?? 0) + (cocCount?.waitingToClose ?? 0) + (cocCount?.waitingForAcceptance ?? 0) + (cocCount?.extendTATRequest ?? 0);
workListCounter += cocFinalCount;
}
GenericResponseModel? cocGenericResponseModel = await DashboardApiClient().getCOCNotifications();
cocCount = cocGenericResponseModel?.mohemmITGPendingTaskResponseItem;
if (cocCount != null) {
cocFinalCount = (cocCount?.escalation ?? 0) + (cocCount?.waitingToClose ?? 0) + (cocCount?.waitingForAcceptance ?? 0) + (cocCount?.extendTATRequest ?? 0);
workListCounter += cocFinalCount;
}
if (showLoading) Utils.hideLoading(context);
notifyListeners();
} catch (ex) {
@ -209,13 +187,10 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
//Leave and Ticket Balance API's & Methods
Future fetchLeaveTicketBalance(context, DateTime date) async {
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;
leaveBalanceAccrual = accrualList!.singleWhere((element) => element.accuralPlanName == 'Annual Vacation Accrual' || element.accuralPlanName == "خطة استحقاق الاجازة الاعتيادية", orElse: null);
oldLeaveBalanceAccrual = accrualList!.singleWhere((element) => element.accuralPlanName == 'Old Leave Balance' || element.accuralPlanName == "خطة فصل الارصدة 1439", orElse: null);
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);
leaveBalanceAccrual = accrualList![0];
ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + (accrualList![2].accrualNetEntitlement ?? 0.0);
notifyListeners();
} catch (ex) {
isLeaveTicketBalanceLoading = false;
@ -232,19 +207,17 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void fetchListMenu() async {
try {
List<ListMenu> menuList = await DashboardApiClient().getListMenu();
for (var menu in menuList) {
if (menu.menuType == "E") {
myRequest = menu;
} else if (menu.menuType == "M") {
AppState().setempStatusIsManager = true;
drawerMenuItemList.add(DrawerMenuItem("assets/images/drawer/my_team_icon.png", LocaleKeys.myTeamMembers.tr(), AppRoutes.myTeam));
}
List findMyRequest = menuList.where((element) => element.menuType == "E").toList();
if (findMyRequest.isNotEmpty) {
drawerMenuItemList.insert(3, DrawerMenuItem("assets/images/drawer/my_requests.svg", LocaleKeys.myRequest.tr(), AppRoutes.myRequests));
}
List findMyTeam = menuList.where((element) => element.menuType == "M").toList();
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) {
logger.wtf(ex);
notifyListeners();
Utils.handleException(ex, null, null);
}
}
@ -255,14 +228,9 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
GenericResponseModel? genericResponseModel = await DashboardApiClient().getGetMenuEntries();
getMenuEntriesList = genericResponseModel!.getMenuEntriesList;
homeMenus = parseMenus(getMenuEntriesList ?? []);
if (homeMenus!.isNotEmpty) {
if (env.dashboard.monthlyAttendance) {
homeMenus!.first.menuEntiesList.insert(0, GetMenuEntriesList(requestType: "MONTHLY_ATTENDANCE", prompt: LocaleKeys.monthlyAttendance.tr()));
}
if (env.dashboard.vocationRules) {
homeMenus!.first.menuEntiesList.add(GetMenuEntriesList(requestType: "VACATION_RULE", prompt: LocaleKeys.vacationRule.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()));
}
isServicesMenusLoading = false;
notifyListeners();
@ -300,7 +268,6 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
MohemmItgResponseItem? res = await DashboardApiClient().getITGPageNotification();
return res;
}
void notify() {
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,
builder: (_, controller) {
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(
children: [
Container(

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

@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:convert';
import 'package:audio_waveforms/audio_waveforms.dart';
import 'package:easy_localization/easy_localization.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/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_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/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/chat_bubble.dart';
import 'package:mohem_flutter_app/ui/chat/common.dart';
@ -45,10 +41,8 @@ class ChatDetailScreen extends StatefulWidget {
class _ChatDetailScreenState extends State<ChatDetailScreen> {
final RefreshController _rc = RefreshController(initialRefresh: false);
late ChatProviderModel data;
late ChatCallProvider callPro;
ChatDetailedScreenParams? params;
// var textDirection = TextDirection.RTL;
var textDirection = TextDirection.RTL;
void getMoreChat() async {
if (params != null) {
@ -78,7 +72,6 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
Widget build(BuildContext context) {
params = ModalRoute.of(context)!.settings.arguments as ChatDetailedScreenParams;
data = Provider.of<ChatProviderModel>(context, listen: false);
// callPro = Provider.of<ChatCallProvider>(context, listen: false);
if (params != null) {
data.getSingleUserChatHistory(
senderUID: AppState().chatDetails!.response!.id!.toInt(),
@ -99,11 +92,11 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
chatUser: params!.chatUser,
actions: [
// SvgPicture.asset("assets/icons/chat/call.svg", width: 21, height: 23).onPress(() {
// makeCall(callType: "AUDIO");
// // makeCall(callType: "AUDIO", con: hubConnection);
// }),
// 24.width,
// SvgPicture.asset("assets/icons/chat/video_call.svg", width: 21, height: 18).onPress(() {
// makeCall(callType: "VIDEO");
// // makeCall(callType: "VIDEO", con: hubConnection);
// }),
// 21.width,
],
@ -259,39 +252,37 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
if (!m.isRecoding)
Row(
children: [
CustomAutoDirection(
onDirectionChange: (bool isRTL) => m.onDirectionChange(isRTL),
text: m.msgText,
child: TextField(
// textDirection: m.textDirection,
controller: m.message,
decoration: InputDecoration(
hintTextDirection: m.textDirection,
hintText: m.isAttachmentMsg ? m.selectedFile.path.split("/").last : LocaleKeys.typeheretoreply.tr(),
hintStyle: TextStyle(color: m.isAttachmentMsg ? MyColors.darkTextColor : MyColors.grey98Color, fontSize: 14),
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
filled: true,
fillColor: MyColors.white,
contentPadding: const EdgeInsets.only(
left: 21,
top: 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,
TextField(
textDirection: m.textDirection,
controller: m.message,
decoration: InputDecoration(
hintTextDirection: m.textDirection,
hintText: m.isAttachmentMsg
? m.selectedFile.path.split("/").last
: m.textDirection.name == "rtl" ? "اكتب هنا للرد" :LocaleKeys.typeheretoreply.tr(),
hintStyle: TextStyle(color: m.isAttachmentMsg ? MyColors.darkTextColor : MyColors.grey98Color, fontSize: 14),
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
filled: true,
fillColor: MyColors.white,
contentPadding: const EdgeInsets.only(
left: 21,
top: 20,
bottom: 20,
),
onChanged: (String val) {
m.inputBoxDirection(val);
m.userTypingInvoke(currentUser: AppState().chatDetails!.response!.id!, reciptUser: params!.chatUser!.id!);
},
).expanded,
),
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) {
m.inputBoxDirection(val);
m.userTypingInvoke(currentUser: AppState().chatDetails!.response!.id!, reciptUser: params!.chatUser!.id!);
},
).expanded,
if (m.sFileType.isNotEmpty)
Row(
children: <Widget>[
@ -351,30 +342,45 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
}
}
void makeCall({required String callType}) async {
callPro.initCallListeners();
void makeCall({required String callType, required HubConnection con}) async {
print("================== Make call Triggered ============================");
Map<String, dynamic> json = {
"callerID": AppState().chatDetails!.response!.id!.toString(),
"callerDetails": AppState().chatDetails!.toJson(),
"receiverID": params!.chatUser!.id.toString(),
"receiverDetails": params!.chatUser!.toJson(),
"title": params!.chatUser!.userName!.replaceAll(".", " "),
"calltype": callType == "VIDEO" ? "Video" : "Audio",
"callReceiverID": params!.chatUser!.id.toString(),
"notification_foreground": "true",
"message": "Aamir is calling",
"title": "Video Call",
"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);
await Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => OutGoingCall(
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) {
data.isLoading = true;
data.getUserRecentChats().whenComplete(() async {
// String isAppOpendByChat = await Utils.getStringFromPrefs("isAppOpendByChat");
// String notificationData = await Utils.getStringFromPrefs("notificationData");
// if (isAppOpendByChat != "null" || isAppOpendByChat == "true" && notificationData != "null") {
// data.openChatByNoti(context);
// }
String isAppOpendByChat = await Utils.getStringFromPrefs("isAppOpendByChat");
String notificationData = await Utils.getStringFromPrefs("notificationData");
if (isAppOpendByChat != "null" || isAppOpendByChat == "true" && notificationData != "null") {
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/generated/locale_keys.g.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/main.dart';
class EmployeeDigitialIdDialog extends StatelessWidget {
@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/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/main.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';
@ -60,13 +60,9 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
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);
_bHubCon();
}
marathonProvider = Provider.of<MarathonProvider>(context, listen: false);
cProvider = Provider.of<ChatProviderModel>(context, listen: false);
_bHubCon();
_onRefresh(true);
});
}
@ -80,8 +76,11 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
void checkSession() async {
try {
await DashboardApiClient().getOpenNotifications();
Utils.showLoading(context);
await DashboardApiClient().getOpenMissingSwipes();
Utils.hideLoading(context);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
@ -90,28 +89,24 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
void dispose() {
WidgetsBinding.instance.removeObserver(this);
super.dispose();
if (!cProvider.disbaleChatForThisUser) {
chatHubConnection.stop();
}
chatHubConnection.stop();
}
void _bHubCon() {
cProvider.getUserAutoLoginToken().whenComplete(() async {
if (!cProvider.disbaleChatForThisUser) {
String isAppOpendByChat = await Utils.getStringFromPrefs("isAppOpendByChat");
if (isAppOpendByChat != null && isAppOpendByChat == "true") {
Utils.showLoading(context);
cProvider.buildHubConnection();
Future.delayed(const Duration(seconds: 2), () async {
cProvider.invokeChatCounter(userId: AppState().chatDetails!.response!.id!);
gotoChat(context);
});
} else {
cProvider.buildHubConnection();
Future.delayed(const Duration(seconds: 2), () {
cProvider.invokeChatCounter(userId: AppState().chatDetails!.response!.id!);
});
}
String isAppOpendByChat = await Utils.getStringFromPrefs("isAppOpendByChat");
if (isAppOpendByChat != null && isAppOpendByChat == "true") {
Utils.showLoading(context);
cProvider.buildHubConnection();
Future.delayed(const Duration(seconds: 2), () async {
cProvider.invokeChatCounter(userId: AppState().chatDetails!.response!.id!);
gotoChat(context);
});
} else {
cProvider.buildHubConnection();
Future.delayed(const Duration(seconds: 2), () {
cProvider.invokeChatCounter(userId: AppState().chatDetails!.response!.id!);
});
}
});
}
@ -140,25 +135,14 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
// print(value.result!.data!.notificationTitle);
// });
data.fetchListMenu();
if (env.dashboard.attendance) {
data.fetchAttendanceTracking(context);
}
data.fetchAttendanceTracking(context);
data.fetchWorkListCounter(context);
if (env.dashboard.missingSwipe) {
data.fetchMissingSwipe(context);
}
data.fetchMissingSwipe(context);
data.fetchLeaveTicketBalance(context, DateTime.now());
data.fetchMenuEntries();
if (env.offersDiscount) {
data.getCategoryOffersListAPI(context);
}
if (env.marathon) {
marathonProvider.getMarathonDetailsFromApi();
}
if (env.chat) {
marathonProvider.getMarathonDetailsFromApi();
if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon();
}
data.getCategoryOffersListAPI(context);
marathonProvider.getMarathonDetailsFromApi();
if (!isFromInit) checkHubCon();
_refreshController.refreshCompleted();
}
@ -209,11 +193,10 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
body: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Builder(builder: (BuildContext context) {
return Row(
// mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min,
children: [
Image.memory(
Utils.dataFromBase64String(
@ -230,6 +213,11 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
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"),
],
@ -237,14 +225,13 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
_scaffoldState.currentState!.openDrawer();
});
}),
Image.asset("assets/images/drawer/moe_logo_full.png", width: 130, height: 45),
SizedBox(width: 65),
// SvgPicture.asset(
// "assets/images/announcements.svg",
// matchTextDirection: true,
// ).onPress(() async {
// await Navigator.pushNamed(context, AppRoutes.announcements);
// })
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(
@ -269,119 +256,118 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
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(
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: [
Expanded(
child: Column(
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: [
LocaleKeys.checkIn.tr().toText12(color: Colors.white),
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn)
.toString()
.toText14(color: Colors.white, isBold: true),
4.height,
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(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();
},
),
).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,
),
9.width,
Expanded(
child: MenusWidget(),
),
@ -389,150 +375,102 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
),
],
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
if (env.monthlyAttendance)
InkWell(
child: Container(
width: double.infinity,
padding: EdgeInsets.all(12),
margin: EdgeInsets.symmetric(horizontal: 21),
decoration: const BoxDecoration(
color: MyColors.gradiantStartColor,
borderRadius: BorderRadius.all(Radius.circular(12)),
),
child: Row(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.employee_leaves_calender.tr().toText18(isBold: true, color: Colors.white),
2.height,
LocaleKeys.view_your_leave_information.tr().toText12(color: Colors.white),
8.height,
Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.4),
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)),
],
),
],
),
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(
color: Colors.white,
borderRadius: const BorderRadius.all(
Radius.circular(100),
),
border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
),
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(
color: Colors.white,
borderRadius: const BorderRadius.all(
Radius.circular(100),
),
child: ClipRRect(
borderRadius: const BorderRadius.all(
Radius.circular(50),
),
child: Hero(
tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!,
transitionOnUserGestures: true,
child: Image.network(
data.getOffersList[index].logo!,
fit: BoxFit.contain,
),
border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
),
child: ClipRRect(
borderRadius: const BorderRadius.all(
Radius.circular(50),
),
child: Hero(
tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!,
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].titleEn!.toText12(isCenter: true, maxLine: 1),
),
],
),
),
4.height,
Expanded(
child: AppState().isArabic(context)
? 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(
width: double.infinity,
@ -545,9 +483,8 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (env.marathon)
context.watch<MarathonProvider>().isLoading ? const MarathonBannerShimmer().paddingAll(20) : const MarathonBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 8),
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(
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.mowadhafhiRequest.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),
),
);
},
bottomNavigationBar: 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.mowadhafhiRequest.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
: cProvider.disbaleChatForThisUser
? MyColors.lightGreyE3Color
: 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: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.chatUConvCounter.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) {
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/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';
@ -30,14 +29,12 @@ class AppDrawer extends StatefulWidget {
class _AppDrawerState extends State<AppDrawer> {
List<DrawerMenuItem> drawerMenuItemList = [];
ChatProviderModel? chatData;
late ChatProviderModel chatData;
@override
void initState() {
super.initState();
if (env.chat) {
chatData = Provider.of<ChatProviderModel>(context, listen: false);
}
chatData = Provider.of<ChatProviderModel>(context, listen: false);
}
@override
@ -51,9 +48,9 @@ class _AppDrawerState extends State<AppDrawer> {
child: Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
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)),
],
).paddingOnly(left: 4, right: 14),
@ -120,37 +117,29 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.pushNamed(context, drawerMenuItemList[index].routeName);
});
}),
// menuItem("assets/images/drawer/employee_id.svg", LocaleKeys.employeeDigitalID.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: EmployeeDigitialIdDialog())),
// 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/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/employee_id.svg", LocaleKeys.employeeDigitalID.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: EmployeeDigitialIdDialog())),
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/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,);
],
).expanded,
// const Divider(
// height: 1,
// thickness: 1,
// color: MyColors.lightGreyEFColor,
// ),
const Divider(
height: 1,
thickness: 1,
color: MyColors.lightGreyEFColor,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
// RichText(
// text: TextSpan(text: LocaleKeys.poweredBy.tr() + " ", style: const TextStyle(color: MyColors.grey98Color, fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600), children: [
// TextSpan(
// text: LocaleKeys.cloudSolutions.tr(),
// style: const TextStyle(color: MyColors.grey3AColor, fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600),
// ),
// ]),
// ).expanded,
Image.asset("assets/images/drawer/moe_logo.png", width: 60, height: 60)
RichText(
text: TextSpan(text: LocaleKeys.poweredBy.tr() + " ", style: const TextStyle(color: MyColors.grey98Color, fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600), children: [
TextSpan(
text: LocaleKeys.cloudSolutions.tr(),
style: const TextStyle(color: MyColors.grey3AColor, fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600),
),
]),
).expanded,
Image.asset("assets/images/logos/bn_cloud_soloution.jpg", width: 40, height: 40)
],
).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}) {
return Row(
children: [
if (icon.contains("png")) Image.asset(icon, height: 20, width: 20),
if (icon.contains("svg")) SvgPicture.asset(icon, height: 20, width: 20),
SvgPicture.asset(icon, height: 20, width: 20),
9.width,
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().isLogged = false;
AppState().setPostParamsInitConfig();
chatData?.disposeData();
chatData.disposeData();
// SharedPreferences prefs = await SharedPreferences.getInstance();
// await prefs.clear();
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_svg/svg.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/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/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/screens/my_requests/new_request.dart';
import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
import 'package:provider/provider.dart';
@ -21,7 +19,7 @@ class MenusWidget extends StatelessWidget {
return Consumer<DashboardProviderModel>(
builder: (cxt, data, child) {
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,
shrinkWrap: true,
primary: false,
@ -54,52 +52,24 @@ class MenusWidget extends StatelessWidget {
).onPress(() {
Navigator.pushNamed(context, AppRoutes.workList);
}),
if (env.dashboard.missingSwipe)
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
data.isMissingSwipeLoading
? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context);
})
: Container(
decoration: BoxDecoration(
color: Color(namesColor[2]),
color: Color(namesColor[1]),
borderRadius: BorderRadius.circular(10),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.leaveBalance.tr().toText12(color: Colors.white),
LocaleKeys.missingSwipes.tr().toText12(color: Colors.white),
Row(
children: [
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)),
],
@ -107,7 +77,7 @@ class MenusWidget extends StatelessWidget {
],
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.leaveBalance);
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));
}),
data.isLeaveTicketBalanceLoading
? MenuShimmer().onPress(() {
@ -122,11 +92,11 @@ class MenusWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.businessTripBalance.tr().toText12(color: Colors.white),
LocaleKeys.leaveBalance.tr().toText12(color: Colors.white),
Row(
children: [
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)),
],
@ -134,44 +104,11 @@ class MenusWidget extends StatelessWidget {
],
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress(() {
//Navigator.pushNamed(context, AppRoutes.leaveBalance);
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.business_mission.tr(), "XXX_HR_EIT_BUSINESS_MISSION_SS"));
Navigator.pushNamed(context, AppRoutes.leaveBalance);
}),
if (env.dashboard.ticketBalance)
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
data.isLeaveTicketBalanceLoading
? MenuShimmer().onPress(() {
data.fetchListMenu();
data.fetchWorkListCounter(context);
})
: Container(
decoration: BoxDecoration(
@ -182,13 +119,12 @@ class MenusWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.myRequest.tr().toText12(color: Colors.white),
LocaleKeys.ticketBalance.tr().toText12(color: Colors.white),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
// Expanded(
// child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
// ),
Expanded(
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)),
],
)
@ -196,7 +132,7 @@ class MenusWidget extends StatelessWidget {
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).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:flutter/material.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/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/screens/my_requests/new_request.dart';
import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
import 'package:provider/provider.dart';
@ -33,7 +30,7 @@ class ServicesWidget extends StatelessWidget {
];
return Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel data, Widget? child) {
builder: (context, data, child) {
return data.isServicesMenusLoading
? whileLoading()
: ListView.separated(
@ -72,15 +69,12 @@ class ServicesWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.memory(
const Base64Decoder().convert(data.homeMenus![parentIndex].menuEntiesList[index].icon ?? ""),
scale: 1.25,
),
SvgPicture.asset(AppState().isArabic(context) ? getMenuIconAr(data.homeMenus![parentIndex].menuEntiesList[index].prompt!) : getMenuIconEn(data.homeMenus![parentIndex].menuEntiesList[index].prompt!)),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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)),
],
@ -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),
),
],
);
},
separatorBuilder: (BuildContext context, int index) {
separatorBuilder: (context, index) {
return 12.height;
},
shrinkWrap: true,
@ -195,25 +189,8 @@ class ServicesWidget extends StatelessWidget {
}
void handleOnPress(context, GetMenuEntriesList menuEntry) {
print(menuEntry.requestType);
var pro = Provider.of<DashboardProviderModel>(context, listen: false);
// if (menuEntry.requestType == "PMS") {
// 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") {
if (menuEntry.requestType == "MONTHLY_ATTENDANCE") {
Navigator.pushNamed(context, AppRoutes.monthlyAttendance);
return;
} 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() ?? [];
menuEntry.icon = "";
menuList = [];
if (menuList.isEmpty) {
if (menuEntry.requestType == "EIT") {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(menuEntry.prompt!, menuEntry.functionName!));
@ -265,13 +241,13 @@ class ServicesWidget extends StatelessWidget {
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext cxt, int index) {
itemBuilder: (cxt, index) {
return AspectRatio(
aspectRatio: 105 / 105,
child: ServicesMenuShimmer(),
);
},
separatorBuilder: (BuildContext cxt, int index) => 9.width,
separatorBuilder: (cxt, index) => 9.width,
itemCount: 4,
),
),

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

@ -8,19 +8,18 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.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/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/classes/notifications.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/main.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/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/widgets/button/default_button.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:wifi_iot/wifi_iot.dart';
@ -58,12 +58,9 @@ class _LoginScreenState extends State<LoginScreen> {
bool isOnExternalStorage = false;
bool isDevelopmentModeEnable = false;
late HmsApiAvailability hmsApiAvailability;
@override
void initState() {
super.initState();
hmsApiAvailability = HmsApiAvailability();
// checkFirebaseToken();
// if (kReleaseMode) {
// checkDeviceSafety();
@ -97,27 +94,21 @@ class _LoginScreenState extends State<LoginScreen> {
Future<void> checkFirebaseToken() async {
try {
Utils.showLoading(context);
if (Platform.isAndroid) {
try {
await hmsApiAvailability.isHMSAvailable().then((value) async {
if (value == 0) {
AppState().setIsHuawei = true;
AppNotifications().initHuaweiPush(checkLoginInfo);
} else {
await Firebase.initializeApp();
_firebaseMessaging = FirebaseMessaging.instance;
firebaseToken = await _firebaseMessaging.getToken();
AppNotifications().init(firebaseToken);
checkLoginInfo();
}
});
} catch (ex) {}
await Firebase.initializeApp();
_firebaseMessaging = FirebaseMessaging.instance;
firebaseToken = await _firebaseMessaging.getToken();
AppNotifications().init(firebaseToken);
loginInfo = await LoginApiClient().getMobileLoginInfoNEW(firebaseToken ?? "", Platform.isAndroid ? "android" : "ios");
if (loginInfo == null) {
await checkPrefs();
_autoLogin = false;
Utils.hideLoading(context);
return;
} else {
await Firebase.initializeApp();
_firebaseMessaging = FirebaseMessaging.instance;
firebaseToken = await _firebaseMessaging.getToken();
AppNotifications().init(firebaseToken);
checkLoginInfo();
loginInfo!.deviceToken = firebaseToken;
await checkPrefs();
Utils.hideLoading(context);
performLogin();
}
} catch (ex) {
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 {
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 firebaseToken = await Utils.getStringFromPrefs(SharedPrefsConsts.firebaseToken);
// print("firebaseToken:$firebaseToken");
@ -152,7 +128,6 @@ class _LoginScreenState extends State<LoginScreen> {
}
}
void performLogin() async {
Utils.showLoading(context);
try {
@ -184,35 +159,21 @@ class _LoginScreenState extends State<LoginScreen> {
}
}
@override
Widget build(BuildContext context) {
username.text = "1002528733";
password.text = "moe123456";
if (isAppOpenBySystem == null) {
isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool;
if (!kReleaseMode) {
// username.text = "1100313582";
// password.text = "moe123456";
// username.text = "15444"; // Maha User
username.text = "15153"; // Tamer User
password.text = "Abcd@12345";
username.text = "1024056812";
password.text = "moe123456";
// username.text = "206535"; // Hashim User
// password.text = "Namira786";
// 1) Normal user :
// Username: 1100313582
// 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
// 13777
// Ab12345cd
}
if (isAppOpenBySystem!) checkFirebaseToken();
}
@ -230,24 +191,24 @@ class _LoginScreenState extends State<LoginScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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"));
}),
],)
Expanded(child: SizedBox()),
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"));
}),
],
),
],
),
Expanded(
@ -263,13 +224,12 @@ class _LoginScreenState extends State<LoginScreen> {
12.height,
InputWidget(LocaleKeys.password.tr(), "xxxxxx", password, isTextIsPassword: true),
9.height,
if (env.login.forgetPassword)
Align(
alignment: Alignment.centerRight,
child: LocaleKeys.forgotPassword.tr().toText12(isUnderLine: true, color: MyColors.textMixColor).onPress(() {
Navigator.pushNamed(context, AppRoutes.forgotPassword);
}),
),
Align(
alignment: Alignment.centerRight,
child: LocaleKeys.forgotPassword.tr().toText12(isUnderLine: true, color: MyColors.textMixColor).onPress(() {
Navigator.pushNamed(context, AppRoutes.forgotPassword);
}),
),
20.height,
// DefaultButton(
// "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/date_uitl.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/dialogs/otp_dialog.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/generic_response_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/dialogs/dialogs.dart';
// WhatsApp 4
// SMS 1
@ -60,54 +62,29 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
String empName = mobileLoginInfoListModel!.employeeName!;
return Scaffold(
// appBar: AppBar(
//
// backgroundColor: Colors.transparent,
// automaticallyImplyLeading: false,
// title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false)
// ? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {
// showMDialog(context, child: BusinessCardDialog());
// })
// : Container(),
// actions: [
// Center(
// child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {
// showMDialog(context, child: EmployeeDigitialIdDialog());
// })),
// 21.width
// ],
// ),
appBar: AppBar(
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false)
? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {
showMDialog(context, child: BusinessCardDialog());
})
: Container(),
actions: [
Center(
child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {
showMDialog(context, child: EmployeeDigitialIdDialog());
})),
21.width
],
),
body: Column(
children: [
ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: [
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,
//12.height,
if (true)
Column(
mainAxisSize: MainAxisSize.min,
@ -164,7 +141,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
children: [
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3),
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4),
if (env.login.verificationMethod.whatsapp) getButton(2),
getButton(2),
getButton(1),
],
)
@ -312,7 +289,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
width: 38,
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 {
try {
if (isDirectLogin) {
if (isDirectLogin)
setState(() {
Utils.showLoading(context);
});
} else {
else
Utils.showLoading(context);
}
await LoginApiClient().checkMobileAppVersion();
await LoginApiClient().memberLogin(AppState().getUserName!, AppState().password!);
if (!isDirectLogin) {
if (!isDirectLogin)
BasicMemberInformationModel? memberInformationModel =
await LoginApiClient().mohemmSendActivationCodeByOTPNotificationType(0, AppState().memberLoginList?.pMOBILENUMBER, sendVerificationFlat, AppState().getUserName);
}
if (isDirectLogin) performDirectApiCall(_title, _icon, _flag, "", null);
if (!isDirectLogin) Utils.hideLoading(context);
if (!isDirectLogin) {
if (!isDirectLogin)
OtpDialog(
context,
sendVerificationFlat,
@ -378,7 +353,6 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
performApiCall(_title, _icon, _flag, sendVerificationFlat, isDirectLogin: isDirectLogin);
},
).displayDialog(context);
}
} catch (ex) {
Utils.hideLoading(context);
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 {
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(
AppState().memberLoginList?.pEMAILADDRESS ?? "",
genericResponseModel?.pSESSIONID ?? 0,
@ -395,10 +369,9 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
_flag,
AppState().memberLoginList?.pMOBILENUMBER ?? "",
AppState().getUserName!,
AppState().getIsHuawei ? AppState().getHuaweiPushToken : mobileLoginInfoListModel!.deviceToken!,
mobileLoginInfoListModel!.deviceToken!,
Platform.isAndroid ? "android" : "ios");
AppState().setMemberInformationListModel = genericResponseModel!.memberInformationList?.first;
AppState().setPrivilegeListModel = genericResponseModel!.privilegeList ?? [];
if (genericResponseModel.errorMessage != null) {
Utils.showToast(genericResponseModel.errorMessage ?? "");
// 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/consts.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/dialogs/otp_dialog.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/basic_member_information_model.dart';
@ -78,7 +78,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
children: [
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3),
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4),
if (env.login.verificationMethod.whatsapp) getButton(2),
getButton(2),
getButton(1),
],
)
@ -572,7 +572,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
width: 38,
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 ?? ""),
(value, TextEditingController _pinPutController) async {
Utils.showLoading(context);
try {
try {
GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(true, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName);
GenericResponseModel? genericResponseModel1 = await LoginApiClient().insertMobileLoginInfoNEW(
AppState().memberLoginList?.pEMAILADDRESS ?? "",
@ -628,7 +628,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
_flag,
AppState().memberLoginList?.pMOBILENUMBER ?? "",
AppState().getUserName!,
AppState().getIsHuawei ? AppState().getHuaweiPushToken : firebaseToken!,
firebaseToken!,
Platform.isAndroid ? "android" : "ios");
if (genericResponseModel?.errorMessage != null) {
Utils.showToast(genericResponseModel?.errorMessage ?? "");
@ -637,13 +637,13 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
AppState().setMemberInformationListModel = genericResponseModel.memberInformationList?.first;
MemberInformationListModel.saveToPrefs(genericResponseModel.memberInformationList ?? []);
PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []);
// AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID;
// AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
// AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID;
AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
Utils.saveStringFromPrefs(SharedPrefsConsts.username, AppState().getUserName!);
Utils.saveStringFromPrefs(SharedPrefsConsts.password, AppState().password!);
// Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID, genericResponseModel.mohemmWifiSSID ?? "");
// Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiPassword, genericResponseModel.mohemmWifiPassword!);
Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID, genericResponseModel.mohemmWifiSSID!);
Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiPassword, genericResponseModel.mohemmWifiPassword!);
}
Utils.hideLoading(context);
Navigator.pop(context);

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

@ -169,36 +169,26 @@ class MarathonScreen extends StatelessWidget {
],
)
: const SizedBox(),
36.height,
if (provider.selectedWinners != null) ...<Widget>[
provider.selectedWinners!.length == 1
? Column(
children: <Widget>[
(AppState().isArabic(context) ? provider.selectedWinners![0].nameEn : provider.selectedWinners![0].nameEn)!.toText24(
color: MyColors.grey3AColor,
isCentered: true,
),
8.height,
provider.selectedWinners![0].employeeId!.toText22(color: MyColors.grey57Color),
],
)
: ListView.separated(
shrinkWrap: true,
itemCount: provider.selectedWinners!.length,
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),
],
);
},
),
ListView.separated(
shrinkWrap: true,
itemCount: provider.selectedWinners!.length,
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,
if (provider.marathonDetailModel.sponsors != null && provider.marathonDetailModel.sponsors!.isNotEmpty) ...<Widget>[
@ -309,7 +299,7 @@ class MarathonScreen extends StatelessWidget {
else ...<Widget>[
MarathonProgressContainer(provider: provider).paddingOnly(left: 21, right: 21),
],
if (provider.questionCardStatus == QuestionCardStatus.findingWinner && !provider.isUserOutOfGame) ...<Widget>[
if (provider.questionCardStatus == QuestionCardStatus.findingWinner) ...<Widget>[
getNameContainer(context),
],
QuestionCardBuilder(
@ -336,7 +326,7 @@ class MarathonScreen extends StatelessWidget {
subTitle: LocaleKeys.youMissedTheQuestion.tr().toText18(color: MyColors.darkTextColor, isCentered: true),
),
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),
subTitle: LocaleKeys.winnerSelectedRandomly.tr().toText18(color: MyColors.darkTextColor, isCentered: true),
),

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

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

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

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

@ -159,7 +159,7 @@ class _ViewAttendanceState extends State<ViewAttendance> {
children: [
Row(
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),
],
).onPress(
@ -439,7 +439,7 @@ class _ViewAttendanceState extends State<ViewAttendance> {
expand: false,
builder: (_, controller) {
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(
children: [
Container(
@ -468,7 +468,7 @@ class _ViewAttendanceState extends State<ViewAttendance> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
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),
12.height,
CircularStepProgressBar(

@ -105,7 +105,7 @@ class _MonthlyPaySlipScreenState extends State<MonthlyPaySlipScreen> {
Container(alignment: Alignment.centerLeft, child: LocaleKeys.month.tr().toText17(isBold: true, color: MyColors.darkIconColor)),
Row(
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),
],
).onPress(() async {

@ -238,7 +238,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
isEnable: false,
onTap: () async {
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;
setState(() {});
},
@ -286,7 +286,6 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.getContactDetailsList!.sEGMENTVALUEDSP ?? "",
isInputTypeNum: true,
length: model.mAXIMUMSIZE,
onChange: (String text) {
model.getContactDetailsList!.sEGMENTVALUEDSP = text;
},
@ -299,7 +298,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
isEnable: false,
onTap: () async {
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;
setState(() {});
},
@ -346,7 +345,6 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.getContactDetailsList!.sEGMENTVALUEDSP ?? "",
isInputTypeNum: true,
length: model.mAXIMUMSIZE,
onChange: (String text) {
model.getContactDetailsList!.sEGMENTVALUEDSP = text;
},
@ -359,7 +357,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
isEnable: false,
onTap: () async {
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;
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/get_employee_basic_details.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/ui/profile/dynamic_screens/dynamic_input_basic_details_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
@ -36,7 +35,6 @@ class _BasicDetailsState extends State<BasicDetails> {
String? employeeNo = "";
int correctOrNew = 1;
List<GetEmployeeBasicDetailsList>? getEmployeeBasicDetailsList;
List<EmployeeQualificationsList>? getEmployeeQualificationsList;
late MemberInformationListModel memberInformationList;
GetMenuEntriesList menuEntries = GetMenuEntriesList();
@ -62,7 +60,6 @@ class _BasicDetailsState extends State<BasicDetails> {
try {
Utils.showLoading(context);
getEmployeeBasicDetailsList = await ProfileApiClient().getEmployeeBasicDetails();
getEmployeeQualificationsList = await ProfileApiClient().getEmployeeQualifications();
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
@ -88,58 +85,22 @@ class _BasicDetailsState extends State<BasicDetails> {
? const SizedBox()
: (getEmployeeBasicDetailsList!.isEmpty
? Utils.getNoDataWidget(context)
: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
LocaleKeys.profile_basicDetails.tr().toText20(isBold: true),
14.height,
...getEmployeeBasicDetailsList!
.map((e) => Column(
children: [
e.dISPLAYFLAG == "Y"
? Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
"${e.sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor),
"${e.sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor),
12.height
])
: 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),
],
),
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: getEmployeeBasicDetailsList!
.map((e) => Column(
children: [
e.dISPLAYFLAG == "Y"
? Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
"${e.sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor),
"${e.sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor),
12.height
])
: Container(),
],
))
.toList()
]).objectContainerView())
.toList())
.objectContainerView())
],
),
),
@ -170,7 +131,7 @@ class _BasicDetailsState extends State<BasicDetails> {
);
StatefulBuilder alert = StatefulBuilder(builder: (context, setState) {
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()),
content: Builder(builder: (context) {
// 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(),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
const Divider(),
Divider(),
Column(
children: [
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/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';
@ -101,7 +100,6 @@ class _ContactDetailsState extends State<ContactDetails> {
),
separatorBuilder: (cxt, index) => 12.height,
itemCount: getEmployeePhonesList.length),
if(env.canEdit)
if (menuEntriesPhone.updateButton == 'Y')
AppState().isArabic(context)
? Positioned(
@ -133,7 +131,6 @@ class _ContactDetailsState extends State<ContactDetails> {
),
separatorBuilder: (cxt, index) => 12.height,
itemCount: getEmployeeAddressList.length),
if(env.canEdit)
if (menuEntriesAddress.updateButton == 'Y')
AppState().isArabic(context)
? Positioned(
@ -151,7 +148,6 @@ class _ContactDetailsState extends State<ContactDetails> {
else
Stack(
children: [
if(env.canEdit)
if (menuEntriesAddress.addButton == 'Y')
AppState().isArabic(context)
? Positioned(

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

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

@ -233,10 +233,10 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
DateTime date1 = DateTime(date.year, date.month, date.day);
getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = date.toString();
ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd', "en_US").format(date1),
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
pRETURNMSG: "null",
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;
setState(() {});
if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
@ -371,8 +371,8 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
// for date format type, date format is changed
tempVar = e.eSERVICESDV?.pVALUECOLUMNNAME ?? "";
if (tempVar.isNotEmpty) {
DateTime date = DateFormat('yyyy-MM-dd', "en_US").parse(tempVar);
tempVar = DateFormat('yyyy/MM/dd HH:mm:ss', "en_US").format(date);
DateTime date = DateFormat('yyyy-MM-dd').parse(tempVar);
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();

@ -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),
body: Stack(
children: [
memberInformationList.eMPLOYEEIMAGE != null
memberInformationList!.eMPLOYEEIMAGE != null
? Container(
height: 300,
margin: const EdgeInsets.only(top: 50),

@ -29,7 +29,7 @@ class ProfileInFo extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
16.height,
memberInfo.eMPLOYEENAME!.toText22(isCentered: true),
memberInfo.eMPLOYEENAME!.toText22(),
("${memberInfo.eMPLOYEENUMBER!} | ${memberInfo.getPositionName()}").toText13(color: MyColors.grey80Color),
memberInfo.eMPLOYEEEMAILADDRESS!.toText13(),
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_transactions_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/button/default_button.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 = [];
NewRequestModel? requestModel;
bool isNewRequest = false;
@override
void initState() {
getConcurrentPrograms();
super.initState();
}
@override
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(
backgroundColor: Colors.white,
appBar: AppBarWidget(
context,
title: LocaleKeys.concurrentReports.tr(),
title: LocaleKeys.concurrentReports,
),
body: Column(
children: [
@ -69,89 +60,86 @@ class _MyRequestsState extends State<MyRequests> {
child: PopupMenuButton(
child: DynamicTextFieldWidget(
LocaleKeys.templateName.tr(),
selectedConcurrentProgramList?.uSERCONCURRENTPROGRAMNAME ?? requestModel?.prompt ?? LocaleKeys.selectTemplate.tr(),
selectedConcurrentProgramList?.uSERCONCURRENTPROGRAMNAME ?? LocaleKeys.selectTemplate.tr(),
isEnable: false,
isPopup: true,
isInputTypeNum: true,
isReadOnly: getConcurrentProgramsList.isEmpty ? true : false,
isReadOnly: false,
).paddingOnly(bottom: 12),
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) {
selectedConcurrentProgramList = getConcurrentProgramsList[popupIndex];
requestModel!.functionName = getConcurrentProgramsList[popupIndex].cONCURRENTPROGRAMNAME;
selectedConcurrentProgramList = getConcurrentProgramsList![popupIndex];
getCCPTransactions(selectedConcurrentProgramList?.cONCURRENTPROGRAMNAME);
setState(() {});
}),
),
12.height,
getCCPTransactionsList.isNotEmpty
? Expanded(
child: ListView.separated(
physics: const BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (BuildContext context, int index) {
return Container(
width: double.infinity,
padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 12),
margin: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(
color: const Color(0xff000000).withOpacity(.05),
blurRadius: 26,
offset: const Offset(0, -3),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
("Request ID: " + getCCPTransactionsList[index].rEQUESTID.toString()).toText12(color: MyColors.grey57Color),
DateUtil.formatDateToDate(DateUtil.convertStringToDate(getCCPTransactionsList[index].rEQUESTDATE!), false).toText12(color: MyColors.grey70Color),
],
),
Container(
padding: const EdgeInsets.only(top: 10.0),
child: ("Phase: " + getCCPTransactionsList[index].cCPPHASE!).toText12(color: MyColors.grey57Color, isBold: true),
),
Container(
padding: const EdgeInsets.only(top: 10.0),
child: "Program Name: ".toText12(color: MyColors.grey57Color, isBold: true),
),
getCCPTransactionsList[index].cONCURRENTPROGRAMNAME!.toText12(color: MyColors.gradiantEndColor),
Container(
padding: const EdgeInsets.only(top: 10.0),
child: InkWell(
onTap: () {
getCCPOutput(getCCPTransactionsList[index].rEQUESTID.toString());
},
child: Row(
children: [
"Output: ".toText12(color: MyColors.grey57Color),
8.width,
"Open PDF".toText12(color: MyColors.grey57Color),
6.width,
const Icon(Icons.launch, size: 16.0),
],
),
),
),
],
getCCPTransactionsList.isNotEmpty ? Expanded(
child: ListView.separated(
physics: const BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (BuildContext context, int index) {
return Container(
width: double.infinity,
padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 12),
margin: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(
color: const Color(0xff000000).withOpacity(.05),
blurRadius: 26,
offset: const Offset(0, -3),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
("Request ID: " + getCCPTransactionsList[index].rEQUESTID.toString()).toText12(color: MyColors.grey57Color),
DateUtil.formatDateToDate(DateUtil.convertStringToDate(getCCPTransactionsList[index].rEQUESTDATE!), false).toText12(color: MyColors.grey70Color),
],
),
Container(
padding: const EdgeInsets.only(top: 10.0),
child: ("Phase: " + getCCPTransactionsList[index].cCPPHASE!).toText12(color: MyColors.grey57Color, isBold: true),
),
Container(
padding: const EdgeInsets.only(top: 10.0),
child: "Program Name: ".toText12(color: MyColors.grey57Color, isBold: true),
),
getCCPTransactionsList[index].cONCURRENTPROGRAMNAME!.toText12(color: MyColors.gradiantEndColor),
Container(
padding: const EdgeInsets.only(top: 10.0),
child: InkWell(
onTap: () {
getCCPOutput(getCCPTransactionsList[index].rEQUESTID.toString());
},
child: Row(
children: [
"Output: ".toText12(color: MyColors.grey57Color),
8.width,
"Open PDF".toText12(color: MyColors.grey57Color),
6.width,
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,
1.divider,
@ -164,17 +152,15 @@ class _MyRequestsState extends State<MyRequests> {
}
void openNewRequest() async {
await Navigator.pushNamed(context, AppRoutes.newRequest, arguments: NewRequestModel(groupID: requestModel!.groupID, functionName: requestModel!.functionName)).then((value) {
if (value != null && value == "refresh") {
getCCPTransactions(requestModel!.functionName);
}
await Navigator.pushNamed(context, AppRoutes.newRequest).then((value) {
// getOpenTickets();
});
}
void getConcurrentPrograms() async {
try {
Utils.showLoading(context);
getConcurrentProgramsList = await MyRequestsApiClient().getConcurrentPrograms(requestModel!.groupID!);
getConcurrentProgramsList = await MyRequestsApiClient().getConcurrentPrograms();
Utils.hideLoading(context);
setState(() {});
} 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/generated/locale_keys.g.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/my_requests/get_ccp_transactions_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/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 {
const NewRequest({Key? key}) : super(key: key);
@ -43,29 +34,20 @@ class _NewRequestState extends State<NewRequest> {
List<GetEITDFFStructureList>? getCCPDFFStructureModelList;
DateTime selectedDate = DateTime.now();
NewRequestModel? requestModel;
@override
void initState() {
getConcurrentPrograms();
super.initState();
}
@override
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(
backgroundColor: Colors.white,
appBar: AppBarWidget(
context,
title: LocaleKeys.concurrentReports.tr(),
title: LocaleKeys.concurrentReports,
),
body: Column(
children: [
@ -76,17 +58,17 @@ class _NewRequestState extends State<NewRequest> {
PopupMenuButton(
child: DynamicTextFieldWidget(
LocaleKeys.templateName.tr(),
selectedConcurrentProgramList?.uSERCONCURRENTPROGRAMNAME ?? requestModel?.prompt ?? LocaleKeys.selectTemplate.tr(),
selectedConcurrentProgramList?.uSERCONCURRENTPROGRAMNAME ?? LocaleKeys.selectTemplate.tr(),
isEnable: false,
isPopup: true,
isInputTypeNum: true,
isReadOnly: getConcurrentProgramsList.isEmpty ? true : false,
isReadOnly: false,
).paddingOnly(bottom: 12),
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) {
selectedConcurrentProgramList = getConcurrentProgramsList[popupIndex];
selectedConcurrentProgramList = getConcurrentProgramsList![popupIndex];
getCCPDFFStructure(selectedConcurrentProgramList?.cONCURRENTPROGRAMNAME);
setState(() {});
}),
@ -119,11 +101,8 @@ class _NewRequestState extends State<NewRequest> {
List<Map<String, dynamic>> values = getCCPDFFStructureModelList!.map((e) {
String? dateVal = '';
String? vatcherVal = '';
print(e.aPPLICATIONCOLUMNNAME);
print(e.fORMATTYPE);
print(e.eSERVICESDV!.pIDCOLUMNNAME);
int? numberVal;
if (e.fORMATTYPE == 'N') {
if (e!.fORMATTYPE == 'N') {
dateVal = null;
vatcherVal = e.eSERVICESDV!.pIDCOLUMNNAME;
numberVal = null;
@ -131,10 +110,6 @@ class _NewRequestState extends State<NewRequest> {
dateVal = null;
vatcherVal = e.eSERVICESDV!.pIDCOLUMNNAME;
numberVal = null;
} else if (e.fORMATTYPE == 'C') {
dateVal = null;
numberVal = null;
vatcherVal = e.eSERVICESDV!.pIDCOLUMNNAME;
} else {
dateVal = 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();
}).toList();
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);
if (responseData.messageStatus == 1) {
Navigator.pop(context, "refresh");
} else {
Utils.showToast(responseData.errorEndUserMessage ?? "");
}
Navigator.pushNamed(
context,
AppRoutes.myRequests,
);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
@ -159,7 +135,7 @@ class _NewRequestState extends State<NewRequest> {
void getConcurrentPrograms() async {
try {
Utils.showLoading(context);
getConcurrentProgramsList = await MyRequestsApiClient().getConcurrentPrograms(requestModel!.groupID!);
getConcurrentProgramsList = await MyRequestsApiClient().getConcurrentPrograms();
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
@ -200,7 +176,6 @@ class _NewRequestState extends State<NewRequest> {
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y",
isInputTypeNum: true,
length: model.mAXIMUMSIZE,
onChange: (text) {
model.fieldAnswer = text;
model.eSERVICESDV ??= ESERVICESDV();
@ -214,7 +189,7 @@ class _NewRequestState extends State<NewRequest> {
displayText = displayText.replaceAll(" 00:00:00", "");
}
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(
@ -225,7 +200,7 @@ class _NewRequestState extends State<NewRequest> {
onTap: () async {
if ((getCCPDFFStructureModelList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
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 {
selectedDate = DateTime.parse(getCCPDFFStructureModelList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
@ -236,18 +211,16 @@ class _NewRequestState extends State<NewRequest> {
ESERVICESDV eservicesdv;
if (getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS) {
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",
pRETURNSTATUS: getCCPDFFStructureModelList![index].dEFAULTVALUE,
pVALUECOLUMNNAME:
getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy/MM/dd HH:MM:SS', "en_US").format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
pVALUECOLUMNNAME: getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy/MM/dd HH:MM:SS').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
} else {
eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd', "en_US").format(date1),
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
pRETURNMSG: "null",
pRETURNSTATUS: getCCPDFFStructureModelList![index].dEFAULTVALUE,
pVALUECOLUMNNAME:
getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss', "en_US").format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
pVALUECOLUMNNAME: getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
}
getCCPDFFStructureModelList![index].eSERVICESDV = eservicesdv;
setState(() {});
@ -350,7 +323,6 @@ class _NewRequestState extends State<NewRequest> {
isPopup: true,
isInputTypeNum: true,
isReadOnly: model.rEADONLY == "Y",
length: model.mAXIMUMSIZE,
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
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(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
getOffersList[0].discountDescription!.toText16(isBold: true),
getOffersList[0].discount!.toText16(isBold: true),
InkWell(
onTap: () {
_shareOfferAsImage();

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

@ -127,7 +127,7 @@ class SelectedItemSheet extends StatelessWidget {
if (favoriteReplacements != null) empID = favoriteReplacements!.userName;
if (replacementList != null) empID = replacementList!.userName;
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 (favoriteReplacements != null) empID = favoriteReplacements!.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 {
Utils.showLoading(context);
try {
await WorkListApiClient().submitComment(
comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode, approverIndex: actionHistoryList != null ? actionHistoryList!.sEQUENCE : null);
await WorkListApiClient().submitComment(comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode, approverIndex: actionHistoryList != null ? actionHistoryList!.sEQUENCE : null);
Utils.hideLoading(context);
// Navigator.pop(context);
// Navigator.pop(context);

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

@ -93,7 +93,7 @@ class ActionsFragment extends StatelessWidget {
],
),
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(
children: [
SvgPicture.asset(
"assets/moe_logo.svg",
"assets/mohemm_logo.svg",
height: 48,
width: 48,
alignment: Alignment.centerRight,

@ -45,8 +45,8 @@ class BalancesDashboardWidget extends StatefulWidget {
class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
List<PieChartModel> chartModelList = [];
late DateTime accrualDateTime;
List<GetAccrualBalancesList>? leaveBalanceAccrual =[];
List<GetAccrualBalancesList>? ticketBalanceAccrualList =[];
GetAccrualBalancesList? leaveBalanceAccrual;
List<GetAccrualBalancesList>? ticketBalanceAccrualList;
@override
void initState() {
@ -63,23 +63,20 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
void changeAccrualDate(bool showLoading) async {
try {
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 (widget.isLeaveBalance) {
leaveBalanceAccrual = accrualList;
leaveBalanceAccrual = accrualList[0];
chartModelList = [
PieChartModel(LocaleKeys.currentBalance.tr(), ((leaveBalanceAccrual![0]?.accrualNetEntitlement! ?? 0)! + (leaveBalanceAccrual![1]?.accrualNetEntitlement! ??0)!).toDouble() , MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.usedBalance.tr(), ((leaveBalanceAccrual![0]?.accrualUsedEntitlement! ?? 0)! + (leaveBalanceAccrual![1]?.accrualUsedEntitlement! ??0)!).toDouble() , MyColors.backgroundBlackColor, titleAppend: ""),
PieChartModel(LocaleKeys.currentBalance.tr(), leaveBalanceAccrual?.accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.usedBalance.tr(), leaveBalanceAccrual?.accrualUsedEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
];
}
else if(accrualList.isNotEmpty){
} else {
chartModelList = [
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.infants.tr(), accrualList[3].accrualNetEntitlement?.toDouble() ?? 0, MyColors.pinkColor, titleAppend: ""),
];
}
}
if (showLoading) Utils.hideLoading(context);
@ -92,15 +89,15 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
@override
Widget build(BuildContext context) {
// if (leaveBalanceAccrual == null && widget.isLeaveBalance) {
// leaveBalanceAccrual = Provider.of<DashboardProviderModel>(context, listen: false).leaveBalanceAccrual;
// chartModelList = [
// PieChartModel(LocaleKeys.currentBalance.tr(), leaveBalanceAccrual?.accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
// PieChartModel(LocaleKeys.usedBalance.tr(), leaveBalanceAccrual?.accrualUsedEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
// ];
// }
if (ticketBalanceAccrualList!.isEmpty && !widget.isLeaveBalance) {
if (leaveBalanceAccrual == null && widget.isLeaveBalance) {
leaveBalanceAccrual = Provider.of<DashboardProviderModel>(context, listen: false).leaveBalanceAccrual;
chartModelList = [
PieChartModel(LocaleKeys.currentBalance.tr(), leaveBalanceAccrual?.accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.usedBalance.tr(), leaveBalanceAccrual?.accrualUsedEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
];
}
if (ticketBalanceAccrualList == null && !widget.isLeaveBalance) {
ticketBalanceAccrualList = Provider.of<DashboardProviderModel>(context, listen: false).accrualList ?? [];
if (ticketBalanceAccrualList!.isNotEmpty) {
chartModelList = [
@ -133,7 +130,7 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
],
),
8.height,
(leaveBalanceAccrual!.isNotEmpty || ticketBalanceAccrualList!.isNotEmpty) ? Row(
Row(
children: [
ListView.separated(
shrinkWrap: true,
@ -147,7 +144,7 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
.expanded,
getChart(chartModelList)
],
) :const Center(child:CircularProgressIndicator(backgroundColor:MyColors.gradiantStartColor,))
)
],
).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? okTitle;
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
Widget build(BuildContext context) {
@ -42,8 +41,9 @@ class ConfirmDialog extends StatelessWidget {
icon: const Icon(Icons.close),
color: MyColors.darkTextColor,
constraints: const BoxConstraints(),
onPressed: () => onCloseTap ?? Navigator.pop(context),
// onPressed: () => Navigator.pop(context),
onPressed: () {
Navigator.pop(context);
},
)
],
),

@ -1,8 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.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 {
final String labelText;
@ -20,8 +17,6 @@ class DynamicTextFieldWidget extends StatelessWidget {
final bool isInputTypeNumSigned;
final bool isObscureText;
final bool isBackgroundEnable;
final int? length;
final String? toolTip;
final void Function(String)? onChange;
DynamicTextFieldWidget(this.labelText, this.hintText, //this.controller,
@ -36,8 +31,6 @@ class DynamicTextFieldWidget extends StatelessWidget {
this.onChange,
this.isInputTypeNum = false,
this.isInputTypeNumSigned = true,
this.length,
this.toolTip = "",
this.isBackgroundEnable = false});
@override
@ -54,7 +47,7 @@ class DynamicTextFieldWidget extends StatelessWidget {
),
),
child: InkWell(
onTap: isReadOnly ? null : onTap,
onTap: onTap,
child: Row(
children: [
Expanded(
@ -75,18 +68,13 @@ class DynamicTextFieldWidget extends StatelessWidget {
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
readOnly: isReadOnly,
keyboardType: (isInputTypeNum)
? (isInputTypeNumSigned ? const TextInputType.numberWithOptions(signed: true, decimal: true) : TextInputType.numberWithOptions(signed: true, decimal: true))
: TextInputType.text,
keyboardType: (isInputTypeNum) ? (isInputTypeNumSigned ? const TextInputType.numberWithOptions(signed: true, decimal: true) : TextInputType.numberWithOptions(signed: true, decimal: true)) : TextInputType.text,
textInputAction: TextInputAction.done,
//controller: controller,
maxLines: lines,
obscuringCharacter: "*",
obscureText: isObscureText,
onChanged: onChange,
inputFormatters: [
LengthLimitingTextInputFormatter(length),
],
style: const TextStyle(
fontSize: 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 (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,
child: Center(
child: Image.asset(
"assets/images/logos/loading_moe.gif",
"assets/images/logos/loading_mohemm_logo.gif",
height: 96.0,
width: 96.0,
),

@ -1,11 +1,22 @@
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/rendering.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/utils.dart';
import 'package:mohem_flutter_app/theme/colors.dart';
// import 'package:geodesy/geodesy.dart' as geodesy;
//Created By Mr.Zohaib
class Location {
static _Map map = _Map();
static void havePermission(Function(bool) callback) {
Geolocator.checkPermission().then((value) async {
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) {
//AppStorage.sp.saveLocation(position);
bool isMocked = position.isMocked;
callback(position, isMocked);
LatLng? myCurrentLocation = LatLng(position.latitude, position.longitude);
callback(myCurrentLocation, isMocked);
}
AppPermissions.location((granted) {
@ -58,4 +70,182 @@ class Location {
}
}, 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:flutter/material.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/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
@ -95,11 +95,11 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
// if (isNfcEnabled)
attendanceMethod("NFC", "assets/images/nfc.svg", isNfcEnabled, () {
if (isNfcLocationEnabled) {
Location.getCurrentLocation((Position position, bool isMocked) {
Location.getCurrentLocation((LatLng? latlng, bool isMocked) {
if (isMocked) {
markFakeAttendance("NFC", position.latitude.toString() ?? "", position.longitude.toString() ?? "");
markFakeAttendance("NFC", latlng?.latitude.toString() ?? "", latlng?.longitude.toString() ?? "");
} else {
performNfcAttendance(widget.model, lat: position.latitude.toString() ?? "", lng: position.longitude.toString() ?? "");
performNfcAttendance(widget.model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
}
}, context);
} else {
@ -109,11 +109,11 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
if (isWifiEnabled)
attendanceMethod("Wifi", "assets/images/wufu.svg", isWifiEnabled, () {
if (isWifiLocationEnabled) {
Location.getCurrentLocation((Position position, bool isMocked) {
Location.getCurrentLocation((LatLng? latlng, bool isMocked) {
if (isMocked) {
markFakeAttendance("WIFI", position.latitude.toString() ?? "", position.longitude.toString() ?? "");
markFakeAttendance("WIFI", latlng?.latitude.toString() ?? "", latlng?.longitude.toString() ?? "");
} else {
performWifiAttendance(widget.model, lat: position.latitude.toString() ?? "", lng: position.longitude.toString() ?? "");
performWifiAttendance(widget.model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
}
}, context);
} else {
@ -124,11 +124,11 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
if (isQrEnabled)
attendanceMethod("QR", "assets/images/ic_qr.svg", isQrEnabled, () async {
if (isQrLocationEnabled) {
Location.getCurrentLocation((Position position, bool isMocked) {
Location.getCurrentLocation((LatLng? latlng, bool isMocked) {
if (isMocked) {
markFakeAttendance("QR", position.latitude.toString() ?? "", position.longitude.toString() ?? "");
markFakeAttendance("QR", latlng?.latitude.toString() ?? "", latlng?.longitude.toString() ?? "");
} else {
performQrCodeAttendance(widget.model, lat: position.latitude.toString() ?? "", lng: position.longitude.toString() ?? "");
performQrCodeAttendance(widget.model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
}
}, context);
} else {
@ -145,6 +145,7 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
Future<void> performNfcAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async {
if (Platform.isIOS) {
Utils.readNFc(onRead: (String nfcId) async {
Utils.showLoading(context);
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 {
if (Platform.isAndroid) {
if (!(await checkSession())) {
return;
}
}
Utils.showLoading(context);
bool isConnected = await WiFiForIoTPlugin.connect(AppState().getMohemmWifiSSID ?? "",
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 Future.delayed(const Duration(seconds: 6));
try {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 3, nfcValue: "", isGpsRequired: isWifiLocationEnabled, lat: lat, long: lng);
bool status = await model.fetchAttendanceTracking(context);
Utils.hideLoading(context);
// if (Platform.isAndroid) {
// await closeWifiRequest();
// }
await closeWifiRequest();
showMDialog(
context,
@ -264,12 +257,8 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
Utils.handleException(ex, context, null);
}
} else {
if (AppState().isAuthenticated) {
Utils.hideLoading(context);
Utils.confirmDialog(context, LocaleKeys.comeNearHMGWifi.tr());
} else {
await closeWifiRequest();
}
Utils.hideLoading(context);
Utils.confirmDialog(context, LocaleKeys.comeNearHMGWifi.tr());
}
}

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

Loading…
Cancel
Save