Merge branch 'master' of https://gitlab.com/mirza.shafique/mohem_flutter_app into development_sultan

merge-requests/1/merge
Sultan Khan 3 years ago
commit f329f7030d

@ -1,40 +1,42 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mohem_flutter_app">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.NFC"/>
<application
<uses-permission android:name="android.permission.NFC" />
<application
android:icon="@mipmap/ic_launcher"
android:label="Mohemm"
android:icon="@mipmap/ic_launcher">
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#ffffff</color>
</resources>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>

@ -24,7 +24,7 @@
"checkIn": "تحقق في",
"workList": "قائمة العمل",
"leaveBalance": "رصيد الاجازات",
"missingSwipes": "الضربات الشديدة في عداد المفقودين",
"missingSwipes": "تسجيل بصمة حضور",
"ticketBalance": "رصيد التذكرة",
"other": "آخر",
"services": "خدمات",
@ -56,10 +56,10 @@
"order": "الطلبات",
"earlyOut": "الخروج مبكرا",
"shortage": "ساعات التقصير",
"excess": "Excess",
"excess": "فائض",
"lateIn": "القدوم المتاخر",
"approvedCheckOut": "وقت الخروج",
"approvedCheckIn": "وقت الدخول",
"approvedCheckOut": "اعتماد وقت الخروج",
"approvedCheckIn": "اعتماد وقت الدخول",
"actualCheckOut": "وقت الخروج",
"actualCheckIn": "وقت الدخول",
"present": "حضور",
@ -229,8 +229,9 @@
"approvalLevel": "مستوى الموافقة",
"requesterDetails": "تفاصيل مقدم الطلب",
"myAttendance": "حضوري",
"workOnBreak": "العمل على استراحة",
"workOnBreak": "التعويض عن العمل اثناءالاستراحه",
"next": "التالي",
"mobile": "التليفون المحمول",
"completingYear": "نحن نقدر لك لاستكمال خدمة",
"year": "سنة",
"month": "شهر",
@ -244,6 +245,12 @@
"maritalStatus ": "الحالة الاجتماعية",
"fullName": "الأسم الكامل",
"remove": "حذف",
"submit": "ارسال",
"areYouSureYouWantToSubmit": "هل أنت متأكد أنك تريد أن تقدم؟",
"comments": "تعليقات",
"writeComment": "أكتب تعليقا",
"approversList": "قائمة الموافقين",
"yourRequestHasBeenSubmittedForApprovals": "تم تقديم طلبك للموافقات",
"profile": {
"reset_password": {
"label": "Reset Password",

@ -62,10 +62,10 @@
"approvedCheckIn": "Approved Check In",
"actualCheckOut": "Actual Check Out",
"actualCheckIn": "Actual Check In",
"present": "PRESENT 11",
"present": "PRESENT",
"pres": "present",
"shiftTime": "Shift Time",
"absent": "ABSENT 10",
"absent": "ABSENT",
"attendance": "Attendance",
"scheduleDays": "Schedule\nDays",
"offDays": "Off\nDays",
@ -224,7 +224,6 @@
"relatedTo": "Related To",
"requestDate": "Request Date",
"analyzedDate": "Analyzed Date",
"approvedCheckIn": "Approved Check In",
"urgent": "Urgent",
"requestDetails": "Request Details",
"approvalLevel": "Approval Level",
@ -232,6 +231,7 @@
"myAttendance": "My Attendance",
"workOnBreak": "Work On Break",
"next": "Next",
"mobile": "Mobile",
"year": "Year",
"month": "Month",
"day": "Day",
@ -245,6 +245,13 @@
"maritalStatus ": "Marital Status ",
"fullName": "Full Name",
"remove": "Remove",
"Attendance":"Attendance",
"submit": "Submit",
"areYouSureYouWantToSubmit": "Are you sure you want to submit?",
"comments": "Comments",
"writeComment": "Write a comment",
"approversList": "Approvers List",
"yourRequestHasBeenSubmittedForApprovals": "Your request has been submitted for approvals",
"profile": {
"reset_password": {
"label": "Reset Password",

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

@ -1,122 +1,128 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
"images":[
{
"idiom":"iphone",
"size":"20x20",
"scale":"2x",
"filename":"Icon-App-20x20@2x.png"
},
{
"idiom":"iphone",
"size":"20x20",
"scale":"3x",
"filename":"Icon-App-20x20@3x.png"
},
{
"idiom":"iphone",
"size":"29x29",
"scale":"1x",
"filename":"Icon-App-29x29@1x.png"
},
{
"idiom":"iphone",
"size":"29x29",
"scale":"2x",
"filename":"Icon-App-29x29@2x.png"
},
{
"idiom":"iphone",
"size":"29x29",
"scale":"3x",
"filename":"Icon-App-29x29@3x.png"
},
{
"idiom":"iphone",
"size":"40x40",
"scale":"2x",
"filename":"Icon-App-40x40@2x.png"
},
{
"idiom":"iphone",
"size":"40x40",
"scale":"3x",
"filename":"Icon-App-40x40@3x.png"
},
{
"idiom":"iphone",
"size":"60x60",
"scale":"2x",
"filename":"Icon-App-60x60@2x.png"
},
{
"idiom":"iphone",
"size":"60x60",
"scale":"3x",
"filename":"Icon-App-60x60@3x.png"
},
{
"idiom":"iphone",
"size":"76x76",
"scale":"2x",
"filename":"Icon-App-76x76@2x.png"
},
{
"idiom":"ipad",
"size":"20x20",
"scale":"1x",
"filename":"Icon-App-20x20@1x.png"
},
{
"idiom":"ipad",
"size":"20x20",
"scale":"2x",
"filename":"Icon-App-20x20@2x.png"
},
{
"idiom":"ipad",
"size":"29x29",
"scale":"1x",
"filename":"Icon-App-29x29@1x.png"
},
{
"idiom":"ipad",
"size":"29x29",
"scale":"2x",
"filename":"Icon-App-29x29@2x.png"
},
{
"idiom":"ipad",
"size":"40x40",
"scale":"1x",
"filename":"Icon-App-40x40@1x.png"
},
{
"idiom":"ipad",
"size":"40x40",
"scale":"2x",
"filename":"Icon-App-40x40@2x.png"
},
{
"idiom":"ipad",
"size":"76x76",
"scale":"1x",
"filename":"Icon-App-76x76@1x.png"
},
{
"idiom":"ipad",
"size":"76x76",
"scale":"2x",
"filename":"Icon-App-76x76@2x.png"
},
{
"idiom":"ipad",
"size":"83.5x83.5",
"scale":"2x",
"filename":"Icon-App-83.5x83.5@2x.png"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"scale" : "1x",
"filename" : "ItunesArtwork@2x.png"
}
],
"info":{
"version":1,
"author":"easyappicon"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 564 B

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

@ -104,7 +104,7 @@ class DashboardApiClient {
"QRValue": "",
"PointType": pointType, // NFC=2, Wifi = 3, QR= 1,
"NFCValue": nfcValue,
"WifiValue": "",
"WifiValue": pointType == 3 ? "100" : "",
"IsGpsRequired": isGpsRequired
};
postParams.addAll(AppState().postParamsJson);

@ -90,6 +90,8 @@ class LoginApiClient {
AppState().postParamsObject?.pSessionId = responseData.pSESSIONID;
AppState().postParamsObject?.pUserName = AppState().getUserName;
AppState().postParamsObject?.pSelectedEmployeeNumber = AppState().getUserName;
AppState().postParamsObject?.setPLegislationCode = responseData.basicMemberInformation!.pLEGISLATIONCODE;
AppState().postParamsObject?.setPayrollCodeStr = responseData.memberInformationList!.first.pAYROLLCODE;
return responseData;
}, url, postParams);

@ -26,9 +26,11 @@ class MonthlyAttendanceApiClient {
"SearchMonth": month,
"SearchYear": year,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
print(responseData);
return (responseData.getTimeCardSummaryList?.length ?? 0) > 0 ? responseData.getTimeCardSummaryList!.first : null;
}, url, postParams);
}
@ -48,7 +50,6 @@ class MonthlyAttendanceApiClient {
// postParams["DeviceType"] = deviceType;
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
print("Response Data______");
print(responseData.getDayHoursTypeDetailsList!.length);
return responseData.getDayHoursTypeDetailsList ?? [];
}, url, postParams);

@ -3,8 +3,11 @@ import 'dart:async';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/get_approves_list_model.dart';
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
import 'package:mohem_flutter_app/models/get_eit_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/start_eit_approval_process_model.dart';
import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart';
import 'api_client.dart';
@ -54,4 +57,100 @@ class MyAttendanceApiClient {
return responseData.getValueSetValuesList!.first;
}, url, postParams);
}
Future<ESERVICESDV> getDefaultValue(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List<Map<String, dynamic>> list) async {
String url = "${ApiConsts.erpRest}GET_DEFAULT_VALUE";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_PARENT_VALUE": null,
"P_SEGMENT_NAME": pSegmentName,
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
"P_DESC_FLEX_NAME": pDescFlexName,
"GetValueSetValuesTBL": list,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return ESERVICESDV.fromJson(responseData.getDefaultValueList!.toJson());
}, url, postParams);
}
Future<GenericResponseModel?> validateEitTransaction(String pDescFlexContextCode, String pFunctionName, List<Map<String, dynamic>> list) async {
String url = "${ApiConsts.erpRest}VALIDATE_EIT_TRANSACTION";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
"P_FUNCTION_NAME": pFunctionName,
"EITTransactionTBL": list,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData; //ESERVICESDV.fromJson(responseData.getDefaultValueList!.toJson());
}, url, postParams);
}
Future<SubmitEITTransactionList> submitEitTransaction(String pDescFlexContextCode, String pFunctionName, List<Map<String, dynamic>> list) async {
String url = "${ApiConsts.erpRest}SUBMIT_EIT_TRANSACTION";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
"P_FUNCTION_NAME": pFunctionName,
//"EITTransactionTBL": list,
// "EITTransactionTBLModel": list,
};
postParams.addAll(AppState().postParamsJson);
print("postParams:$postParams");
postParams["EITTransactionTBL"] = list;
postParams["EITTransactionTBLModel"] = list;
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.submitEITTransactionList!; //ESERVICESDV.fromJson(responseData.getDefaultValueList!.toJson());
}, url, postParams);
}
Future<List<GetApprovesList>> getApproversList(String pAmeTransactionType, int pTransactionId) async {
String url = "${ApiConsts.erpRest}GET_APPROVERS_LIST";
Map<String, dynamic> postParams = {
"P_AME_TRANSACTION_TYPE": pAmeTransactionType,
"P_PAGE_LIMIT": 1000,
"P_PAGE_NUM": 1,
"P_TRANSACTION_ID": pTransactionId,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.getApprovesList ?? [];
}, url, postParams);
}
Future<List<GetApprovesList>> addAttachment(List<Map<String, dynamic>> list) async {
String url = "${ApiConsts.erpRest}ADD_ATTACHMENT";
Map<String, dynamic> postParams = {"AddAttachmentList": list};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.getApprovesList ?? [];
}, url, postParams);
}
Future<StartEitApprovalProcess?> startEitApprovalProcess(String action, String comments, String itemKey, int transactionId) async {
String url = "${ApiConsts.erpRest}START_EIT_APPROVAL_PROCESS";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_ACTION_MODE": action,
"P_COMMENTS": comments,
"P_ITEM_KEY": itemKey,
"P_TRANSACTION_ID": transactionId,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.startEitApprovalProcess;
}, url, postParams);
}
}

@ -29,6 +29,7 @@ class ProfileApiClient {
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
print(responseData);
return responseData.getEmployeeContactsList ?? [];
}, url, postParams);
}

@ -20,8 +20,17 @@ import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_mod
import 'package:mohem_flutter_app/models/itg_forms_models/itg_request_model.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:mohem_flutter_app/models/notification_get_respond_attributes_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
import 'package:mohem_flutter_app/models/worklist_response_model.dart';
import '../../models/worklist/hr/eit_otification_body_model.dart';
import '../../models/worklist/get_favorite_replacements_model.dart';
import '../../models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
import '../../models/worklist/hr/get_contact_notification_body_list_model.dart';
import '../../models/worklist/hr/get_phones_notification_body_list_model.dart';
import '../../models/worklist/hr/get_phones_notification_body_list_model.dart';
class WorkListApiClient {
static final WorkListApiClient _instance = WorkListApiClient._internal();
@ -168,20 +177,20 @@ class WorkListApiClient {
}, url, postParams);
}
Future<List<GetAbsenceCollectionNotificationBodyList>> getAbsenceNotificationBody(int pNotificationID, int pTransactionID) async {
String url = "${ApiConsts.erpRest}GET_ABSENCE_NOTIFICATION_BODY";
Map<String, dynamic> postParams = {
"P_NOTIFICATION_ID": pNotificationID,
"P_TRANSACTION_ID": pTransactionID,
"P_PAGE_LIMIT": 100,
"P_PAGE_NUM": 1,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.getAbsenceCollectionNotificationBodyList ?? [];
}, url, postParams);
}
// Future<List<GetAbsenceCollectionNotificationBodyList>> getAbsenceNotificationBody(int pNotificationID, int pTransactionID) async {
// String url = "${ApiConsts.erpRest}GET_ABSENCE_NOTIFICATION_BODY";
// Map<String, dynamic> postParams = {
// "P_NOTIFICATION_ID": pNotificationID,
// "P_TRANSACTION_ID": pTransactionID,
// "P_PAGE_LIMIT": 100,
// "P_PAGE_NUM": 1,
// };
// postParams.addAll(AppState().postParamsJson);
// return await ApiClient().postJsonForObject((json) {
// GenericResponseModel responseData = GenericResponseModel.fromJson(json);
// return responseData.getAbsenceCollectionNotificationBodyList ?? [];
// }, url, postParams);
// }
Future<GenericResponseModel> postNotificationActions(Map<String, dynamic> postParams) async {
String url = "${ApiConsts.erpRest}NOTIFICATION_ACTIONS";
@ -295,4 +304,148 @@ class WorkListApiClient {
return responseData.itgRequest;
}, url, postParams);
}
//HR Detail Screen Requests
Future<List<GetEitCollectionNotificationBodyList>?> GetEitNotificationBody(int? notificationId) async {
String url = "${ApiConsts.erpRest}GET_EIT_NOTIFICATION_BODY";
Map<String, dynamic> postParams = {
"P_NOTIFICATION_ID": notificationId,
"P_PAGE_LIMIT": 100,
"P_PAGE_NUM": 1,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.getEITCollectionNotificationBodyList;
}, url, postParams);
}
Future<List<GetPhonesNotificationBodyList>?> getPhonesNotificationBodyList(int? notificationId) async {
String url = "${ApiConsts.erpRest}GET_PHONES_NOTIFICATION_BODY";
Map<String, dynamic> postParams = {
"P_NOTIFICATION_ID": notificationId,
"P_PAGE_LIMIT": 100,
"P_PAGE_NUM": 1,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.getPhonesNotificationBodyList;
}, url, postParams);
}
Future<List<GetBasicDetNtfBodyList>?> getBasicDetNtfBodyList(int? notificationId) async {
String url = "${ApiConsts.erpRest}GET_BASIC_DET_NTF_BODY";
Map<String, dynamic> postParams = {
"P_NOTIFICATION_ID": notificationId,
"P_PAGE_LIMIT": 100,
"P_PAGE_NUM": 1,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.getBasicDetNtfBodyList;
}, url, postParams);
}
Future<List<GetAbsenceCollectionNotificationBodyList>?> getAbsenceNotificationBody(int? notificationId) async {
String url = "${ApiConsts.erpRest}GET_ABSENCE_NOTIFICATION_BODY";
Map<String, dynamic> postParams = {
"P_NOTIFICATION_ID": notificationId,
"P_PAGE_LIMIT": 100,
"P_PAGE_NUM": 1,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.getAbsenceCollectionNotificationBodyList;
}, url, postParams);
}
Future<GetContactNotificationBodyList?> getContactNotificationBodyList(int? notificationId) async {
String url = "${ApiConsts.erpRest}GET_CONTACT_NOTIFICATION_BODY";
Map<String, dynamic> postParams = {
"P_NOTIFICATION_ID": notificationId,
"P_PAGE_LIMIT": 100,
"P_PAGE_NUM": 1,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.getContactNotificationBodyList;
}, url, postParams);
}
Future<List<GetFavoriteReplacements>?> getFavoriteReplacementWithoutImage() async {
String url = "${ApiConsts.erpRest}Mohemm_GetFavoriteReplacementsWithoutImage";
Map<String, dynamic> postParams = {};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.mohemmGetFavoriteReplacementsList;
}, url, postParams);
}
Future<List<GetFavoriteReplacements>?> getFavoriteReplacementWithImage(String selectedFavLetter) async {
String url = "${ApiConsts.erpRest}Mohemm_GetFavoriteReplacements";
Map<String, dynamic> postParams = {"ItgFilter": selectedFavLetter};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.mohemmGetFavoriteReplacementsList;
}, url, postParams);
}
Future<GenericResponseModel> changeFavoriteReplacements({required String email, required String employeName, required String image, required String userName, bool isFav = false}) async {
String url = "${ApiConsts.erpRest}Mohemm_ChangeFavoriteReplacements";
Map<String, dynamic> postParamsObj = {
"EMAIL_ADDRESS": email,
"EMPLOYEE_DISPLAY_NAME": employeName,
"EMPLOYEE_IMAGE": image,
"IsFavorite": isFav,
"USER_NAME": userName,
};
Map<String, dynamic> postParams = {
"Mohemm_ChangeReplacementsInputList": [postParamsObj],
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData;
}, url, postParams);
}
Future<List<ReplacementList>?> searchUserByInput({String userId = "", String userName = "", String email = ""}) async {
String url = "${ApiConsts.erpRest}GET_REPLACEMENT_LIST";
Map<String, dynamic> postParams = {
"P_SEARCH_USER_NAME": userId,
"P_SEARCH_EMPLOYEE_DISPLAY_NAME": userName,
"P_SEARCH_EMAIL_ADDRESS": email,
"P_PAGE_LIMIT": 50,
"P_PAGE_NUM": 1,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.replacementList;
}, url, postParams);
}
Future<GenericResponseModel> submitComment({String? comment, String? email, String? userId, int? notificationId, required String apiMode}) async {
String url = "${ApiConsts.erpRest}NOTIFICATION_ACTIONS";
Map<String, dynamic> postParams = {
"P_COMMENTS": comment,
"P_ACTION_MODE": apiMode,
"P_EMAIL_ADDRESS": email,
"P_FORWARD_TO_USER_NAME": userId,
"P_NOTIFICATION_ID": notificationId,
"P_APPROVER_INDEX": null,
"RespondAttributeList": []
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData;
}, url, postParams);
}
}

@ -29,6 +29,19 @@ class AppState {
String? get getForgetPasswordTokenID => forgetPasswordTokenID;
//Wifi info
String? mohemmWifiSSID;
set setMohemmWifiSSID(v) => mohemmWifiSSID = mohemmWifiSSID;
String? get getMohemmWifiSSID => mohemmWifiSSID;
String? mohemmWifiPassword;
set setMohemmWifiPassword(v) => mohemmWifiPassword = v;
String? get getMohemmWifiPassword => mohemmWifiPassword;
PostParamsModel? _postParams;
PostParamsModel? get postParamsObject => _postParams;

@ -27,7 +27,7 @@ class MyColors {
static const Color white = Color(0xffffffff);
static const Color green = Color(0xffffffff);
static const Color borderColor = Color(0xffE8E8E8);
// static const Color grey67Color = Color(0xff676767);
//static const Color grey67Color = Color(0xff676767);
static const Color whiteColor = Color(0xFFEEEEEE);
static const Color greenColor = Color(0xff1FA269);
static const Color lightGreenColor = Color(0xff2AB2AB);

@ -1,7 +1,7 @@
class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
//static String baseUrl = "https://hmgwebservices.com"; // Live 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/";
@ -20,4 +20,6 @@ class SharedPrefsConsts {
static String memberInformation = "memberInformation";
static String welcomeVideoUrl = "welcomeVideoUrl";
static String doNotShowWelcomeVideo = "doNotShowWelcomeVideo";
static String mohemmWifiSSID = "mohemmWifiSSID";
static String mohemmWifiPassword = "mohemmWifiPassword";
}

@ -17,9 +17,15 @@ class Utils {
static bool get isLoading => _isLoadingVisible;
static void showToast(String message) {
static void showToast(String message, {bool longDuration = false}) {
Fluttertoast.showToast(
msg: message, toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.BOTTOM, timeInSecForIosWeb: 1, backgroundColor: Colors.black54, textColor: Colors.white, fontSize: 16.0);
msg: message,
toastLength: longDuration ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: Colors.black54,
textColor: Colors.white,
fontSize: 16.0);
}
static dynamic getNotNullValue(List<dynamic> list, int index) {
@ -39,7 +45,7 @@ class Utils {
}
static void showLoading(BuildContext context) {
WidgetsBinding.instance?.addPostFrameCallback((_) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_isLoadingVisible = true;
showDialog(
context: context,

@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/ui/attendance/monthly_attendance.dart';
import 'package:mohem_flutter_app/ui/bottom_sheets/attendence_details_bottom_sheet.dart';
import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart';
import 'package:mohem_flutter_app/ui/landing/today_attendance_screen.dart';
import 'package:mohem_flutter_app/ui/login/forgot_password_screen.dart';
@ -6,26 +8,25 @@ import 'package:mohem_flutter_app/ui/login/login_screen.dart';
import 'package:mohem_flutter_app/ui/login/new_password_screen.dart';
import 'package:mohem_flutter_app/ui/login/verify_last_login_screen.dart';
import 'package:mohem_flutter_app/ui/login/verify_login_screen.dart';
import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/my_attendance_screen.dart';
import 'package:mohem_flutter_app/ui/profile/basic_details.dart';
import 'package:mohem_flutter_app/ui/profile/contact_details.dart';
import 'package:mohem_flutter_app/ui/profile/delete_familyMember.dart';
import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_profile_screen.dart';
import 'package:mohem_flutter_app/ui/profile/family_members.dart';
import 'package:mohem_flutter_app/ui/profile/personal_info.dart';
// import 'package:mohem_flutter_app/ui/my_attendance/work_from_home_screen.dart';
import 'package:mohem_flutter_app/ui/screens/eit/add_eit.dart';
import 'package:mohem_flutter_app/ui/screens/profile/profile_screen.dart';
import 'package:mohem_flutter_app/ui/screens/submenu_screen.dart';
import 'package:mohem_flutter_app/ui/profile/family_members.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/ui/work_list/item_history_screen.dart';
import 'package:mohem_flutter_app/ui/work_list/itg_detail_screen.dart';
import 'package:mohem_flutter_app/ui/work_list/worklist_detail_screen.dart';
import 'package:mohem_flutter_app/ui/work_list/work_list_screen.dart';
import 'package:mohem_flutter_app/ui/bottom_sheets/attendence_details_bottom_sheet.dart';
import 'package:mohem_flutter_app/ui/attendance/monthly_attendance.dart';
import 'package:mohem_flutter_app/ui/profile/profile.dart';
import 'package:mohem_flutter_app/ui/profile/personal_info.dart';
import 'package:mohem_flutter_app/ui/profile/basic_details.dart';
import 'package:mohem_flutter_app/ui/profile/contact_details.dart';
import 'package:mohem_flutter_app/ui/profile/family_members.dart';
import 'package:mohem_flutter_app/ui/work_list/worklist_detail_screen.dart';
class AppRoutes {
static const String splash = "/splash";
@ -52,10 +53,12 @@ class AppRoutes {
static const String myAttendance = "/myAttendance";
static const String dynamicScreen = "/dynamicScreen";
static const String addDynamicInput = "/addDynamicInput";
static const String requestSubmitScreen = "/requestSubmitScreen";
//profile
static const String addDynamicInputProfile = 'addDynamicInputProfile';
//Attendance
static const String attendance = "/attendance";
static const String monthlyAttendance = "/monthlyAttendance";
@ -69,6 +72,7 @@ class AppRoutes {
static const String basicDetails = "/basicDetails";
static const String contactDetails = "/contactDetails";
static const String familyMembers = "/familyMembers";
static const String deleteFamilyMember = "/deleteFamilyMember";
static final Map<String, WidgetBuilder> routes = {
login: (context) => LoginScreen(),
@ -110,5 +114,7 @@ class AppRoutes {
dynamicScreen: (context) => DynamicListViewScreen(),
addDynamicInput: (context) => DynamicInputScreen(),
addDynamicInputProfile: (context) => DynamicInputScreenProfile(),
deleteFamilyMember: (context) => DeleteFamilyMember(),
requestSubmitScreen: (context) => RequestSubmitScreen(),
};
}

@ -1,8 +1,6 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/cupertino.dart';
import 'package:intl/intl.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
extension CapExtension on String {
String get toCamelCase => "${this[0].toUpperCase()}${this.substring(1)}";
@ -54,8 +52,9 @@ extension EmailValidator on String {
style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 14, letterSpacing: -0.48, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
Widget toText16({Color? color, bool isBold = false}) => Text(
Widget toText16({Color? color, bool isBold = false,int? maxlines}) => Text(
this,
maxLines: maxlines,
style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 16, letterSpacing: -0.64, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
@ -63,19 +62,20 @@ extension EmailValidator on String {
this,
style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 17, letterSpacing: -0.68, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
Widget toText20({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(fontSize: 20, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
);
this,
style: TextStyle(fontSize: 20, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
);
Widget toText22({Color? color, bool isBold = false}) => Text(
this,
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 considerHeight = true}) => Text(
Widget toText24({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(height: considerHeight ? 23 / 24 : null, color: color ?? MyColors.darkTextColor, fontSize: 24, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
style: TextStyle(height: 23 / 24, color: color ?? MyColors.darkTextColor, fontSize: 24, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
Widget toText32({Color? color, bool isBold = false}) => Text(
@ -84,9 +84,9 @@ extension EmailValidator on String {
);
Widget toText44({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 44, letterSpacing: -2.64, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
this,
style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 44, letterSpacing: -2.64, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) {
String upper = "";

@ -40,7 +40,7 @@ class CodegenLoader extends AssetLoader{
"checkIn": "تحقق في",
"workList": "قائمة العمل",
"leaveBalance": "رصيد الاجازات",
"missingSwipes": "الضربات الشديدة في عداد المفقودين",
"missingSwipes": "تسجيل بصمة حضور",
"ticketBalance": "رصيد التذكرة",
"other": "آخر",
"services": "خدمات",
@ -72,10 +72,10 @@ class CodegenLoader extends AssetLoader{
"order": "الطلبات",
"earlyOut": "الخروج مبكرا",
"shortage": "ساعات التقصير",
"excess": "Excess",
"excess": "فائض",
"lateIn": "القدوم المتاخر",
"approvedCheckOut": "وقت الخروج",
"approvedCheckIn": "وقت الدخول",
"approvedCheckOut": "اعتماد وقت الخروج",
"approvedCheckIn": "اعتماد وقت الدخول",
"actualCheckOut": "وقت الخروج",
"actualCheckIn": "وقت الدخول",
"present": "حضور",
@ -245,8 +245,9 @@ class CodegenLoader extends AssetLoader{
"approvalLevel": "مستوى الموافقة",
"requesterDetails": "تفاصيل مقدم الطلب",
"myAttendance": "حضوري",
"workOnBreak": "العمل على استراحة",
"workOnBreak": "التعويض عن العمل اثناءالاستراحه",
"next": "التالي",
"mobile": "التليفون المحمول",
"completingYear": "نحن نقدر لك لاستكمال خدمة",
"year": "سنة",
"month": "شهر",
@ -260,6 +261,12 @@ class CodegenLoader extends AssetLoader{
"maritalStatus ": "الحالة الاجتماعية",
"fullName": "الأسم الكامل",
"remove": "حذف",
"submit": "ارسال",
"areYouSureYouWantToSubmit": "هل أنت متأكد أنك تريد أن تقدم؟",
"comments": "تعليقات",
"writeComment": "أكتب تعليقا",
"approversList": "قائمة الموافقين",
"yourRequestHasBeenSubmittedForApprovals": "تم تقديم طلبك للموافقات",
"profile": {
"reset_password": {
"label": "Reset Password",
@ -340,7 +347,7 @@ static const Map<String,dynamic> en_US = {
"setTheNewPassword": "Set the new password",
"typeYourNewPasswordBelow": "Type your new password below",
"confirmPassword": "Confirm Password",
"update": "update",
"update": "Update",
"title": "Title",
"home": "Home",
"mySalary": "My Salary",
@ -363,10 +370,10 @@ static const Map<String,dynamic> en_US = {
"approvedCheckIn": "Approved Check In",
"actualCheckOut": "Actual Check Out",
"actualCheckIn": "Actual Check In",
"present": "PRESENT 11",
"present": "PRESENT",
"pres": "present",
"shiftTime": "Shift Time",
"absent": "ABSENT 10",
"absent": "ABSENT",
"attendance": "Attendance",
"scheduleDays": "Schedule\nDays",
"offDays": "Off\nDays",
@ -532,6 +539,7 @@ static const Map<String,dynamic> en_US = {
"myAttendance": "My Attendance",
"workOnBreak": "Work On Break",
"next": "Next",
"mobile": "Mobile",
"year": "Year",
"month": "Month",
"day": "Day",
@ -544,7 +552,14 @@ static const Map<String,dynamic> en_US = {
"dateOfBirth": "Date of Birth",
"maritalStatus ": "Marital Status ",
"fullName": "Full Name",
"remove": "remove",
"remove": "Remove",
"Attendance": "Attendance",
"submit": "Submit",
"areYouSureYouWantToSubmit": "Are you sure you want to submit?",
"comments": "Comments",
"writeComment": "Write a comment",
"approversList": "Approvers List",
"yourRequestHasBeenSubmittedForApprovals": "Your request has been submitted for approvals",
"profile": {
"reset_password": {
"label": "Reset Password",

@ -232,6 +232,7 @@ abstract class LocaleKeys {
static const myAttendance = 'myAttendance';
static const workOnBreak = 'workOnBreak';
static const next = 'next';
static const mobile = 'mobile';
static const completingYear = 'completingYear';
static const year = 'year';
static const month = 'month';
@ -245,6 +246,12 @@ abstract class LocaleKeys {
static const maritalStatus = 'maritalStatus ';
static const fullName = 'fullName';
static const remove = 'remove';
static const submit = 'submit';
static const areYouSureYouWantToSubmit = 'areYouSureYouWantToSubmit';
static const comments = 'comments';
static const writeComment = 'writeComment';
static const approversList = 'approversList';
static const yourRequestHasBeenSubmittedForApprovals = 'yourRequestHasBeenSubmittedForApprovals';
static const profile_reset_password_label = 'profile.reset_password.label';
static const profile_reset_password_username = 'profile.reset_password.username';
static const profile_reset_password_password = 'profile.reset_password.password';

@ -1,23 +1,23 @@
import 'dart:io';
import 'dart:typed_data';
import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:logger/logger.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/config/app_provider.dart';
import 'package:mohem_flutter_app/generated/codegen_loader.g.dart';
import 'package:mohem_flutter_app/models/post_params_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/provider/eit_provider_model.dart';
import 'package:mohem_flutter_app/theme/app_theme.dart';
import 'package:mohem_flutter_app/widgets/nfc/nfc_reader_sheet.dart';
import 'package:month_year_picker/month_year_picker.dart';
import 'package:nfc_manager/nfc_manager.dart';
import 'package:nfc_manager/platform_tags.dart';
import 'package:provider/provider.dart';
import 'package:sizer/sizer.dart';
import 'package:firebase_core/firebase_core.dart';
import 'config/routes.dart';
import 'package:logger/logger.dart';
var logger = Logger(
// filter: null, // Use the default LogFilter (-> only log in debug mode)
@ -30,7 +30,7 @@ Future<void> main() async {
await EasyLocalization.ensureInitialized();
await Firebase.initializeApp();
AppState().setPostParamsModel(
PostParamsModel(channel: 31, versionID: 3.6, mobileType: Platform.isAndroid ? "android" : "ios"),
PostParamsModel(channel: 31, versionID: 5.0, mobileType: Platform.isAndroid ? "android" : "ios"),
);
runApp(
EasyLocalization(
@ -68,12 +68,22 @@ class MyApp extends StatelessWidget {
builder: (context, orientation, deviceType) {
print(AppState().postParamsObject?.toJson());
var obj = AppState().postParamsObject;
obj?.languageID = EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2;
obj?.languageID = EasyLocalization
.of(context)
?.locale
.languageCode == "ar" ? 1 : 2;
AppState().setPostParamsModel(obj!);
List<LocalizationsDelegate> delegates = context.localizationDelegates;
// delegates.add(GlobalMaterialLocalizations.delegate);
delegates.add(MonthYearPickerLocalizations.delegate,);
return MaterialApp(
theme: AppTheme.getTheme(EasyLocalization.of(context)?.locale.languageCode == "ar"),
theme: AppTheme.getTheme(EasyLocalization
.of(context)
?.locale
.languageCode == "ar"),
debugShowCheckedModeBanner: false,
localizationsDelegates: context.localizationDelegates,
localizationsDelegates
:delegates,
supportedLocales: context.supportedLocales,
locale: context.locale,
initialRoute: AppRoutes.initialRoute,

@ -0,0 +1,18 @@
class AddAttSuccessList {
bool? addSuccess;
int? attachmentID;
AddAttSuccessList({this.addSuccess, this.attachmentID});
AddAttSuccessList.fromJson(Map<String, dynamic> json) {
addSuccess = json['AddSuccess'];
attachmentID = json['AttachmentID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AddSuccess'] = this.addSuccess;
data['AttachmentID'] = this.attachmentID;
return data;
}
}

@ -0,0 +1,18 @@
class AddAttachmentList {
String? pRETURNMSG;
String? pRETURNSTATUS;
AddAttachmentList({this.pRETURNMSG, this.pRETURNSTATUS});
AddAttachmentList.fromJson(Map<String, dynamic> json) {
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
return data;
}
}

@ -0,0 +1,27 @@
class AttachmentModel {
int? attachmentID;
String? pFILECONTENTTYPE;
String? pFILEDATA;
String? pFILENAME;
int? pTRANSACTIONID;
AttachmentModel({this.attachmentID, this.pFILECONTENTTYPE, this.pFILEDATA, this.pFILENAME, this.pTRANSACTIONID});
AttachmentModel.fromJson(Map<String, dynamic> json) {
attachmentID = json['AttachmentID'];
pFILECONTENTTYPE = json['P_FILE_CONTENT_TYPE'];
pFILEDATA = json['P_FILE_DATA'];
pFILENAME = json['P_FILE_NAME'];
pTRANSACTIONID = json['P_TRANSACTION_ID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AttachmentID'] = this.attachmentID;
data['P_FILE_CONTENT_TYPE'] = this.pFILECONTENTTYPE;
data['P_FILE_DATA'] = this.pFILEDATA;
data['P_FILE_NAME'] = this.pFILENAME;
data['P_TRANSACTION_ID'] = this.pTRANSACTIONID;
return data;
}
}

@ -0,0 +1,27 @@
class ValidateEitTransactionModel {
int? tRANSACTIONNUMBER;
String? nAME;
String? vARCHAR2VALUE;
int? nUMBERVALUE;
String? dATEVALUE;
ValidateEitTransactionModel({this.tRANSACTIONNUMBER, this.nAME, this.vARCHAR2VALUE, this.nUMBERVALUE, this.dATEVALUE});
ValidateEitTransactionModel.fromJson(Map<String, dynamic> json) {
tRANSACTIONNUMBER = json['TRANSACTION_NUMBER'];
nAME = json['NAME'];
vARCHAR2VALUE = json['VARCHAR2_VALUE'];
nUMBERVALUE = json['NUMBER_VALUE'];
dATEVALUE = json['DATE_VALUE'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['TRANSACTION_NUMBER'] = this.tRANSACTIONNUMBER;
data['NAME'] = this.nAME;
data['VARCHAR2_VALUE'] = this.vARCHAR2VALUE;
data['NUMBER_VALUE'] = this.nUMBERVALUE;
data['DATE_VALUE'] = this.dATEVALUE;
return data;
}
}

@ -1,7 +1,11 @@
import 'package:mohem_flutter_app/models/add_att_success_list_model.dart';
import 'package:mohem_flutter_app/models/add_attachment_list_model.dart';
import 'package:mohem_flutter_app/models/get_absence_collection_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_action_history_list_model.dart';
import 'package:mohem_flutter_app/models/get_approves_list_model.dart';
import 'package:mohem_flutter_app/models/get_attachement_list_model.dart';
import 'package:mohem_flutter_app/models/get_basic_det_ntf_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_default_value_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
import 'package:mohem_flutter_app/models/get_eit_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart';
@ -27,7 +31,15 @@ import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.d
import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart';
import 'package:mohem_flutter_app/models/profile/phone_number_types_modek.dart';
import 'package:mohem_flutter_app/models/profile/submit_phone_transactions.dart';
import 'package:mohem_flutter_app/models/start_eit_approval_process_model.dart';
import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/subordinates_on_leaves_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
import 'package:mohem_flutter_app/models/validate_eit_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/worklist_response_model.dart';
import 'basic_member_information_model.dart';
@ -68,8 +80,8 @@ class GenericResponseModel {
String? successMsg;
String? successMsgN;
String? vidaUpdatedResponse;
String? addAttSuccessList;
String? addAttachmentList;
List<AddAttSuccessList>? addAttSuccessList;
AddAttachmentList? addAttachmentList;
String? bCDomain;
String? bCLogo;
BasicMemberInformationModel? basicMemberInformation;
@ -98,7 +110,7 @@ class GenericResponseModel {
List<GetActionHistoryList>? getActionHistoryList;
List<String>? getAddressDffStructureList;
List<String>? getAddressNotificationBodyList;
List<String>? getApprovesList;
List<GetApprovesList>? getApprovesList;
List<GetAttachementList>? getAttachementList;
GetAttendanceTracking? getAttendanceTrackingList;
List<GetBasicDetColsStructureList>? getBasicDetColsStructureList;
@ -115,12 +127,12 @@ class GenericResponseModel {
List<String>? getContactColsStructureList;
List<String>? getContactDetailsList;
List<String>? getContactDffStructureList;
List<String>? getContactNotificationBodyList;
GetContactNotificationBodyList? getContactNotificationBodyList;
List<String>? getCountriesList;
List<GetDayHoursTypeDetailsList>? getDayHoursTypeDetailsList;
List<String>? getDeductionsList;
List<String>? getDefaultValueList;
List<String>? getEITCollectionNotificationBodyList;
GetDefaultValueList? getDefaultValueList;
List<GetEitCollectionNotificationBodyList>? getEITCollectionNotificationBodyList;
List<GetEITDFFStructureList>? getEITDFFStructureList;
List<GetEITTransactionList>? getEITTransactionList;
List<String>? getEarningsList;
@ -152,7 +164,7 @@ class GenericResponseModel {
List<String>? getPendingReqDetailsList;
List<String>? getPendingReqFunctionsList;
List<String>? getPerformanceAppraisalList;
List<String>? getPhonesNotificationBodyList;
List<GetPhonesNotificationBodyList>? getPhonesNotificationBodyList;
List<GetPoItemHistoryList>? getPoItemHistoryList;
GetPoNotificationBodyList? getPoNotificationBodyList;
List<String>? getPrNotificationBodyList;
@ -209,7 +221,7 @@ class GenericResponseModel {
List<MemberInformationListModel>? memberInformationList;
MemberLoginListModel? memberLoginList;
String? mohemmGetBusinessCardEnabledList;
List? mohemmGetFavoriteReplacementsList;
List<GetFavoriteReplacements>? mohemmGetFavoriteReplacementsList;
String? mohemmGetMobileDeviceInfobyEmpInfoList;
List<GetMobileLoginInfoListModel>? mohemmGetMobileLoginInfoList;
String? mohemmGetPatientIDList;
@ -240,7 +252,7 @@ class GenericResponseModel {
List<PrivilegeListModel>? privilegeList;
String? processTransactions;
String? registerUserNameList;
String? replacementList;
List<ReplacementList>? replacementList;
String? respondAttributesList;
String? respondRolesList;
String? resubmitAbsenceTransactionList;
@ -253,7 +265,7 @@ class GenericResponseModel {
String? startBasicDetApprProcessList;
String? startCeiApprovalProcess;
String? startContactApprovalProcessList;
String? startEitApprovalProcess;
StartEitApprovalProcess? startEitApprovalProcess;
String? startHrApprovalProcessList;
String? startPhonesApprovalProcessList;
String? startSitApprovalProcess;
@ -263,7 +275,7 @@ class GenericResponseModel {
String? submitCEITransactionList;
String? submitCcpTransactionList;
String? submitContactTransactionList;
String? submitEITTransactionList;
SubmitEITTransactionList? submitEITTransactionList;
String? submitHrTransactionList;
SubmitPhonesTransactionList? submitPhonesTransactionList;
String? submitSITTransactionList;
@ -282,7 +294,7 @@ class GenericResponseModel {
String? vHRGetProjectByCodeList;
bool? vHRIsVerificationCodeValid;
String? validateAbsenceTransactionList;
String? validateEITTransactionList;
ValidateEITTransactionList? validateEITTransactionList;
String? validatePhonesTransactionList;
String? vrItemTypesList;
String? wFLookUpList;
@ -574,8 +586,13 @@ class GenericResponseModel {
successMsg = json['SuccessMsg'];
successMsgN = json['SuccessMsgN'];
vidaUpdatedResponse = json['VidaUpdatedResponse'];
addAttSuccessList = json['AddAttSuccessList'];
addAttachmentList = json['AddAttachment_List'];
if (json['AddAttSuccessList'] != null) {
addAttSuccessList = <AddAttSuccessList>[];
json['AddAttSuccessList'].forEach((v) {
addAttSuccessList!.add(new AddAttSuccessList.fromJson(v));
});
}
addAttachmentList = json['AddAttachment_List'] != null ? new AddAttachmentList.fromJson(json['AddAttachment_List']) : null;
bCDomain = json['BC_Domain'];
bCLogo = json['BC_Logo'];
basicMemberInformation = json['BasicMemberInformation'] != null ? new BasicMemberInformationModel.fromJson(json['BasicMemberInformation']) : null;
@ -618,7 +635,13 @@ class GenericResponseModel {
getAddressDffStructureList = json['GetAddressDffStructureList'];
getAddressNotificationBodyList = json['GetAddressNotificationBodyList'];
getApprovesList = json['GetApprovesList'];
if (json['GetApprovesList'] != null) {
getApprovesList = <GetApprovesList>[];
json['GetApprovesList'].forEach((v) {
getApprovesList!.add(new GetApprovesList.fromJson(v));
});
}
if (json['GetAttachementList'] != null) {
getAttachementList = <GetAttachementList>[];
@ -658,7 +681,7 @@ class GenericResponseModel {
getContactColsStructureList = json['GetContactColsStructureList'];
getContactDetailsList = json['GetContactDetailsList'];
getContactDffStructureList = json['GetContactDffStructureList'];
getContactNotificationBodyList = json['GetContactNotificationBodyList'];
getContactNotificationBodyList = json["GetContactNotificationBodyList"] == null ? null : GetContactNotificationBodyList.fromJson(json["GetContactNotificationBodyList"]);
getCountriesList = json['GetCountriesList'];
if (json['GetDayHoursTypeDetailsList'] != null) {
getDayHoursTypeDetailsList = <GetDayHoursTypeDetailsList>[];
@ -667,8 +690,10 @@ class GenericResponseModel {
});
}
getDeductionsList = json['GetDeductionsList'];
getDefaultValueList = json['GetDefaultValueList'];
getEITCollectionNotificationBodyList = json['GetEITCollectionNotificationBodyList'];
getDefaultValueList = json['GetDefaultValueList'] != null ? GetDefaultValueList.fromJson(json['GetDefaultValueList']) : null;
getEITCollectionNotificationBodyList = json["GetEITCollectionNotificationBodyList"] == null
? null
: List<GetEitCollectionNotificationBodyList>.from(json["GetEITCollectionNotificationBodyList"].map((x) => GetEitCollectionNotificationBodyList.fromJson(x)));
if (json['GetEITDFFStructureList'] != null) {
getEITDFFStructureList = <GetEITDFFStructureList>[];
json['GetEITDFFStructureList'].forEach((v) {
@ -755,7 +780,8 @@ class GenericResponseModel {
getPendingReqDetailsList = json['GetPendingReqDetailsList'];
getPendingReqFunctionsList = json['GetPendingReqFunctionsList'];
getPerformanceAppraisalList = json['GetPerformanceAppraisalList'];
getPhonesNotificationBodyList = json['GetPhonesNotificationBodyList'];
getPhonesNotificationBodyList =
json["GetPhonesNotificationBodyList"] == null ? null : List<GetPhonesNotificationBodyList>.from(json["GetPhonesNotificationBodyList"].map((x) => GetPhonesNotificationBodyList.fromJson(x)));
if (json['GetPoItemHistoryList'] != null) {
getPoItemHistoryList = <GetPoItemHistoryList>[];
json['GetPoItemHistoryList'].forEach((v) {
@ -870,7 +896,9 @@ class GenericResponseModel {
}
memberLoginList = json['MemberLoginList'] != null ? MemberLoginListModel.fromJson(json['MemberLoginList']) : null;
mohemmGetBusinessCardEnabledList = json['Mohemm_GetBusinessCardEnabledList'];
mohemmGetFavoriteReplacementsList = json['Mohemm_GetFavoriteReplacementsList'];
mohemmGetFavoriteReplacementsList =
json["Mohemm_GetFavoriteReplacementsList"] == null ? null : List<GetFavoriteReplacements>.from(json["Mohemm_GetFavoriteReplacementsList"].map((x) => GetFavoriteReplacements.fromJson(x)));
mohemmGetMobileDeviceInfobyEmpInfoList = json['Mohemm_GetMobileDeviceInfobyEmpInfoList'];
if (json['Mohemm_GetMobileLoginInfoList'] != null) {
mohemmGetMobileLoginInfoList = <GetMobileLoginInfoListModel>[];
@ -925,7 +953,7 @@ class GenericResponseModel {
processTransactions = json['ProcessTransactions'];
registerUserNameList = json['RegisterUserNameList'];
replacementList = json['ReplacementList'];
replacementList = json["ReplacementList"] == null ? null : List<ReplacementList>.from(json["ReplacementList"].map((x) => ReplacementList.fromJson(x)));
respondAttributesList = json['RespondAttributesList'];
respondRolesList = json['RespondRolesList'];
resubmitAbsenceTransactionList = json['ResubmitAbsenceTransactionList'];
@ -938,7 +966,8 @@ class GenericResponseModel {
startBasicDetApprProcessList = json['StartBasicDetApprProcessList'];
startCeiApprovalProcess = json['StartCeiApprovalProcess'];
startContactApprovalProcessList = json['StartContactApprovalProcessList'];
startEitApprovalProcess = json['StartEitApprovalProcess'];
startEitApprovalProcess = json['StartEitApprovalProcess'] != null ? new StartEitApprovalProcess.fromJson(json['StartEitApprovalProcess']) : null;
startHrApprovalProcessList = json['StartHrApprovalProcessList'];
startPhonesApprovalProcessList = json['StartPhonesApprovalProcessList'];
startSitApprovalProcess = json['StartSitApprovalProcess'];
@ -948,7 +977,8 @@ class GenericResponseModel {
submitCEITransactionList = json['SubmitCEITransactionList'];
submitCcpTransactionList = json['SubmitCcpTransactionList'];
submitContactTransactionList = json['SubmitContactTransactionList'];
submitEITTransactionList = json['SubmitEITTransactionList'];
submitEITTransactionList = json['SubmitEITTransactionList'] != null ? new SubmitEITTransactionList.fromJson(json['SubmitEITTransactionList']) : null;
submitHrTransactionList = json['SubmitHrTransactionList'];
submitPhonesTransactionList = json['SubmitPhonesTransactionList'];
@ -975,7 +1005,9 @@ class GenericResponseModel {
vHRGetProjectByCodeList = json['VHR_GetProjectByCodeList'];
vHRIsVerificationCodeValid = json['VHR_IsVerificationCodeValid'];
validateAbsenceTransactionList = json['ValidateAbsenceTransactionList'];
validateEITTransactionList = json['ValidateEITTransactionList'];
validateEITTransactionList = json['ValidateEITTransactionList'] != null ? new ValidateEITTransactionList.fromJson(json['ValidateEITTransactionList']) : null;
validatePhonesTransactionList = json['ValidatePhonesTransactionList'];
vrItemTypesList = json['VrItemTypesList'];
wFLookUpList = json['WFLookUpList'];
@ -1016,8 +1048,14 @@ class GenericResponseModel {
data['SuccessMsg'] = this.successMsg;
data['SuccessMsgN'] = this.successMsgN;
data['VidaUpdatedResponse'] = this.vidaUpdatedResponse;
data['AddAttSuccessList'] = this.addAttSuccessList;
data['AddAttachment_List'] = this.addAttachmentList;
if (this.addAttSuccessList != null) {
data['AddAttSuccessList'] = this.addAttSuccessList!.map((v) => v.toJson()).toList();
}
if (this.addAttachmentList != null) {
data['AddAttachment_List'] = this.addAttachmentList!.toJson();
}
data['BC_Domain'] = this.bCDomain;
data['BC_Logo'] = this.bCLogo;
if (this.basicMemberInformation != null) {
@ -1056,7 +1094,10 @@ class GenericResponseModel {
data['GetAddressDffStructureList'] = this.getAddressDffStructureList;
data['GetAddressNotificationBodyList'] = this.getAddressNotificationBodyList;
data['GetApprovesList'] = this.getApprovesList;
if (this.getApprovesList != null) {
data['GetApprovesList'] = this.getApprovesList!.map((v) => v.toJson()).toList();
}
if (this.getAttachementList != null) {
data['GetAttachementList'] = this.getAttachementList!.map((v) => v.toJson()).toList();
@ -1087,7 +1128,9 @@ class GenericResponseModel {
data['GetDayHoursTypeDetailsList'] = this.getDayHoursTypeDetailsList!.map((v) => v.toJson()).toList();
}
data['GetDeductionsList'] = this.getDeductionsList;
data['GetDefaultValueList'] = this.getDefaultValueList;
if (this.getDefaultValueList != null) {
data['GetDefaultValueList'] = this.getDefaultValueList!.toJson();
}
data['GetEITCollectionNotificationBodyList'] = this.getEITCollectionNotificationBodyList;
if (this.getEITDFFStructureList != null) {
data['GetEITDFFStructureList'] = this.getEITDFFStructureList!.map((v) => v.toJson()).toList();
@ -1290,7 +1333,10 @@ class GenericResponseModel {
data['StartBasicDetApprProcessList'] = this.startBasicDetApprProcessList;
data['StartCeiApprovalProcess'] = this.startCeiApprovalProcess;
data['StartContactApprovalProcessList'] = this.startContactApprovalProcessList;
data['StartEitApprovalProcess'] = this.startEitApprovalProcess;
if (this.startEitApprovalProcess != null) {
data['StartEitApprovalProcess'] = this.startEitApprovalProcess!.toJson();
}
data['StartHrApprovalProcessList'] = this.startHrApprovalProcessList;
data['StartPhonesApprovalProcessList'] = this.startPhonesApprovalProcessList;
data['StartSitApprovalProcess'] = this.startSitApprovalProcess;
@ -1300,7 +1346,11 @@ class GenericResponseModel {
data['SubmitCEITransactionList'] = this.submitCEITransactionList;
data['SubmitCcpTransactionList'] = this.submitCcpTransactionList;
data['SubmitContactTransactionList'] = this.submitContactTransactionList;
data['SubmitEITTransactionList'] = this.submitEITTransactionList;
if (this.submitEITTransactionList != null) {
data['SubmitEITTransactionList'] = this.submitEITTransactionList!.toJson();
}
data['SubmitHrTransactionList'] = this.submitHrTransactionList;
data['SubmitPhonesTransactionList'] = this.submitPhonesTransactionList;
data['SubmitSITTransactionList'] = this.submitSITTransactionList;
@ -1324,7 +1374,11 @@ class GenericResponseModel {
data['VHR_GetProjectByCodeList'] = this.vHRGetProjectByCodeList;
data['VHR_IsVerificationCodeValid'] = this.vHRIsVerificationCodeValid;
data['ValidateAbsenceTransactionList'] = this.validateAbsenceTransactionList;
data['ValidateEITTransactionList'] = this.validateEITTransactionList;
if (this.validateEITTransactionList != null) {
data['ValidateEITTransactionList'] = this.validateEITTransactionList!.toJson();
}
data['ValidatePhonesTransactionList'] = this.validatePhonesTransactionList;
data['VrItemTypesList'] = this.vrItemTypesList;
data['WFLookUpList'] = this.wFLookUpList;

@ -1,14 +1,14 @@
class GetAbsenceCollectionNotificationBodyList {
List<CollectionNotification>? collectionNotification;
List<CollectionNotificationAbsence>? collectionNotification;
GetAbsenceCollectionNotificationBodyList({this.collectionNotification});
GetAbsenceCollectionNotificationBodyList.fromJson(Map<String, dynamic> json) {
if (json['Collection_Notification'] != null) {
collectionNotification = <CollectionNotification>[];
collectionNotification = <CollectionNotificationAbsence>[];
json['Collection_Notification'].forEach((v) {
collectionNotification!.add(new CollectionNotification.fromJson(v));
collectionNotification!.add(new CollectionNotificationAbsence.fromJson(v));
});
}
}
@ -23,7 +23,7 @@ class GetAbsenceCollectionNotificationBodyList {
}
}
class CollectionNotification {
class CollectionNotificationAbsence {
String? aCTION;
String? aPPLICATIONCOLUMNNAME;
String? dATATYPE;
@ -40,7 +40,7 @@ class CollectionNotification {
int? tRANSACTIONNUMBER;
String? vARCHAR2VALUE;
CollectionNotification(
CollectionNotificationAbsence(
{this.aCTION,
this.aPPLICATIONCOLUMNNAME,
this.dATATYPE,
@ -57,7 +57,7 @@ class CollectionNotification {
this.tRANSACTIONNUMBER,
this.vARCHAR2VALUE});
CollectionNotification.fromJson(Map<String, dynamic> json) {
CollectionNotificationAbsence.fromJson(Map<String, dynamic> json) {
aCTION = json['ACTION'];
aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME'];
dATATYPE = json['DATATYPE'];

@ -0,0 +1,60 @@
class GetApprovesList {
String? aPPROVALSTATUS;
String? aPPROVER;
String? aPPROVERCATEGORY;
int? aPPROVERORDERNUMBER;
String? aPPROVERTYPE;
String? eMPLOYEEIMAGE;
int? fROMROWNUM;
int? lINENO;
int? nOOFROWS;
String? pOSITIONTITLE;
int? rOWNUM;
int? tOROWNUM;
GetApprovesList(
{this.aPPROVALSTATUS,
this.aPPROVER,
this.aPPROVERCATEGORY,
this.aPPROVERORDERNUMBER,
this.aPPROVERTYPE,
this.eMPLOYEEIMAGE,
this.fROMROWNUM,
this.lINENO,
this.nOOFROWS,
this.pOSITIONTITLE,
this.rOWNUM,
this.tOROWNUM});
GetApprovesList.fromJson(Map<String, dynamic> json) {
aPPROVALSTATUS = json['APPROVAL_STATUS'];
aPPROVER = json['APPROVER'];
aPPROVERCATEGORY = json['APPROVER_CATEGORY'];
aPPROVERORDERNUMBER = json['APPROVER_ORDER_NUMBER'];
aPPROVERTYPE = json['APPROVER_TYPE'];
eMPLOYEEIMAGE = json['EMPLOYEE_IMAGE'];
fROMROWNUM = json['FROM_ROW_NUM'];
lINENO = json['LINE_NO'];
nOOFROWS = json['NO_OF_ROWS'];
pOSITIONTITLE = json['POSITION_TITLE'];
rOWNUM = json['ROW_NUM'];
tOROWNUM = json['TO_ROW_NUM'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['APPROVAL_STATUS'] = this.aPPROVALSTATUS;
data['APPROVER'] = this.aPPROVER;
data['APPROVER_CATEGORY'] = this.aPPROVERCATEGORY;
data['APPROVER_ORDER_NUMBER'] = this.aPPROVERORDERNUMBER;
data['APPROVER_TYPE'] = this.aPPROVERTYPE;
data['EMPLOYEE_IMAGE'] = this.eMPLOYEEIMAGE;
data['FROM_ROW_NUM'] = this.fROMROWNUM;
data['LINE_NO'] = this.lINENO;
data['NO_OF_ROWS'] = this.nOOFROWS;
data['POSITION_TITLE'] = this.pOSITIONTITLE;
data['ROW_NUM'] = this.rOWNUM;
data['TO_ROW_NUM'] = this.tOROWNUM;
return data;
}
}

@ -1,14 +1,14 @@
class GetDayHoursTypeDetailsList {
Null? aBSENCEATTENDANCEID;
Null? aBSENCEATTENDANCETYPEID;
dynamic? aBSENCEATTENDANCEID;
dynamic? aBSENCEATTENDANCETYPEID;
String? aBSENTFLAG;
String? aCTUALHRS;
String? aNALAYZEDFLAG;
String? aPPROVEDTIMEBACKHRS;
String? aPPRTIMEBACKFLAG;
int? aSSIGNMENTID;
dynamic? aSSIGNMENTID;
String? aTTENDEDFLAG;
Null? cALENDARENTRYID;
dynamic? cALENDARENTRYID;
String? cOMPOFFFLAG;
String? cOMPOFFHRS;
String? cOMPOFFHHRS;
@ -19,18 +19,18 @@ class GetDayHoursTypeDetailsList {
String? eARLYOUTHRS;
String? eXCESSFLAG;
String? eXCESSHRS;
int? fROMROWNUM;
dynamic? fROMROWNUM;
String? lATEINFLAG;
String? lATEINHRS;
String? mISSINGSWIPEFLAG;
String? nONSCHEDULEDFLAG;
Null? nOOFROWS;
dynamic? nOOFROWS;
String? oNCALLHRS;
Null? pERSONEXTRAINFOID;
dynamic? pERSONEXTRAINFOID;
String? pLANNEDOTHRS;
String? pLANNEDOTHRSFLAG;
String? rEMARKS;
int? rOWNUM;
dynamic? rOWNUM;
int? rTPID;
String? sCHEDULEDHRS;
String? sCHEDULEDONCALLHRS;
@ -40,7 +40,7 @@ class GetDayHoursTypeDetailsList {
String? sHORTAGEHRS;
String? tIMEBACKFLAG;
String? tIMEBACKHRS;
int? tOROWNUM;
dynamic? tOROWNUM;
GetDayHoursTypeDetailsList(
{this.aBSENCEATTENDANCEID,

@ -0,0 +1,28 @@
class GetDefaultValueList {
String? pIDCOLUMNNAME;
String? pRETURNMSG;
String? pRETURNSTATUS;
String? pVALUECOLUMNNAME;
GetDefaultValueList(
{this.pIDCOLUMNNAME,
this.pRETURNMSG,
this.pRETURNSTATUS,
this.pVALUECOLUMNNAME});
GetDefaultValueList.fromJson(Map<String, dynamic> json) {
pIDCOLUMNNAME = json['P_ID_COLUMN_NAME'];
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
pVALUECOLUMNNAME = json['P_VALUE_COLUMN_NAME'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_ID_COLUMN_NAME'] = this.pIDCOLUMNNAME;
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
data['P_VALUE_COLUMN_NAME'] = this.pVALUECOLUMNNAME;
return data;
}
}

@ -83,8 +83,6 @@ class GetEITDFFStructureList {
this.fieldAnswer});
GetEITDFFStructureList.fromJson(Map<String, dynamic> json) {
print("----------------==============================");
print("----------------:$json");
aLPHANUMERICALLOWEDFLAG = json['ALPHANUMERIC_ALLOWED_FLAG'];
aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME'];
cHILDSEGMENTSDV = json['CHILD_SEGMENTS_DV'];
@ -207,6 +205,8 @@ class GetEITDFFStructureList {
data['VALIDATION_TYPE_DSP'] = this.vALIDATIONTYPEDSP;
return data;
}
bool get isDefaultTypeIsCDPS => (dEFAULTTYPE == "C" || dEFAULTTYPE == "D" || dEFAULTTYPE == "P" || dEFAULTTYPE == "S");
}
class ESERVICESDV {

@ -2,39 +2,39 @@
class GetTimeCardSummaryList {
int? aBSENTDAYS;
int? aCTUALHRS;
int? aPPROVEDTIMEBACKHRS;
dynamic? aCTUALHRS;
dynamic? aPPROVEDTIMEBACKHRS;
int? aSSIGNMENTID;
int? aTTENDEDDAYS;
int? bUSINESSTRIP;
int? cOMPOFFHHRS;
int? cOMPOFFNHRS;
int? cOMPOFFWHRS;
int? dESIREDSCHEDULEDHRS;
int? eARLYOUTHRS;
int? eXCESSHRS;
dynamic? cOMPOFFHHRS;
dynamic? cOMPOFFNHRS;
dynamic? cOMPOFFWHRS;
dynamic? dESIREDSCHEDULEDHRS;
dynamic? eARLYOUTHRS;
dynamic? eXCESSHRS;
int? hALFDAYLEAVE;
int? lATEINHRS;
int? lEAVESHOLIDAYSHRS;
int? nONSCHEDULEDAYS;
int? nOTANALYZEDDAYS;
dynamic? lATEINHRS;
dynamic? lEAVESHOLIDAYSHRS;
dynamic? nONSCHEDULEDAYS;
dynamic? nOTANALYZEDDAYS;
int? oFFDAYS;
int? oNCALLHRS;
int? pAIDLEAVE;
dynamic? oNCALLHRS;
dynamic? pAIDLEAVE;
int? pERIODDAYS;
int? pLANNEDOTHRS;
dynamic? pLANNEDOTHRS;
int? pUBLICHOLIDAY;
int? sCHEDULEDHRS;
int? sCHEDULEDONCALLHRS;
int? sCHEDULEDPLANNEDOTHRS;
dynamic? sCHEDULEDHRS;
dynamic? sCHEDULEDONCALLHRS;
dynamic? sCHEDULEDPLANNEDOTHRS;
int? sCHEDULEDAYS;
int? sHORTAGEHRS;
int? sHORTAGESCHEDULEHRS;
dynamic? sHORTAGEHRS;
dynamic? sHORTAGESCHEDULEHRS;
int? sICKLEAVE;
int? tIMEBACKHRS;
double? tIMEBACKBALANCE;
dynamic? tIMEBACKHRS;
dynamic? tIMEBACKBALANCE;
int? uNAUTHORIZEDLEAVE;
int? uNCOVERDSHORTAGEHRS;
dynamic? uNCOVERDSHORTAGEHRS;
int? uNPAIDLEAVE;
GetTimeCardSummaryList(

@ -9,6 +9,8 @@ class PostParamsModel {
String? pEmailAddress;
String? pUserName;
String? pSelectedEmployeeNumber;
String? pLegislationCode;
String? payrollCodeStr;
int? pSessionId;
String? userName;
@ -25,6 +27,8 @@ class PostParamsModel {
this.pSessionId,
this.pUserName,
this.pSelectedEmployeeNumber,
this.payrollCodeStr,
this.pLegislationCode,
});
PostParamsModel.fromJson(Map<String, dynamic> json) {
@ -33,6 +37,8 @@ class PostParamsModel {
languageID = json['LanguageID'];
mobileType = json['MobileType'];
logInTokenID = json['LogInTokenID'];
payrollCodeStr = json['payrollCodeStr'];
pLegislationCode = json['LegislationCodeStr'];
tokenID = json['TokenID'];
}
@ -43,6 +49,8 @@ class PostParamsModel {
data['LanguageID'] = this.languageID;
data['MobileType'] = this.mobileType;
data['LogInTokenID'] = this.logInTokenID;
data['payrollCodeStr'] = this.payrollCodeStr;
data['LegislationCodeStr'] = this.pLegislationCode;
data['TokenID'] = this.tokenID;
return data;
}
@ -59,9 +67,10 @@ class PostParamsModel {
data['UserName'] = this.userName;
data['P_EMAIL_ADDRESS'] = this.pEmailAddress;
data['P_SESSION_ID'] = this.pSessionId;
data['payrollCodeStr'] = this.payrollCodeStr;
data['LegislationCodeStr'] = this.pLegislationCode;
data['P_SELECTED_EMPLOYEE_NUMBER'] = this.pSelectedEmployeeNumber;
data['P_USER_NAME'] = this.pUserName;
return data;
}
@ -80,4 +89,8 @@ class PostParamsModel {
set setPUserName(String? v) => pUserName = v;
set setPSelectedEmployeeNumber(String? v) => pSelectedEmployeeNumber = v;
set setPLegislationCode(String? v) => pLegislationCode = v;
set setPayrollCodeStr(String? v) => payrollCodeStr = v;
}

@ -0,0 +1,18 @@
class StartEitApprovalProcess {
String? pRETURNMSG;
String? pRETURNSTATUS;
StartEitApprovalProcess({this.pRETURNMSG, this.pRETURNSTATUS});
StartEitApprovalProcess.fromJson(Map<String, dynamic> json) {
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
return data;
}
}

@ -0,0 +1,28 @@
class SubmitEITTransactionList {
String? pITEMKEY;
String? pRETURNMSG;
String? pRETURNSTATUS;
int? pTRANSACTIONID;
SubmitEITTransactionList(
{this.pITEMKEY,
this.pRETURNMSG,
this.pRETURNSTATUS,
this.pTRANSACTIONID});
SubmitEITTransactionList.fromJson(Map<String, dynamic> json) {
pITEMKEY = json['P_ITEM_KEY'];
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
pTRANSACTIONID = json['P_TRANSACTION_ID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_ITEM_KEY'] = this.pITEMKEY;
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
data['P_TRANSACTION_ID'] = this.pTRANSACTIONID;
return data;
}
}

@ -0,0 +1,18 @@
class ValidateEITTransactionList {
String? pRETURNMSG;
String? pRETURNSTATUS;
ValidateEITTransactionList({this.pRETURNMSG, this.pRETURNSTATUS});
ValidateEITTransactionList.fromJson(Map<String, dynamic> json) {
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
return data;
}
}

@ -0,0 +1,37 @@
// To parse this JSON data, do
//
// final getFavoriteReplacements = getFavoriteReplacementsFromJson(jsonString);
import 'dart:convert';
GetFavoriteReplacements getFavoriteReplacementsFromJson(String str) => GetFavoriteReplacements.fromJson(json.decode(str));
String getFavoriteReplacementsToJson(GetFavoriteReplacements data) => json.encode(data.toJson());
class GetFavoriteReplacements {
GetFavoriteReplacements({
this.userName,
this.employeeDisplayName,
this.emailAddress,
this.employeeImage,
});
final String? userName;
final String? employeeDisplayName;
final String? emailAddress;
final String? employeeImage;
factory GetFavoriteReplacements.fromJson(Map<String, dynamic> json) => GetFavoriteReplacements(
userName: json["USER_NAME"] == null ? null : json["USER_NAME"],
employeeDisplayName: json["EMPLOYEE_DISPLAY_NAME"] == null ? null : json["EMPLOYEE_DISPLAY_NAME"],
emailAddress: json["EMAIL_ADDRESS"] == null ? null : json["EMAIL_ADDRESS"],
employeeImage: json["EMPLOYEE_IMAGE"] == null ? null : json["EMPLOYEE_IMAGE"],
);
Map<String, dynamic> toJson() => {
"USER_NAME": userName == null ? null : userName,
"EMPLOYEE_DISPLAY_NAME": employeeDisplayName == null ? null : employeeDisplayName,
"EMAIL_ADDRESS": emailAddress == null ? null : emailAddress,
"EMPLOYEE_IMAGE": employeeImage,
};
}

@ -0,0 +1,91 @@
class GetEitCollectionNotificationBodyList {
GetEitCollectionNotificationBodyList({
this.collectionNotification,
});
final List<CollectionNotificationEit>? collectionNotification;
factory GetEitCollectionNotificationBodyList.fromJson(Map<String, dynamic> json) => GetEitCollectionNotificationBodyList(
collectionNotification: json["Collection_Notification"] == null ? null : List<CollectionNotificationEit>.from(json["Collection_Notification"].map((x) => CollectionNotificationEit.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"Collection_Notification": collectionNotification == null ? null : List<dynamic>.from(collectionNotification!.map((x) => x.toJson())),
};
}
class CollectionNotificationEit {
CollectionNotificationEit({
this.action,
this.applicationColumnName,
this.datatype,
this.dateValue,
this.descFlexContextCode,
this.descFlexName,
this.displayFlag,
this.extraInfoId,
this.numberValue,
this.prevSegmentValueDsp,
this.segmentName,
this.segmentPrompt,
this.segmentSeqNum,
this.segmentValueDsp,
this.transactionNumber,
this.varchar2Value,
});
final String? action;
final String? applicationColumnName;
final String? datatype;
final String? dateValue;
final String? descFlexContextCode;
final String? descFlexName;
final String? displayFlag;
final int? extraInfoId;
final int? numberValue;
final String? prevSegmentValueDsp;
final String? segmentName;
final String? segmentPrompt;
final int? segmentSeqNum;
final String? segmentValueDsp;
final int? transactionNumber;
final String? varchar2Value;
factory CollectionNotificationEit.fromJson(Map<String, dynamic> json) => CollectionNotificationEit(
action: json["ACTION"] == null ? null : json["ACTION"],
applicationColumnName: json["APPLICATION_COLUMN_NAME"] == null ? null : json["APPLICATION_COLUMN_NAME"],
datatype: json["DATATYPE"] == null ? null : json["DATATYPE"],
dateValue: json["DATE_VALUE"] == null ? null : json["DATE_VALUE"],
descFlexContextCode: json["DESC_FLEX_CONTEXT_CODE"] == null ? null : json["DESC_FLEX_CONTEXT_CODE"],
descFlexName: json["DESC_FLEX_NAME"] == null ? null : json["DESC_FLEX_NAME"],
displayFlag: json["DISPLAY_FLAG"] == null ? null : json["DISPLAY_FLAG"],
extraInfoId: json["EXTRA_INFO_ID"] == null ? null : json["EXTRA_INFO_ID"],
numberValue: json["NUMBER_VALUE"] == null ? null : json["NUMBER_VALUE"],
prevSegmentValueDsp: json["PREV_SEGMENT_VALUE_DSP"] == null ? null : json["PREV_SEGMENT_VALUE_DSP"],
segmentName: json["SEGMENT_NAME"] == null ? null : json["SEGMENT_NAME"],
segmentPrompt: json["SEGMENT_PROMPT"] == null ? null : json["SEGMENT_PROMPT"],
segmentSeqNum: json["SEGMENT_SEQ_NUM"] == null ? null : json["SEGMENT_SEQ_NUM"],
segmentValueDsp: json["SEGMENT_VALUE_DSP"] == null ? null : json["SEGMENT_VALUE_DSP"],
transactionNumber: json["TRANSACTION_NUMBER"] == null ? null : json["TRANSACTION_NUMBER"],
varchar2Value: json["VARCHAR2_VALUE"] == null ? null : json["VARCHAR2_VALUE"],
);
Map<String, dynamic> toJson() => {
"ACTION": action == null ? null : action,
"APPLICATION_COLUMN_NAME": applicationColumnName == null ? null : applicationColumnName,
"DATATYPE": datatype == null ? null : datatype,
"DATE_VALUE": dateValue == null ? null : dateValue,
"DESC_FLEX_CONTEXT_CODE": descFlexContextCode == null ? null : descFlexContextCode,
"DESC_FLEX_NAME": descFlexName == null ? null : descFlexName,
"DISPLAY_FLAG": displayFlag == null ? null : displayFlag,
"EXTRA_INFO_ID": extraInfoId == null ? null : extraInfoId,
"NUMBER_VALUE": numberValue == null ? null : numberValue,
"PREV_SEGMENT_VALUE_DSP": prevSegmentValueDsp == null ? null : prevSegmentValueDsp,
"SEGMENT_NAME": segmentName == null ? null : segmentName,
"SEGMENT_PROMPT": segmentPrompt == null ? null : segmentPrompt,
"SEGMENT_SEQ_NUM": segmentSeqNum == null ? null : segmentSeqNum,
"SEGMENT_VALUE_DSP": segmentValueDsp == null ? null : segmentValueDsp,
"TRANSACTION_NUMBER": transactionNumber == null ? null : transactionNumber,
"VARCHAR2_VALUE": varchar2Value == null ? null : varchar2Value,
};
}

@ -0,0 +1,87 @@
class GetAbsenceCollectionNotificationBodyList {
GetAbsenceCollectionNotificationBodyList({
this.collectionNotification,
});
final List<CollectionNotification>? collectionNotification;
factory GetAbsenceCollectionNotificationBodyList.fromJson(Map<String, dynamic> json) => GetAbsenceCollectionNotificationBodyList(
collectionNotification: json["Collection_Notification"] == null ? null : List<CollectionNotification>.from(json["Collection_Notification"].map((x) => CollectionNotification.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"Collection_Notification": collectionNotification == null ? null : List<dynamic>.from(collectionNotification!.map((x) => x.toJson())),
};
}
class CollectionNotification {
CollectionNotification({
this.action,
this.applicationColumnName,
this.datatype,
this.dateValue,
this.descFlexContextCode,
this.descFlexName,
this.displayFlag,
this.numberValue,
this.prevSegmentValueDsp,
this.segmentName,
this.segmentPrompt,
this.segmentSeqNum,
this.segmentValueDsp,
this.transactionNumber,
this.varchar2Value,
});
final String? action;
final String? applicationColumnName;
final String? datatype;
final String? dateValue;
final String? descFlexContextCode;
final String? descFlexName;
final String? displayFlag;
final int? numberValue;
final String? prevSegmentValueDsp;
final String? segmentName;
final String? segmentPrompt;
final int? segmentSeqNum;
final String? segmentValueDsp;
final int? transactionNumber;
final String? varchar2Value;
factory CollectionNotification.fromJson(Map<String, dynamic> json) => CollectionNotification(
action: json["ACTION"] == null ? null : json["ACTION"],
applicationColumnName: json["APPLICATION_COLUMN_NAME"] == null ? null :json["APPLICATION_COLUMN_NAME"],
datatype: json["DATATYPE"] == null ? null : json["DATATYPE"],
dateValue: json["DATE_VALUE"] == null ? null : json["DATE_VALUE"],
descFlexContextCode: json["DESC_FLEX_CONTEXT_CODE"] == null ? null : json["DESC_FLEX_CONTEXT_CODE"],
descFlexName: json["DESC_FLEX_NAME"] == null ? null : json["DESC_FLEX_NAME"],
displayFlag: json["DISPLAY_FLAG"] == null ? null : json["DISPLAY_FLAG"],
numberValue: json["NUMBER_VALUE"] == null ? null : json["NUMBER_VALUE"],
prevSegmentValueDsp: json["PREV_SEGMENT_VALUE_DSP"] == null ? null : json["PREV_SEGMENT_VALUE_DSP"],
segmentName: json["SEGMENT_NAME"] == null ? null : json["SEGMENT_NAME"],
segmentPrompt: json["SEGMENT_PROMPT"] == null ? null : json["SEGMENT_PROMPT"],
segmentSeqNum: json["SEGMENT_SEQ_NUM"] == null ? null : json["SEGMENT_SEQ_NUM"],
segmentValueDsp: json["SEGMENT_VALUE_DSP"] == null ? null : json["SEGMENT_VALUE_DSP"],
transactionNumber: json["TRANSACTION_NUMBER"] == null ? null : json["TRANSACTION_NUMBER"],
varchar2Value: json["VARCHAR2_VALUE"] == null ? null : json["VARCHAR2_VALUE"],
);
Map<String, dynamic> toJson() => {
"ACTION": action == null ? null : action,
"APPLICATION_COLUMN_NAME": applicationColumnName == null ? null : applicationColumnName,
"DATATYPE": datatype == null ? null :datatype,
"DATE_VALUE": dateValue == null ? null : dateValue,
"DESC_FLEX_CONTEXT_CODE": descFlexContextCode == null ? null : descFlexContextCode,
"DESC_FLEX_NAME": descFlexName == null ? null : descFlexName,
"DISPLAY_FLAG": displayFlag == null ? null : displayFlag,
"NUMBER_VALUE": numberValue == null ? null : numberValue,
"PREV_SEGMENT_VALUE_DSP": prevSegmentValueDsp == null ? null : prevSegmentValueDsp,
"SEGMENT_NAME": segmentName == null ? null : segmentName,
"SEGMENT_PROMPT": segmentPrompt == null ? null : segmentPrompt,
"SEGMENT_SEQ_NUM": segmentSeqNum == null ? null : segmentSeqNum,
"SEGMENT_VALUE_DSP": segmentValueDsp == null ? null : segmentValueDsp,
"TRANSACTION_NUMBER": transactionNumber == null ? null : transactionNumber,
"VARCHAR2_VALUE": varchar2Value == null ? null : varchar2Value,
};
}

@ -0,0 +1,44 @@
class GetContactNotificationBodyList {
GetContactNotificationBodyList({
this.contactNotificationBody,
});
final List<ContactNotificationBody>? contactNotificationBody;
factory GetContactNotificationBodyList.fromJson(Map<String, dynamic> json) => GetContactNotificationBodyList(
contactNotificationBody: json["ContactNotificationBody"] == null ? null : List<ContactNotificationBody>.from(json["ContactNotificationBody"].map((x) => ContactNotificationBody.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"ContactNotificationBody": contactNotificationBody == null ? null : List<dynamic>.from(contactNotificationBody!.map((x) => x.toJson())),
};
}
class ContactNotificationBody {
ContactNotificationBody({
this.prevSegmentValueDsp,
this.segmentPrompt,
this.segmentValueDsp,
this.updatedFlag,
});
final String? prevSegmentValueDsp;
final String? segmentPrompt;
final String? segmentValueDsp;
final String? updatedFlag;
factory ContactNotificationBody.fromJson(Map<String, dynamic> json) => ContactNotificationBody(
prevSegmentValueDsp: json["PREV_SEGMENT_VALUE_DSP"] == null ? null : json["PREV_SEGMENT_VALUE_DSP"],
segmentPrompt: json["SEGMENT_PROMPT"] == null ? null : json["SEGMENT_PROMPT"],
segmentValueDsp: json["SEGMENT_VALUE_DSP"] == null ? null : json["SEGMENT_VALUE_DSP"],
updatedFlag: json["UPDATED_FLAG"] == null ? null : json["UPDATED_FLAG"],
);
Map<String, dynamic> toJson() => {
"PREV_SEGMENT_VALUE_DSP": prevSegmentValueDsp == null ? null : prevSegmentValueDsp,
"SEGMENT_PROMPT": segmentPrompt == null ? null : segmentPrompt,
"SEGMENT_VALUE_DSP": segmentValueDsp == null ? null : segmentValueDsp,
"UPDATED_FLAG": updatedFlag == null ? null : updatedFlag,
};
}

@ -0,0 +1,27 @@
class GetPhonesNotificationBodyList {
GetPhonesNotificationBodyList({
this.currentPhoneNumber,
this.phoneType,
this.phoneTypeMeaning,
this.proposedPhoneNumber,
});
final String? currentPhoneNumber;
final String? phoneType;
final String? phoneTypeMeaning;
final String? proposedPhoneNumber;
factory GetPhonesNotificationBodyList.fromJson(Map<String, dynamic> json) => GetPhonesNotificationBodyList(
currentPhoneNumber: json["CURRENT_PHONE_NUMBER"] == null ? null : json["CURRENT_PHONE_NUMBER"],
phoneType: json["PHONE_TYPE"] == null ? null : json["PHONE_TYPE"],
phoneTypeMeaning: json["PHONE_TYPE_MEANING"] == null ? null : json["PHONE_TYPE_MEANING"],
proposedPhoneNumber: json["PROPOSED_PHONE_NUMBER"] == null ? null : json["PROPOSED_PHONE_NUMBER"],
);
Map<String, dynamic> toJson() => {
"CURRENT_PHONE_NUMBER": currentPhoneNumber == null ? null : currentPhoneNumber,
"PHONE_TYPE": phoneType == null ? null : phoneType,
"PHONE_TYPE_MEANING": phoneTypeMeaning == null ? null : phoneTypeMeaning,
"PROPOSED_PHONE_NUMBER": proposedPhoneNumber == null ? null : proposedPhoneNumber,
};
}

@ -0,0 +1,57 @@
// To parse this JSON data, do
//
// final replacementList = replacementListFromJson(jsonString);
import 'dart:convert';
ReplacementList replacementListFromJson(String str) => ReplacementList.fromJson(json.decode(str));
String replacementListToJson(ReplacementList data) => json.encode(data.toJson());
class ReplacementList {
ReplacementList({
this.emailAddress,
this.employeeDisplayName,
this.employeeImage,
this.fromRowNum,
this.isFavorite,
this.noOfRows,
this.rowNum,
this.toRowNum,
this.userName,
});
final String? emailAddress;
final String? employeeDisplayName;
final String? employeeImage;
final int? fromRowNum;
bool? isFavorite;
final int? noOfRows;
final int? rowNum;
final int? toRowNum;
final String? userName;
factory ReplacementList.fromJson(Map<String, dynamic> json) => ReplacementList(
emailAddress: json["EMAIL_ADDRESS"] == null ? null : json["EMAIL_ADDRESS"],
employeeDisplayName: json["EMPLOYEE_DISPLAY_NAME"] == null ? null : json["EMPLOYEE_DISPLAY_NAME"],
employeeImage: json["EMPLOYEE_IMAGE"] == null ? null : json["EMPLOYEE_IMAGE"],
fromRowNum: json["FROM_ROW_NUM"] == null ? null : json["FROM_ROW_NUM"],
isFavorite: json["IsFavorite"] == null ? null : json["IsFavorite"],
noOfRows: json["NO_OF_ROWS"] == null ? null : json["NO_OF_ROWS"],
rowNum: json["ROW_NUM"] == null ? null : json["ROW_NUM"],
toRowNum: json["TO_ROW_NUM"] == null ? null : json["TO_ROW_NUM"],
userName: json["USER_NAME"] == null ? null : json["USER_NAME"],
);
Map<String, dynamic> toJson() => {
"EMAIL_ADDRESS": emailAddress == null ? null : emailAddress,
"EMPLOYEE_DISPLAY_NAME": employeeDisplayName == null ? null : employeeDisplayName,
"EMPLOYEE_IMAGE": employeeImage == null ? null : employeeImage,
"FROM_ROW_NUM": fromRowNum == null ? null : fromRowNum,
"IsFavorite": isFavorite == null ? null : isFavorite,
"NO_OF_ROWS": noOfRows == null ? null : noOfRows,
"ROW_NUM": rowNum == null ? null : rowNum,
"TO_ROW_NUM": toRowNum == null ? null : toRowNum,
"USER_NAME": userName == null ? null : userName,
};
}

@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/scheduler.dart';
import 'package:mohem_flutter_app/api/monthlyAttendance_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
@ -17,6 +18,10 @@ import 'package:syncfusion_flutter_calendar/calendar.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:flutter/cupertino.dart';
import 'package:pie_chart/pie_chart.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:intl/intl.dart';
import 'package:month_year_picker/month_year_picker.dart';
import 'package:month_picker_dialog/month_picker_dialog.dart';
class MonthlyAttendance extends StatefulWidget {
MonthlyAttendance({Key? key}) : super(key: key);
@ -28,12 +33,12 @@ class MonthlyAttendance extends StatefulWidget {
}
class _MonthlyAttendanceState extends State<MonthlyAttendance> {
bool isPresent = true;
bool isAbsent = true;
bool isMissingDays = true;
bool isOffDays = true;
bool isPresent = false;
bool isAbsent = false;
bool isMissing = false;
bool isOff = false;
DateTime date = DateTime.now();
late var formattedDate;
late DateTime formattedDate;
var currentMonth = DateTime.now().month;
String searchMonth = getMonth(DateTime.now().month);
int searchYear = DateTime.now().year;
@ -41,84 +46,42 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
List<GetDayHoursTypeDetailsList> getDayHoursTypeDetailsList = [];
GetTimeCardSummaryList? getTimeCardSummaryList;
// GetDayHoursTypeDetailsList? getDayHoursTypeDetailsList;
GetScheduleShiftsDetailsList? getScheduleShiftsDetailsList;
@override
void initState() {
super.initState();
getTimeCardSummary(searchMonth, searchYear);
getDayHoursTypeDetails(date.day, searchMonth, searchYear);
formattedDate = DateFormat('MMM-yyyy').format(date);
formattedDate = date;
callTimeCardAndHourDetails(date.day, searchMonth, searchYear);
}
void getTimeCardSummary(searchMonth, searchYear) async {
void callTimeCardAndHourDetails(index, searchMonth, searchYear) async {
try {
Utils.showLoading(context);
getTimeCardSummaryList = await MonthlyAttendanceApiClient().getTimeCardSummary(searchMonth, searchYear);
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
void getDayHoursTypeDetails(index, searchMonth, searchYear) async {
try {
Utils.showLoading(context);
getDayHoursTypeDetailsList = await MonthlyAttendanceApiClient().getDayHoursTypeDetails(searchMonth, searchYear);
Utils.hideLoading(context);
pRTPID = getDayHoursTypeDetailsList[index].rTPID;
_calendarController.displayDate = formattedDate;
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
countAllAttendDays();
getScheduleShiftsDetails(pRTPID);
}
getScheduleShiftsDetails(pRTPID) async {
Future getScheduleShiftsDetails(index, pRTPID) async {
try {
Utils.showLoading(context);
getScheduleShiftsDetailsList = await MonthlyAttendanceApiClient().getScheduleShiftsDetails(pRTPID);
Utils.hideLoading(context);
setState(() {});
//setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
countAllAttendDays() {
// print(getDayHoursTypeDetailsList.length);
for (int i = 0; i < getDayHoursTypeDetailsList.length; i++) {
if (getDayHoursTypeDetailsList[i].aTTENDEDFLAG == 'Y') {
isPresent = true;
isAbsent = false;
isMissingDays = false;
isOffDays = false;
} else if (getDayHoursTypeDetailsList[i].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[i].aBSENTFLAG == 'Y') {
isPresent = false;
isAbsent = true;
isMissingDays = false;
isOffDays = false;
} else if (getDayHoursTypeDetailsList[i].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[i].dAYTYPE == 'OFF') {
isPresent = false;
isAbsent = false;
isMissingDays = false;
isOffDays = true;
} else {
isPresent = false;
isAbsent = false;
isMissingDays = true;
isOffDays = false;
}
}
}
final CalendarController _calendarController = CalendarController();
final List<Color> _colorList = [Color(0xff2AB2AB), Color(0xff202529)];
@ -126,8 +89,8 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
@override
Widget build(BuildContext context) {
Map<String, double> dataMap = {
"Present": getTimeCardSummaryList!.aTTENDEDDAYS!.toDouble(),
"Absent": getTimeCardSummaryList!.aBSENTDAYS!.toDouble(),
"Present": getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList!.aTTENDEDDAYS!.toDouble() : 0,
"Absent": getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList!.aBSENTDAYS!.toDouble() : 0,
};
return Scaffold(
appBar: AppBar(
@ -150,61 +113,42 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Attendance".toText24(isBold: true, color: MyColors.darkIconColor),
LocaleKeys.attendance.tr().toText24(isBold: true, color: MyColors.darkIconColor),
Row(
children: [
Text(formattedDate),
"${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.greyACColor),
const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.greyACColor),
],
).onPress(() async {
await showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(2021),
showMonthPicker(
context: context, //locale: EasyLocalization.of(context)?.locale,
initialDate: formattedDate,
firstDate: DateTime(searchYear - 2),
lastDate: DateTime.now(),
builder: (context, child) {
return Theme(
data: ThemeData.dark().copyWith(
colorScheme: const ColorScheme.dark(
primary: MyColors.lightGreenColor,
onPrimary: MyColors.white,
surface: MyColors.lightGreenColor,
onSurface: MyColors.darkTextColor,
),
dialogBackgroundColor: Colors.white,
),
child: child!,
);
},
).then((selectedDate) {
if (selectedDate != null) {
var selectedMonth = DateFormat('MMMM').format(selectedDate);
var selectedYear = DateFormat('yyyy').format(selectedDate);
searchMonth = selectedMonth;
searchYear = int.parse(selectedYear);
setState(() {
// date = selectedDate;
formattedDate = DateFormat('MMMM-yyyy').format(selectedDate);
getTimeCardSummary(searchMonth, searchYear);
getDayHoursTypeDetails(selectedDate.day, searchMonth, searchYear);
});
searchMonth = getMonth(selectedDate.month);
searchYear = selectedDate.year;
formattedDate = selectedDate; //DateFormat('MMMM-yyyy').format(selectedDate);
// _calendarController.selectedDate = formattedDate;
callTimeCardAndHourDetails(selectedDate.day, searchMonth, searchYear);
}
});
})
],
).paddingOnly(left: 21, right: 21),
18.height,
AspectRatio(aspectRatio: 333 / 270, child: calendarWidget()).paddingOnly(left: 21, right: 21),
AspectRatio(aspectRatio: 333 / 270, child: calendarWidget()).paddingOnly(left: 18, right: 25),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
optionUI("Schedule\nDays", "${getTimeCardSummaryList!.sCHEDULEDAYS}"),
optionUI(LocaleKeys.scheduleDays.tr(), "${getTimeCardSummaryList?.sCHEDULEDAYS}"),
6.width,
optionUI("Off\nDays", "${getTimeCardSummaryList!.oFFDAYS}"),
optionUI(LocaleKeys.offDays.tr(), "${getTimeCardSummaryList?.oFFDAYS}"),
6.width,
optionUI("Non\nAnalyzed", "${getTimeCardSummaryList!.uNAUTHORIZEDLEAVE}"),
optionUI(LocaleKeys.nonAnalyzed.tr(), "${getTimeCardSummaryList?.uNAUTHORIZEDLEAVE}"),
6.width,
optionUI("Shortage\nHour", "${getTimeCardSummaryList!.sHORTAGEHRS}"),
optionUI(LocaleKeys.shortageHour.tr(), "${getTimeCardSummaryList?.sHORTAGEHRS}"),
],
).paddingOnly(left: 21, right: 21),
35.height,
@ -229,10 +173,10 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
children: <Widget>[
Column(
children: [
"Attendance".toText12(isBold: true, color: MyColors.grey3AColor),
"Stats".toText24(isBold: true, color: MyColors.grey3AColor),
LocaleKeys.attendance.tr().toText12(isBold: true, color: MyColors.grey3AColor),
LocaleKeys.stats.tr().toText24(isBold: true, color: MyColors.grey3AColor),
],
).paddingOnly(left: 21, top: 29, bottom: 36),
).paddingOnly(left: 21, top: 29, bottom: 36, right: 23),
Row(
children: [
Container(
@ -245,7 +189,7 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
),
Container(
margin: const EdgeInsets.only(left: 5, right: 5),
child: "PRESENT ${getTimeCardSummaryList!.aTTENDEDDAYS}".toText16(isBold: true, color: MyColors.lightGreenColor),
child: "${LocaleKeys.present.tr()} ${getTimeCardSummaryList!.aTTENDEDDAYS}".toText16(isBold: true, color: MyColors.lightGreenColor),
),
],
).paddingOnly(left: 21, right: 23),
@ -262,13 +206,13 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
),
Container(
margin: const EdgeInsets.only(left: 5, right: 5),
child: "ABSENT ${getTimeCardSummaryList!.aBSENTDAYS}".toText16(
child: "${LocaleKeys.absent.tr()} ${getTimeCardSummaryList!.aBSENTDAYS}".toText16(
isBold: true,
color: MyColors.backgroundBlackColor,
),
)
],
).paddingOnly(left: 21, top: 8),
).paddingOnly(left: 21, top: 8, right: 23),
],
),
Column(
@ -342,70 +286,116 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
Widget calendarWidget() {
return SfCalendar(
view: CalendarView.month,
// onViewChanged: viewChanged,
showDatePickerButton: false,
controller: _calendarController,
headerHeight: 0,
todayHighlightColor: MyColors.grey3AColor,
showNavigationArrow: false,
showCurrentTimeIndicator: false,
showWeekNumber: false,
cellBorderColor: Colors.white,
selectionDecoration: BoxDecoration(
border: Border.all(color: MyColors.white, width: 10),
borderRadius: const BorderRadius.all(Radius.circular(100)),
shape: BoxShape.circle,
),
dataSource: MeetingDataSource(_getDataSource()),
onTap: calendarTapped,
monthViewSettings: const MonthViewSettings(
dayFormat: 'EEE',
showTrailingAndLeadingDates: false,
showAgenda: false,
navigationDirection: MonthNavigationDirection.horizontal,
monthCellStyle: MonthCellStyle(
textStyle: TextStyle(
fontStyle: FontStyle.normal,
fontSize: 13,
color: Colors.white,
),
),
),
viewHeaderStyle: const ViewHeaderStyle(
dayTextStyle: TextStyle(color: MyColors.grey3AColor, fontSize: 13, fontWeight: FontWeight.w600),
),
monthCellBuilder: (cxt, build) {
int val = build.date.day;
val == countAllAttendDays();
if (isPresent) {
return Container(
margin: const EdgeInsets.all(4),
decoration: BoxDecoration(
gradient: const LinearGradient(
transform: GradientRotation(.46),
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
monthCellBuilder: (build, details) {
if (details.date.month == formattedDate.month && details.date.year == formattedDate.year) {
int val = details.date.day;
//check day is off
if (getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].dAYTYPE == 'OFF') {
return Container(
margin: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: MyColors.greyACColor.withOpacity(.12),
shape: BoxShape.circle,
),
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
offset: const Offset(0, 2),
blurRadius: 26,
color: MyColors.blackColor.withOpacity(0.100),
alignment: Alignment.center,
child: Text(
"${val}",
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
color: MyColors.greyA5Color,
),
],
),
alignment: Alignment.center,
child: Text(
"${build.date.day}",
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
color: MyColors.white,
),
),
);
} else if (isAbsent) {
return Container(
margin: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: MyColors.backgroundBlackColor,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
offset: const Offset(0, 2),
blurRadius: 26,
color: MyColors.blackColor.withOpacity(0.100),
);
}
//check day is Present
else if (getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'Y') {
return Container(
margin: const EdgeInsets.all(4),
decoration: BoxDecoration(
gradient: const LinearGradient(
transform: GradientRotation(.46),
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
),
],
),
alignment: Alignment.center,
child: Text(
"${build.date.day}",
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
color: MyColors.white,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
offset: const Offset(0, 2),
blurRadius: 26,
color: MyColors.blackColor.withOpacity(0.100),
),
],
),
),
);
} else if (isMissingDays) {
alignment: Alignment.center,
child: Text(
"${val}",
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
color: MyColors.white,
),
),
);
}
//check day is Absent
else if (getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].aBSENTFLAG == 'Y') {
return Container(
margin: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: MyColors.backgroundBlackColor,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
offset: const Offset(0, 2),
blurRadius: 26,
color: MyColors.blackColor.withOpacity(0.100),
),
],
),
alignment: Alignment.center,
child: Text(
"${val}",
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
color: MyColors.white,
),
),
);
}
return Container(
margin: const EdgeInsets.all(4),
decoration: BoxDecoration(
@ -421,7 +411,7 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
),
alignment: Alignment.center,
child: Text(
"${build.date.day}",
"${val}",
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
@ -429,66 +419,35 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
),
),
);
} else if (isOffDays) {
return Container(
margin: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: MyColors.greyACColor.withOpacity(.12),
shape: BoxShape.circle,
),
alignment: Alignment.center,
child: Text(
"${build.date.day}",
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
color: MyColors.greyA5Color,
),
),
);
// return Container(
// alignment: Alignment.center,
// child: Text("$val"),
// );
} else {
return Container();
return const SizedBox();
}
},
monthViewSettings: const MonthViewSettings(
dayFormat: 'EEE',
showTrailingAndLeadingDates: false,
appointmentDisplayMode: MonthAppointmentDisplayMode.appointment,
showAgenda: false,
navigationDirection: MonthNavigationDirection.horizontal,
monthCellStyle: MonthCellStyle(
textStyle: TextStyle(
fontStyle: FontStyle.normal,
fontSize: 13,
color: Colors.white,
),
),
),
showNavigationArrow: false,
showDatePickerButton: false,
showCurrentTimeIndicator: false,
showWeekNumber: false,
cellBorderColor: Colors.white,
selectionDecoration: BoxDecoration(
border: Border.all(color: MyColors.white, width: 10),
borderRadius: const BorderRadius.all(Radius.circular(100)),
shape: BoxShape.circle,
),
dataSource: MeetingDataSource(_getDataSource()),
onTap: calendarTapped,
);
}
calendarTapped(CalendarTapDetails details) {
dynamic string = getScheduleShiftsDetailsList!.pERCENTAGE;
dynamic percentage = string!.indexOf('%');
print(percentage);
print(details.date?.day.toString());
int? index = details.date?.day;
calendarTapped(CalendarTapDetails details) async {
dynamic index = details.date?.day;
if (index != null) {
index = index - 1;
}
getDayHoursTypeDetails(index, getMonth(details.date!.month), details.date?.year);
pRTPID = getDayHoursTypeDetailsList[index].rTPID;
await getScheduleShiftsDetails(index, pRTPID);
dynamic value = getScheduleShiftsDetailsList!.pERCENTAGE;
dynamic percentage;
if (value!.indexOf('%') == 3) {
percentage = int.parse(value!.substring(0, 3));
} else if (value!.indexOf('%') == 2) {
percentage = int.parse(value!.substring(0, 2));
} else if (value!.indexOf('%') == 1 && value!.indexOf('%') != 0 && value!.indexOf('%') != "") {
percentage = int.parse(value!.substring(0, 1));
} else if (value!.indexOf('%') == 0 || value!.indexOf('%') == "") {
percentage = 0;
}
showModalBottomSheet(
context: context,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)),
@ -499,6 +458,8 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
maxChildSize: 0.9,
expand: false,
builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString);
return Column(
children: [
Container(
@ -524,11 +485,12 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(children: [
"${getScheduleShiftsDetailsList!.sCHEDULEDATE!.substring(0, 9)}".toText24(isBold: true, color: Colors.white),
"Attendance Details".tr().toText16(color: MyColors.lightGreyEFColor),
21.height,
]).paddingOnly(top: 25, left: 21, right: 21, bottom: 10),
Container(child:
"${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white),
).paddingOnly(top: 26, left: 21, right: 21),
Container(
child: LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor).paddingOnly(left: 21,bottom: 16),
),
Center(
child: CircularStepProgressBar(
totalSteps: 16 * 4,
@ -542,9 +504,9 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
mainAxisSize: MainAxisSize.min,
children: [
"${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true),
"Completed".tr().toText11(color: MyColors.greyACColor),
LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor),
19.height,
"Shift Time".tr().toText11(color: MyColors.greyACColor),
LocaleKeys.shiftTime.tr().toText11(color: MyColors.greyACColor),
"${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true),
],
),
@ -574,11 +536,13 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Actual Check In ".tr().toText11(
LocaleKeys.actualCheckIn.tr().toText11(
color: MyColors.grey67Color,
),
8.height,
"${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true),
"${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" !=""
? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true)
: "__".toText22(color: Colors.black, isBold: true),
],
),
),
@ -586,11 +550,13 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Actual Check Out".tr().toText11(
LocaleKeys.actualCheckOut.tr().toText11(
color: MyColors.grey67Color,
),
8.height,
"${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true),
"${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != ""
? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true)
: "__".toText22(color: Colors.black, isBold: true),
],
),
],
@ -609,11 +575,13 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Approved Check In".tr().toText11(
LocaleKeys.approvedCheckIn.tr().toText11(
color: MyColors.grey67Color,
),
8.height,
"${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true),
"${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" !=""
? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true)
:"__".toText22(color: MyColors.greenColor, isBold: true),
],
),
),
@ -621,11 +589,13 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Approved Check Out".tr().toText11(
LocaleKeys.approvedCheckOut.tr().toText11(
color: MyColors.grey67Color,
),
8.height,
"${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true),
"${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}"!= ""
? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true)
:"__".toText22(color: MyColors.greenColor, isBold: true),
],
),
],
@ -644,11 +614,11 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Late In".tr().toText11(
LocaleKeys.lateIn.tr().toText11(
color: MyColors.grey67Color,
),
8.height,
"${getDayHoursTypeDetailsList[i].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true),
"${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true),
],
),
),
@ -656,11 +626,11 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Excess".tr().toText11(
LocaleKeys.excess.tr().toText11(
color: MyColors.grey67Color,
),
8.height,
"${getDayHoursTypeDetailsList[i].eXCESSHRS}".toText22(color: Colors.black, isBold: true),
"${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: Colors.black, isBold: true),
],
),
],
@ -679,11 +649,11 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Shortage".tr().toText11(
LocaleKeys.shortage.tr().toText11(
color: MyColors.grey67Color,
),
8.height,
"${getDayHoursTypeDetailsList[i].sHORTAGEHRS}".toText22(color: Colors.black, isBold: true),
"${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: Colors.black, isBold: true),
],
),
),
@ -691,11 +661,11 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Early Out".tr().toText11(
LocaleKeys.earlyOut.tr().toText11(
color: MyColors.grey67Color,
),
8.height,
"${getDayHoursTypeDetailsList[i].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true),
"${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true),
],
),
],
@ -751,6 +721,35 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
return "December";
}
}
static getMonthAr(int month){
switch (month) {
case 1:
return 'يناير';
case 2:
return ' فبراير';
case 3:
return 'مارس';
case 4:
return 'أبريل';
case 5:
return 'مايو';
case 6:
return 'يونيو';
case 7:
return 'يوليو';
case 8:
return 'أغسطس';
case 9:
return 'سبتمبر';
case 10:
return ' اكتوبر';
case 11:
return ' نوفمبر';
case 12:
return 'ديسمبر';
}
}
}
class MeetingDataSource extends CalendarDataSource {

@ -17,6 +17,7 @@ import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart';
import 'package:mohem_flutter_app/widgets/nfc/nfc_reader_sheet.dart';
import 'package:nfc_manager/nfc_manager.dart';
import 'package:provider/provider.dart';
import 'package:wifi_iot/wifi_iot.dart';
import '../../provider/dashboard_provider_model.dart';
import '../../widgets/location/Location.dart';
@ -198,7 +199,16 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
performNfcAttendance(model);
}
}),
attendanceMethod("Wifi", "assets/images/wufu.svg", isWifiEnabled, () {}),
attendanceMethod("Wifi", "assets/images/wufu.svg", isWifiEnabled, () {
if (isWifiLocationEnabled) {
Location.getCurrentLocation((LatLng? latlng) {
performWifiAttendance(model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
});
} else {
performWifiAttendance(model);
}
// connectWifi();
}),
],
)
],
@ -257,6 +267,41 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
});
}
Future<void> performWifiAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async {
if (isWifiLocationEnabled) {
print("wifi location enabled");
} else {
print("wifi not location enabled");
}
bool v = await WiFiForIoTPlugin.connect(AppState().mohemmWifiSSID ?? "", password: AppState().mohemmWifiPassword ?? "", joinOnce: true, security: NetworkSecurity.WPA, withInternet: false);
if (v) {
await WiFiForIoTPlugin.forceWifiUsage(true);
print("connected");
Utils.showLoading(context);
try {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 3, nfcValue: "", isGpsRequired: isWifiLocationEnabled, lat: lat, long: lng);
bool status = await model.fetchAttendanceTracking(context);
Utils.hideLoading(context);
await closeWifiRequest();
} catch (ex) {
print(ex);
await closeWifiRequest();
Utils.hideLoading(context);
Utils.handleException(ex, context, (msg) {
Utils.confirmDialog(context, msg);
});
}
} else {
Utils.confirmDialog(context, "Please come near to HMG wifi");
}
}
Future<bool> closeWifiRequest() async {
await WiFiForIoTPlugin.forceWifiUsage(false);
bool v = await WiFiForIoTPlugin.disconnect();
return v;
}
Widget attendanceMethod(String title, String image, bool isEnabled, VoidCallback onPress) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),

@ -1,4 +1,5 @@
import 'dart:ui';
import 'package:flutter/material.dart';
class DrawerItem extends StatefulWidget {

@ -39,7 +39,7 @@ class MenusWidget extends StatelessWidget {
Row(
children: [
Expanded(
child: data.workListCounter.toString().toText16(color: Colors.white, isBold: true),
child: data.workListCounter.toString().toText16(color: Colors.white, isBold: true,maxlines: 1),
),
SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
],
@ -67,7 +67,7 @@ class MenusWidget extends StatelessWidget {
Row(
children: [
Expanded(
child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true),
child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true,maxlines: 1),
),
SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
],
@ -94,7 +94,7 @@ class MenusWidget extends StatelessWidget {
Row(
children: [
Expanded(
child: data.leaveBalance.toString().toText16(color: Colors.white, isBold: true),
child: data.leaveBalance.toString().toText16(color: Colors.white, isBold: true,maxlines: 1),
),
SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
],
@ -121,7 +121,7 @@ class MenusWidget extends StatelessWidget {
Row(
children: [
Expanded(
child: data.ticketBalance.toString().toText16(color: Colors.white, isBold: true),
child: data.ticketBalance.toString().toText16(color: Colors.white, isBold: true,maxlines: 1),
),
SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
],

@ -85,10 +85,10 @@ class ServicesWidget extends StatelessWidget {
)
],
).paddingOnly(left: 10, right: 10, bottom: 10, top: 12),
),
).onPress(() {
handleOnPress(context, data.homeMenus![parentIndex].menuEntiesList[index]);
});
).onPress(() {
handleOnPress(context, data.homeMenus![parentIndex].menuEntiesList[index]);
}),
);
},
separatorBuilder: (cxt, index) => 9.width,
itemCount: data.homeMenus![parentIndex].menuEntiesList.length),
@ -108,7 +108,13 @@ class ServicesWidget extends StatelessWidget {
}
void handleOnPress(context, GetMenuEntriesList menuEntry) {
print(menuEntry.menuName);
var pro = Provider.of<DashboardProviderModel>(context, listen: false);
List<GetMenuEntriesList>? menuList = pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && element.menuEntryType == "FUNCTION").toList();
menuEntry.icon = "";
print(menuEntry.toJson());
Navigator.pushNamed(context, AppRoutes.myAttendance, arguments: menuList ?? []);
return;
if (menuEntry.menuName == "HMG_OTL_SS" || menuEntry.menuName == "HMG_PT_OTL_SS") {
Navigator.pushNamed(context, AppRoutes.myAttendance);
} else {

@ -23,6 +23,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:shared_preferences/shared_preferences.dart';
class LoginScreen extends StatefulWidget {
LoginScreen({Key? key}) : super(key: key);
@ -70,6 +71,7 @@ class _LoginScreenState extends State<LoginScreen> {
String? firebaseToken;
GetMobileLoginInfoListModel? loginInfo;
Future<void> checkFirebaseToken() async {
try {
Utils.showLoading(context);
@ -108,6 +110,10 @@ class _LoginScreenState extends State<LoginScreen> {
if (_autoLogin) {
AppState().setMemberInformationListModel = (await MemberInformationListModel.getFromPrefs()).first;
AppState().setPrivilegeListModel = await PrivilegeListModel.getFromPrefs();
String mohemmWifiSSID = await Utils.getStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID);
String mohemmWifiPassword = await Utils.getStringFromPrefs(SharedPrefsConsts.mohemmWifiPassword);
AppState().mohemmWifiSSID = mohemmWifiSSID;
AppState().mohemmWifiPassword = mohemmWifiPassword;
}
Utils.hideLoading(context);
if (_autoLogin) {
@ -129,7 +135,7 @@ class _LoginScreenState extends State<LoginScreen> {
username.text = "15153";
password.text = "Abcd@1234";
// username.text = "15444";
// password.text = "w123456@";
return Scaffold(
body: Column(
children: [

@ -118,9 +118,9 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
shrinkWrap: true,
children: [
getButton(3),
getButton(4),
getButton(2),
getButton(1),
getButton(4),
],
)
],
@ -226,7 +226,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
} else {
try {
Utils.showLoading(context);
if (_flag == 2 || _flag == 3) {
if (_flag == 4 || _flag == 3) {
bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics();
if (authenticateWithFaceAndTouchID) {
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.dashboard, (Route<dynamic> route) => false);
@ -308,11 +308,11 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
Widget getButton(int flag) {
switch (flag) {
case 4:
case 2:
return _loginOptionButton(LocaleKeys.verifyThroughWhatsapp.tr(), 'assets/images/login/verify_whatsapp.svg', flag, null);
case 1:
return _loginOptionButton(LocaleKeys.verifyThroughSMS.tr(), 'assets/images/login/verify_sms.svg', flag, null);
case 2:
case 4:
return _loginOptionButton(LocaleKeys.verifyThroughFingerprint.tr(), 'assets/images/login/verify_thumb.svg', flag, BiometricType.fingerprint.index);
case 3:
return _loginOptionButton(LocaleKeys.verifyThroughFace.tr(), 'assets/images/login/verify_face.svg', flag, BiometricType.face.index);

@ -140,9 +140,9 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
shrinkWrap: true,
children: [
getButton(3),
getButton(4),
getButton(2),
getButton(1),
getButton(4),
],
)
],
@ -648,7 +648,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
} else {
try {
Utils.showLoading(context);
if (_flag == 2 || _flag == 3) {
if (_flag == 4 || _flag == 3) {
bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics();
if (!authenticateWithFaceAndTouchID) {
return;
@ -686,8 +686,12 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability
});
PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []);
AppState().mohemmWifiSSID = genericResponseModel.mohemmWifiSSID;
AppState().mohemmWifiPassword = 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.hideLoading(context);
Navigator.pop(context);
@ -695,7 +699,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
} catch (ex) {
print(ex);
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
Utils.handleException(ex, context, null);
}
},
() => {
@ -705,7 +709,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
} catch (ex) {
print(ex);
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
Utils.handleException(ex, context, null);
}
}
},
@ -735,11 +739,11 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
Widget getButton(int flag) {
switch (flag) {
case 4:
case 2:
return _loginOptionButton(LocaleKeys.verifyThroughWhatsapp.tr(), 'assets/images/login/verify_whatsapp.svg', flag, null);
case 1:
return _loginOptionButton(LocaleKeys.verifyThroughSMS.tr(), 'assets/images/login/verify_sms.svg', flag, null);
case 2:
case 4:
return _loginOptionButton(LocaleKeys.verifyThroughFingerprint.tr(), 'assets/images/login/verify_thumb.svg', flag, BiometricType.fingerprint.index);
case 3:
return _loginOptionButton(LocaleKeys.verifyThroughFace.tr(), 'assets/images/login/verify_face.svg', flag, BiometricType.face.index);

@ -0,0 +1,259 @@
import 'dart:convert';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/my_attendance_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/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/attachment_model.dart';
import 'package:mohem_flutter_app/models/get_approves_list_model.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/button/simple_button.dart';
import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
import 'package:mohem_flutter_app/widgets/input_widget.dart';
class RequestSubmitScreenParams {
String title;
int transactionId;
String pItemId;
RequestSubmitScreenParams(this.title, this.transactionId, this.pItemId);
}
class RequestSubmitScreen extends StatefulWidget {
RequestSubmitScreen({Key? key}) : super(key: key);
@override
_RequestSubmitScreenState createState() {
return _RequestSubmitScreenState();
}
}
class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
RequestSubmitScreenParams? params;
TextEditingController comments = TextEditingController();
List<GetApprovesList> approverList = [];
List<File> attachmentFiles = [];
@override
void initState() {
super.initState();
}
void getApproverList() async {
try {
Utils.showLoading(context);
approverList = await MyAttendanceApiClient().getApproversList("SSHRMS", params!.transactionId);
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
void submitRequest() async {
try {
Utils.showLoading(context);
List<Map<String, dynamic>> list = [];
if (attachmentFiles.isNotEmpty) {
attachmentFiles.asMap().forEach((index, value) async {
String type = value.path.split('.').last;
String name = value.path.split('/').last;
List<int> fileContent = await value.readAsBytes();
String encodedFile = base64Encode(fileContent);
list.add(AttachmentModel(
attachmentID: index,
pFILECONTENTTYPE: type,
pFILENAME: name,
pFILEDATA: encodedFile,
pTRANSACTIONID: params!.transactionId,
).toJson());
});
}
await MyAttendanceApiClient().addAttachment(list);
await MyAttendanceApiClient().startEitApprovalProcess(
"SUBMIT",
comments.text,
params!.pItemId,
params!.transactionId,
);
Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourRequestHasBeenSubmittedForApprovals.tr(), longDuration: true);
Navigator.of(context).popUntil((route) {
return route.settings.name == AppRoutes.dashboard;
});
Navigator.pushNamed(context, AppRoutes.workList);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
if (params == null) {
params = ModalRoute.of(context)!.settings.arguments as RequestSubmitScreenParams;
getApproverList();
}
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(
context,
title: params!.title,
),
body: Column(
children: [
ListView(
padding: const EdgeInsets.all(21).copyWith(top: 14),
physics: const BouncingScrollPhysics(),
children: [
attachmentView("Attachments"),
14.height,
InputWidget(
LocaleKeys.comments.tr(),
LocaleKeys.writeComment.tr(),
comments,
isBackgroundEnable: true,
lines: 3,
onChange: (String note) {
// this.note = note;
},
), //.objectContainerView(title: "Comments"),
14.height,
LocaleKeys.approversList.tr().toSectionHeading(),
14.height,
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) {
return approverView(cxt, approverList[index]);
},
separatorBuilder: (cxt, index) => 12.height,
itemCount: approverList.length,
)
],
).expanded,
DefaultButton(
LocaleKeys.submit.tr(),
() {
showDialog(
context: context,
builder: (cxt) => ConfirmDialog(
message: LocaleKeys.areYouSureYouWantToSubmit.tr(),
onTap: () {
Navigator.pop(context);
submitRequest();
},
),
);
},
).insideContainer,
],
),
);
}
Widget approverView(BuildContext context, GetApprovesList approver) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CircularAvatar(url: approver.eMPLOYEEIMAGE, isImageBase64: true, height: 40, width: 40),
9.width,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
approver.aPPROVER!.toText16(),
approver.pOSITIONTITLE!.toText12(color: MyColors.lightTextColor),
],
),
)
],
).objectContainerView();
}
Widget attachmentView(String title) {
return Container(
padding: const EdgeInsets.only(top: 15, bottom: 15, left: 14, right: 14),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
color: const Color(0xff000000).withOpacity(.05),
blurRadius: 26,
offset: const Offset(0, -3),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
title.toText16().expanded,
6.width,
SimpleButton("Add", () async {
FilePickerResult? result = await FilePicker.platform.pickFiles(allowMultiple: true);
if (result != null) {
attachmentFiles = attachmentFiles + result.paths.map((path) => File(path!)).toList();
attachmentFiles = attachmentFiles.toSet().toList();
setState(() {});
}
}, fontSize: 14),
],
),
if (attachmentFiles.isNotEmpty) 12.height,
if (attachmentFiles.isNotEmpty)
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) {
String fileName = attachmentFiles[index].path.split('/').last;
return Row(
children: [
fileName.toText13().expanded,
6.width,
IconButton(
padding: EdgeInsets.zero,
iconSize: 20,
icon: const Icon(Icons.cancel_rounded),
color: MyColors.redColor,
constraints: const BoxConstraints(),
onPressed: () async {
attachmentFiles.removeAt(index);
setState(() {});
},
)
],
);
},
separatorBuilder: (cxt, index) => 6.height,
itemCount: attachmentFiles.length),
],
),
);
}
}

@ -5,13 +5,17 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/my_attendance_api_client.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/dyanmic_forms/get_set_values_request_model.dart';
import 'package:mohem_flutter_app/models/dyanmic_forms/validate_eit_transaction_model.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart';
import 'package:mohem_flutter_app/ui/misc/request_submit_screen.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/button/default_button.dart';
@ -50,20 +54,58 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
}
}
void validateTransaction() async {
try {
Utils.showLoading(context);
List<Map<String, dynamic>> values = getEitDffStructureList!.map((e) {
String tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? "";
if (e.fORMATTYPE == "X") {
// for date format type, date format is changed
tempVar = e.eSERVICESDV?.pVALUECOLUMNNAME ?? "";
if (tempVar.isNotEmpty) {
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();
}).toList();
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_ACTION", nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: "NEW_ROW").toJson());
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_EXTRA_INFO_ID", nUMBERVALUE: -1, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson());
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_OBJECT_VERSION_NUMBER", nUMBERVALUE: 0, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson());
values.forEach((element) {
print(element);
});
genericResponseModel = await MyAttendanceApiClient().validateEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values);
SubmitEITTransactionList submitEITTransactionList = await MyAttendanceApiClient().submitEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values);
Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams("title", submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!));
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
String dESCFLEXCONTEXTCODE = "";
void calGetValueSetValues(GetEITDFFStructureList structureList) async {
try {
Utils.showLoading(context);
String segmentId = structureList.cHILDSEGMENTSVS!;
dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!;
List<GetEITDFFStructureList> filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVS == segmentId).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();
ESERVICESVS genericResponseModel = await MyAttendanceApiClient().getValueSetValues(structureList.cHILDSEGMENTSVS!, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
ESERVICESVS eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
List<GetEITDFFStructureList> abc = genericResponseModel?.getEITDFFStructureList ?? [];
getEitDffStructureList = abc;
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS);
getEitDffStructureList![index].eSERVICESVS!.add(genericResponseModel);
getEitDffStructureList![index].eSERVICESVS!.clear();
getEitDffStructureList![index].eSERVICESVS!.add(eServicesResponseModel);
// getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? [];
//getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList();
Utils.hideLoading(context);
@ -74,6 +116,36 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
}
}
void getDefaultValues(GetEITDFFStructureList structureList) async {
if ((structureList.cHILDSEGMENTSDVSplited?.length ?? 0) < 1) {
return;
}
try {
Utils.showLoading(context);
for (int i = 0; i < (structureList.cHILDSEGMENTSDVSplited?.length ?? 0); i++) {
String segmentId = structureList.cHILDSEGMENTSDVSplited![i];
GetEITDFFStructureList? reqObj = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId);
List<PARENTSEGMENTSDVSplited> parentRequired = reqObj.pARENTSEGMENTSDVSplited ?? [];
List<GetEITDFFStructureList> filteredList =
getEitDffStructureList!.where((outerElement) => parentRequired.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();
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);
}
}
@override
void dispose() {
super.dispose();
@ -109,9 +181,11 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
LocaleKeys.next.tr(),
(getEitDffStructureList ?? []).isEmpty
? null
: () => {
//Navigator.of(context).pushNamed(LOGIN_TYPE)
},
: () {
validateTransaction();
//Navigator.of(context).pushNamed(LOGIN_TYPE)
},
).insideContainer,
],
),
@ -120,30 +194,157 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
Widget parseDynamicFormatType(GetEITDFFStructureList model, int index) {
if (model.dISPLAYFLAG != "N") {
if (model.vALIDATIONTYPE == "N") {
if (model.fORMATTYPE == "C") {
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y",
onChange: (text) {
model.fieldAnswer = text;
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "N") {
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y",
isInputTypeNum: true,
onChange: (text) {
model.fieldAnswer = text;
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "X") {
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? "");
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
if (displayText.contains(" 00:00:00")) {
displayText = displayText.replaceAll(" 00:00:00", "");
}
if (!displayText.contains("-")) {
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
}
}
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
displayText,
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
selectedDate = DateFormat("yyyy/MM/dd").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else {
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
}
DateTime date = await _selectDate(context);
DateTime date1 = DateTime(date.year, date.month, date.day);
getEitDffStructureList![index].fieldAnswer = date.toString();
ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
pRETURNMSG: "null",
pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: getEitDffStructureList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
calGetValueSetValues(model);
}
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "Y") {
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? "");
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
if (displayText.contains(" 00:00:00")) {
displayText = displayText.replaceAll(" 00:00:00", "");
}
if (!displayText.contains("-")) {
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
}
}
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
displayText,
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
selectedDate = DateFormat("yyyy-MM-dd").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else {
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
}
DateTime date = await _selectDate(context);
DateTime date1 = DateTime(date.year, date.month, date.day);
getEitDffStructureList![index].fieldAnswer = date.toString();
ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
pRETURNMSG: "null",
pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: getEitDffStructureList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
calGetValueSetValues(model);
}
},
).paddingOnly(bottom: 12);
}
} else {
return PopupMenuButton(
child: DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pVALUECOLUMNNAME ?? "",
isEnable: false,
isPopup: true,
isInputTypeNum: true,
isReadOnly: model.rEADONLY == "Y",
).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),
],
onSelected: (int popipIndex) {
ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME,
pRETURNMSG: "null",
pRETURNSTATUS: getEitDffStructureList![popipIndex].dEFAULTVALUE,
pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME);
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
getDefaultValues(model);
}
});
}
} else {
return const SizedBox();
}
if (model.fORMATTYPE == "C") {
if (model.fORMATTYPE == "N") {
if (model.eSERVICESVS?.isNotEmpty ?? false) {
return PopupMenuButton(
child: DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
model.eSERVICESDV?.pVALUECOLUMNNAME ?? "",
isEnable: false,
isPopup: true,
isInputTypeNum: true,
isReadOnly: model.rEADONLY == "Y",
).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),
],
onSelected: (int index) {
onSelected: (int popipIndex) {
ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: model.eSERVICESVS![index].vALUECOLUMNNAME,
pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME,
pRETURNMSG: "null",
pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: model.eSERVICESVS![index].vALUECOLUMNNAME);
print(model.eSERVICESVS![index].toJson());
pRETURNSTATUS: getEitDffStructureList![popipIndex].dEFAULTVALUE,
pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME);
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
getDefaultValues(model);
}
});
}
@ -155,13 +356,29 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
model.fieldAnswer = text;
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "X") {
} else if (model.fORMATTYPE == "X" || model.fORMATTYPE == "Y") {
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? "");
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
if (displayText.contains(" 00:00:00")) {
displayText = displayText.replaceAll(" 00:00:00", "");
}
if (!displayText.contains("-")) {
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
}
}
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? ""),
displayText,
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
selectedDate = DateFormat("yyyy/MM/dd").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else {
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
}
DateTime date = await _selectDate(context);
DateTime date1 = DateTime(date.year, date.month, date.day);
getEitDffStructureList![index].fieldAnswer = date.toString();
@ -169,7 +386,34 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
pRETURNMSG: "null",
pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
pVALUECOLUMNNAME: getEitDffStructureList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
calGetValueSetValues(model);
}
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "I") {
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? ""),
suffixIconData: Icons.access_time_filled_rounded,
isEnable: false,
onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
var timeString = getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.split(":");
selectedDate = DateTime(0, 0, 0, int.parse(timeString[0]), int.parse(timeString[1]));
//DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
TimeOfDay _time = await _selectTime(context);
DateTime tempTime = DateTime(0, 1, 1, _time.hour, _time.minute);
String time = DateFormat('HH:mm').format(tempTime).trim();
// DateTime date1 = DateTime(date.year, date.month, date.day);
// getEitDffStructureList![index].fieldAnswer = date.toString();
ESERVICESDV eservicesdv = ESERVICESDV(pIDCOLUMNNAME: time, pRETURNMSG: "null", pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE, pVALUECOLUMNNAME: time);
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
@ -217,4 +461,45 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
}
return time;
}
Future<TimeOfDay> _selectTime(BuildContext context) async {
TimeOfDay time = TimeOfDay(hour: selectedDate.hour, minute: selectedDate.minute);
if (!Platform.isIOS) {
await showCupertinoModalPopup(
context: context,
builder: (cxt) => Container(
height: 250,
color: Colors.white,
child: CupertinoDatePicker(
backgroundColor: Colors.white,
mode: CupertinoDatePickerMode.time,
use24hFormat: true,
onDateTimeChanged: (value) {
if (value != null && value != selectedDate) {
time = TimeOfDay(hour: value.hour, minute: value.minute);
}
},
initialDateTime: selectedDate,
),
),
);
} else {
final TimeOfDay? picked = await showTimePicker(
context: context,
initialTime: time,
builder: (cxt, child) {
return MediaQuery(data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: child ?? Container());
});
if (picked != null && picked != time) {
time = picked;
}
// final DateTime? picked =
// await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101));
// if (picked != null && picked != selectedDate) {
// time = picked;
// }
}
return time;
}
}

@ -18,6 +18,7 @@ class DynamicListViewParams {
String uRL;
String requestID;
String colsURL;
DynamicListViewParams(this.title, this.dynamicId, {this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = ''});
}
@ -33,6 +34,7 @@ class DynamicListViewScreen extends StatefulWidget {
class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
List<GetEITTransactionList>? getEITTransactionList;
DynamicListViewParams? dynamicParams;
@override
void initState() {
super.initState();
@ -42,6 +44,9 @@ class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
try {
Utils.showLoading(context);
getEITTransactionList = await MyAttendanceApiClient().getEitTransaction(dynamicParams!.dynamicId);
getEITTransactionList?.forEach((element) {
element.collectionTransaction = element.collectionTransaction?.where((elemen) => elemen.dISPLAYFLAG == "Y").toList() ?? [];
});
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
@ -74,17 +79,19 @@ class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
? LocaleKeys.noDataAvailable.tr().toText16().center
: ListView.separated(
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.all(21),
itemBuilder: (cxt, int parentIndex) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++)
if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y")
ItemDetailView(
getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!, getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
],
).objectContainerView(),
padding: const EdgeInsets.all(21),
itemBuilder: (cxt, int parentIndex) => getEITTransactionList![parentIndex].collectionTransaction!.isEmpty
? const SizedBox()
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++)
if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y")
ItemDetailView(
getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!, getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
],
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
itemCount: getEITTransactionList!.length)),
floatingActionButton: Container(

@ -7,14 +7,18 @@ 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/dashboard/menu_entries.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';
class MyAttendanceScreen extends StatelessWidget {
MyAttendanceScreen({Key? key}) : super(key: key);
List<GetMenuEntriesList> list;
MyAttendanceScreen({Key? key, this.list = const <GetMenuEntriesList>[]}) : super(key: key);
@override
Widget build(BuildContext context) {
list = ModalRoute.of(context)!.settings.arguments as List<GetMenuEntriesList>;
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(
@ -24,29 +28,31 @@ class MyAttendanceScreen extends StatelessWidget {
body: SizedBox(
width: double.infinity,
height: double.infinity,
child: ListView(
children: [
itemView(
"assets/images/pdf.svg",
LocaleKeys.missingSwipes.tr(),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));
}),
12.height,
itemView(
"assets/images/pdf.svg",
LocaleKeys.workFromHome.tr(),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.workFromHome.tr(), "HMG_OTL_WFH_EIT_SS"));
}),
12.height,
itemView(
"assets/images/pdf.svg",
LocaleKeys.workOnBreak.tr(),
),
],
).paddingAll(21)),
child: list.isEmpty
? LocaleKeys.noDataAvailable.tr().toText16().center
: Column(
children: [
itemView(
"assets/images/pdf.svg",
LocaleKeys.missingSwipes.tr(),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));
}),
12.height,
ListView.separated(
padding: const EdgeInsets.all(21),
itemBuilder: (cxt, index) => itemView(
"assets/images/pdf.svg",
//LocaleKeys.missingSwipes.tr(),
list[index].prompt!,
).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(list[index].prompt!, list[index].functionName!));
}),
separatorBuilder: (cxt, index) => 12.height,
itemCount: list.length)
.expanded
],
)),
);
}

@ -96,11 +96,7 @@ class _BasicDetailsState extends State<BasicDetails> {
children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 28,
left: 26,
right: 26,
),
margin: EdgeInsets.only(top: 20, left: 21, right: 21,bottom: 20),
padding: EdgeInsets.only(left: 14, right: 14, top: 13, bottom: 5),
height: 280,
decoration: BoxDecoration(

@ -141,7 +141,7 @@ class _ContactDetailsState extends State<ContactDetails> {
right: 26,
),
padding: EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 20),
// height: 400,
height: 400,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(

@ -0,0 +1,74 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/profile_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/dialogs/otp_dialog.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.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/ui/profile/dynamic_screens/dynamic_input_familyMembers_screen.dart';
import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_profile_screen.dart';
import 'package:mohem_flutter_app/ui/profile/profile.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
class DeleteFamilyMember extends StatefulWidget {
const DeleteFamilyMember({Key? key}) : super(key: key);
@override
_DeleteFamilyMemberState createState() => _DeleteFamilyMemberState();
}
class _DeleteFamilyMemberState extends State<DeleteFamilyMember> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBarWidget(
context,
title: "Dependents And Beneficiaries",
),
backgroundColor: MyColors.backgroundColor,
bottomSheet: footer(),
body:Column(
children: [
],
)
);
}
footer() {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
color: MyColors.gradiantEndColor,
// margin: EdgeInsets.only(left: 50,right: 20),
padding: EdgeInsets.only(left: 50,right: 50),
child: TextButton(
style: TextButton.styleFrom(
primary:MyColors.white,
onSurface: MyColors.white,
backgroundColor: MyColors.gradiantEndColor,
),
onPressed: (){},
child: Text('Next',
style: TextStyle(
fontStyle: FontStyle.normal,
fontSize: 16,
color: Colors.white,
fontWeight: FontWeight.w600
),),
)
),
],
);
}
}

@ -0,0 +1,83 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/my_attendance_api_client.dart';
import 'package:mohem_flutter_app/api/profile_api_client.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/dyanmic_forms/get_set_values_request_model.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart';
import 'package:mohem_flutter_app/models/get_employee_contacts.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/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/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
class DynamicFamilyMembersParams {
String title;
//String dynamicId;
// String uRL;
// String requestID;
// String colsURL;
List<GetEmployeeContactsList>? getEmployeeContactsList;
DynamicFamilyMembersParams(this.title,
{this.getEmployeeContactsList = const <GetEmployeeContactsList>[]});
}
class DynamicFamilyMembersScreen extends StatefulWidget {
DynamicFamilyMembersScreen({Key? key}) : super(key: key);
@override
_DynamicFamilyMembersScreenState createState() {
return _DynamicFamilyMembersScreenState();
}
}
class _DynamicFamilyMembersScreenState extends State<DynamicFamilyMembersScreen> {
// GenericResponseModel? genericResponseModel;
DynamicFamilyMembersParams? dynamicFamilyParams;
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
if(dynamicFamilyParams == null) {
dynamicFamilyParams = ModalRoute.of(context)!.settings.arguments as DynamicFamilyMembersParams;
}
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(
context,
title: dynamicFamilyParams!.title,
),
body: Column(
children: [
],
),
);
}
}

@ -15,6 +15,7 @@ import 'package:mohem_flutter_app/models/dyanmic_forms/get_set_values_request_mo
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart';
import 'package:mohem_flutter_app/models/get_employee_contacts.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/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
@ -30,6 +31,7 @@ class DynamicProfileParams {
String colsURL;
List<GetEmployeeBasicDetailsList>? getEmployeeBasicDetailsList;
DynamicProfileParams(this.title, this.dynamicId,
{this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = '', this.getEmployeeBasicDetailsList = const <GetEmployeeBasicDetailsList>[]});
}

@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/profile_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/dialogs/otp_dialog.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
@ -15,6 +16,8 @@ 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/get_employee_basic_details.model.dart';
import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart';
import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_familyMembers_screen.dart';
import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_profile_screen.dart';
import 'package:mohem_flutter_app/ui/profile/profile.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
@ -30,7 +33,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
List<GetEmployeeContactsList> getEmployeeContactsList = [];
int? relationId;
@override
void initState() {
super.initState();
@ -59,146 +62,146 @@ class _FamilyMembersState extends State<FamilyMembers> {
),
backgroundColor: MyColors.backgroundColor,
bottomSheet:footer(),
body: Column(
children: [
SizedBox(height: 20,),
getEmployeeContactsList.length != 0
? SingleChildScrollView(
child: Column(
children: <Widget>[
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: getEmployeeContactsList.length,
itemBuilder: (context, index) {
return Container(
child: Column(
children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 26, right: 26,),
padding: EdgeInsets.only(left: 14, right: 14,top: 13, ),
height: 110,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 26,
offset: Offset(0, 3),
),
],
color: Colors.white,
borderRadius: BorderRadius.circular(10.0),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"${getEmployeeContactsList[index].cONTACTNAME}".toText16(color: MyColors.blackColor),
"${getEmployeeContactsList[index].rELATIONSHIP}".toText11(isBold: true, color: MyColors.textMixColor),
SizedBox(height: 5,),
Divider(
color: MyColors.lightGreyEFColor,
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
body: Container(
width: MediaQuery.of(context).size.width,
child: getEmployeeContactsList.length != 0
? SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(
children: <Widget>[
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: getEmployeeContactsList.length,
itemBuilder: (context, index) {
return Container(
child: Column(
children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 20, left: 21, right: 21,),
padding: EdgeInsets.only(left: 14, right: 14,top: 13, ),
height: 110,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 26,
offset: Offset(0, 3),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Container(
child: InkWell(
onTap: () {
},
child: RichText(
text: TextSpan(
children: [
WidgetSpan(
child: Icon(
Icons.edit,
size: 15,
color: MyColors.grey67Color,
],
color: Colors.white,
borderRadius: BorderRadius.circular(10.0),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"${getEmployeeContactsList[index].cONTACTNAME}".toText16(color: MyColors.blackColor),
"${getEmployeeContactsList[index].rELATIONSHIP}".toText11(isBold: true, color: MyColors.textMixColor),
SizedBox(height: 5,),
Divider(
color: MyColors.lightGreyEFColor,
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Container(
child: InkWell(
onTap: () {
showUpdateAlertDialog(context);
},
child: RichText(
text: TextSpan(
children: [
WidgetSpan(
child: Icon(
Icons.edit,
size: 15,
color: MyColors.grey67Color,
),
),
),
TextSpan(
text: LocaleKeys.update.tr(),
style: TextStyle(
color: MyColors.grey67Color,
fontSize: 12,
fontWeight: FontWeight.bold,
TextSpan(
text: LocaleKeys.update.tr(),
style: TextStyle(
color: MyColors.grey67Color,
fontSize: 12,
fontWeight: FontWeight.bold,
),
),
),
],
],
),
),
)
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: SizedBox(
child: Container(
width: 3,
color: MyColors.lightGreyEFColor,
),
)
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: SizedBox(
child: Container(
width: 3,
color: MyColors.lightGreyEFColor,
),
),
),
Container(
child: InkWell(
onTap: () {
showAlertDialog(context);
},
child: RichText(
text: TextSpan(
children: [
WidgetSpan(
child: Icon(
Icons.delete,
size: 15,
color: Color(0x99FF0000),
Container(
child: InkWell(
onTap: () {
showRemoveAlertDialog(context, getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt());
},
child: RichText(
text: TextSpan(
children: [
WidgetSpan(
child: Icon(
Icons.delete,
size: 15,
color: Color(0x99FF0000),
),
),
),
TextSpan(
text:LocaleKeys.remove.tr(),
style: TextStyle(
color: MyColors.DarkRedColor,
fontSize: 12,
fontWeight: FontWeight.bold,
TextSpan(
text:LocaleKeys.remove.tr(),
style: TextStyle(
color: MyColors.DarkRedColor,
fontSize: 12,
fontWeight: FontWeight.bold,
),
),
),
],
],
),
),
),
)
),
// ElevatedButton.icon(
// icon: Icon(
// Icons.delete,
// size: 15,
// color: Color(0x99FF0000),
// ),
// style: ElevatedButton.styleFrom(
// shadowColor: Colors.white,
// primary: Colors.white,
// ),
// label: "remove".toText12(color: MyColors.DarkRedColor),
// onPressed: (){},
// ),
],
),
]
)
),
// ElevatedButton.icon(
// icon: Icon(
// Icons.delete,
// size: 15,
// color: Color(0x99FF0000),
// ),
// style: ElevatedButton.styleFrom(
// shadowColor: Colors.white,
// primary: Colors.white,
// ),
// label: "remove".toText12(color: MyColors.DarkRedColor),
// onPressed: (){},
// ),
],
),
]
),
),
),
],
)
);
})
],
)
);
})
],
),
):Container(),
],
):Container(),
// SizedBox(height: 20),
)
@ -214,26 +217,57 @@ class _FamilyMembersState extends State<FamilyMembers> {
BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3),
],
),
child: DefaultButton(LocaleKeys.update.tr(), () async {
child: DefaultButton("Add New Family Member", () async {
// context.setLocale(const Locale("en", "US")); // to change Loacle
Profile();
}).insideContainer,
);
}
showAlertDialog(BuildContext context) {
showUpdateAlertDialog(BuildContext context) {
Widget cancelButton = TextButton(
child: Text("CANCEL"),
child: Text(LocaleKeys.cancel.tr(),),
onPressed: () {
Navigator.pop(context);
},
);
Widget continueButton = TextButton(
child: Text("OK"),
onPressed: () {},
child: Text(LocaleKeys.ok.tr(),),
onPressed: () {
continueDynamicForms();
},
);
AlertDialog alert = AlertDialog(
title: Text("Confirm"),
title: Text(LocaleKeys.confirm.tr(),),
content: Text("Are You Sure You Want to Update this Member?"),
actions: [
cancelButton,
continueButton,
],
);
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}
showRemoveAlertDialog(BuildContext context,int relationId) {
Widget cancelButton = TextButton(
child: Text(LocaleKeys.cancel.tr(),),
onPressed: () {
Navigator.pop(context);
},
);
Widget continueButton = TextButton(
child: Text(LocaleKeys.ok.tr(),),
onPressed: () {
Navigator.pushNamed(context, AppRoutes.deleteFamilyMember);
// continueDynamicForms();
},
);
AlertDialog alert = AlertDialog(
title: Text(LocaleKeys.confirm.tr(),),
content: Text("Are You Sure You Want to Remove this Member?"),
actions: [
cancelButton,
@ -248,4 +282,10 @@ class _FamilyMembersState extends State<FamilyMembers> {
);
}
void continueDynamicForms() {
Navigator.pushNamed(context, AppRoutes.addDynamicInputProfile,
arguments: DynamicFamilyMembersParams(LocaleKeys.profile_familyDetails.tr(), getEmployeeContactsList: getEmployeeContactsList));
}
}

@ -1,819 +0,0 @@
// import 'package:flutter/cupertino.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter_html/flutter_html.dart';
// import 'package:flutter_svg/flutter_svg.dart';
// import 'package:shared_preferences/shared_preferences.dart';
// import 'package:tangheem/api/admin_configuration_api_client.dart';
// import 'package:tangheem/api/tangheem_user_api_client.dart';
// import 'package:tangheem/app_state/app_state.dart';
// import 'package:tangheem/classes/colors.dart';
// import 'package:tangheem/classes/consts.dart';
// import 'package:tangheem/classes/utils.dart';
// import 'package:tangheem/extensions/string_extensions.dart';
// import 'package:tangheem/models/aya_tangheem_type_mapped.dart';
// import 'package:tangheem/models/discussion_model.dart';
// import 'package:tangheem/ui/dialogs/discussion_input_dialog.dart';
// import 'package:tangheem/widgets/aya_player_widget.dart';
// import 'package:tangheem/widgets/aya_record_widget.dart';
// import 'package:tangheem/widgets/text_highlight_widget.dart';
//
// import 'login_screen.dart';
//
// class TangheemDetailParams {
// final String selectedTangheemTypeId;
// final List<AyatTangheemTypeMappedData> ayatTangheemTypeMappedDataList;
//
// TangheemDetailParams({@required this.selectedTangheemTypeId, @required this.ayatTangheemTypeMappedDataList});
// }
//
// class TangheemDetailScreen extends StatefulWidget {
// static const String routeName = "/tangheem_detail";
// final TangheemDetailParams tangheemDetailParams;
//
// TangheemDetailScreen({Key key, this.tangheemDetailParams}) : super(key: key);
//
// @override
// _TangheemDetailScreenState createState() {
// return _TangheemDetailScreenState();
// }
// }
//
// class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
// GlobalKey _globalKey = GlobalKey();
//
// List<VoiceNote> voiceNoteList = [];
//
// List<AyatTangheemTypeMappedData> ayatTangheemTypeMappedDataList = [];
//
// List<AyatTangheemTypeMappedData> _dataList = [];
//
// int _discussionPage = -1;
// AyatTangheemTypeMappedData _ayatTangheemTypeMappedFirstData;
// DiscussionModel _discussionModel;
//
// bool showAyaPlayer = false;
//
// @override
// void initState() {
// super.initState();
// ayatTangheemTypeMappedDataList = widget.tangheemDetailParams.ayatTangheemTypeMappedDataList;
// _ayatTangheemTypeMappedFirstData = ayatTangheemTypeMappedDataList.first;
// filterVoiceListData();
// getPrefs();
// getTangheemDiscussionAndRelatedData();
// }
//
// double fontSize = 18;
//
// SharedPreferences prefs;
//
// void getPrefs() async {
// prefs = await SharedPreferences.getInstance();
// fontSize = (prefs.getInt(GlobalConsts.fontZoomSize) ?? 18) + 0.0;
// setState(() {});
// }
//
// String getArabicIndexWord(int index) {
// if (index == 0) {
// return 'الأولى';
// } else if (index == 1) {
// return 'الثانية';
// } else if (index == 2) {
// return 'الثالثة';
// } else if (index == 3) {
// return 'الرابعة';
// } else if (index == 4) {
// return 'الخامسة';
// }
// return "";
// }
//
// void getTangheemDiscussionAndRelatedData() async {
// Utils.showLoading(context);
// try {
// _discussionModel = await TangheemUserApiClient().getDiscussionByTangheemID(_discussionPage, widget.tangheemDetailParams.selectedTangheemTypeId);
// if (!_ayatTangheemTypeMappedFirstData.ayatNumberInSurahs.contains(",")) {
// _dataList = await getTangheemRelatedData();
// }
// Utils.hideLoading(context);
// setState(() {});
// } catch (ex) {
// print(ex);
// Utils.handleException(ex, context, null);
// Utils.hideLoading(context);
// }
// }
//
// Future<List<AyatTangheemTypeMappedData>> getTangheemRelatedData() async {
// _dataList = [];
// AyatTangheemTypeMapped _ayatTangheemTypeMapped =
// await TangheemUserApiClient().getAyaTangheemTypeMappedRelated(_ayatTangheemTypeMappedFirstData.surahNo, _ayatTangheemTypeMappedFirstData.ayatNumberInSurahs);
// _dataList = _ayatTangheemTypeMapped?.data ?? [];
// if (_dataList.isNotEmpty) {
// _dataList = _dataList.where((element) => element.tangheemTypeId != _ayatTangheemTypeMappedFirstData.tangheemTypeId)?.toList() ?? [];
// var _tempList = _dataList.map((e) => e.tangheemTypeId).toList().toSet().toList();
// var _dataTempList = <AyatTangheemTypeMappedData>[];
// _tempList.forEach((_tempElement) {
// _dataTempList.add(_dataList.firstWhere((element) {
// return !element.ayatNumberInSurahs.contains(",") && (element.tangheemTypeId == _tempElement);
// }, orElse: null));
// });
// _dataList = _dataTempList;
// }
//
// return _dataList;
// }
//
// void sendComment(String discussionText) async {
// Utils.showLoading(context);
// try {
// await AdminConfigurationApiClient().addDiscussion(discussionText, _ayatTangheemTypeMappedFirstData.ayaTangheemTypeId);
// Utils.showToast("تم إرسال التعليق ، سيكون مرئيًا بمجرد موافقة المسؤول عليه");
// Utils.hideLoading(context);
// Navigator.pop(context);
// } catch (ex) {
// Utils.handleException(ex, context, null);
// Utils.hideLoading(context);
// }
// }
//
// void filterVoiceListData() {
// ayatTangheemTypeMappedDataList.forEach((element) {
// voiceNoteList.addAll(element.voiceNote);
// });
// }
//
// @override
// void dispose() {
// super.dispose();
// }
//
// @override
// Widget build(BuildContext context) {
// return Container(
// padding: EdgeInsets.fromLTRB(16, 0, 16, 0),
// width: double.infinity,
// child: _ayatTangheemTypeMappedFirstData == null
// ? SizedBox()
// : Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Expanded(
// child: ListView(
// physics: BouncingScrollPhysics(),
// padding: EdgeInsets.only(bottom: 16, top: 16),
// children: [
// Text(
// _ayatTangheemTypeMappedFirstData.tangheemTypeName ?? "",
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: ColorConsts.primaryBlue, height: 1.5),
// ),
// SizedBox(height: 8),
// Text(
// _ayatTangheemTypeMappedFirstData.tangheemTypeDescription ?? "",
// style: TextStyle(fontSize: 14, color: ColorConsts.textGrey, height: 1),
// ),
// SizedBox(height: 8),
// Container(
// margin: EdgeInsets.only(top: 4, bottom: 4),
// padding: EdgeInsets.only(top: 8, bottom: 8, right: 4, left: 4),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(8),
// ),
// child: SingleChildScrollView(
// physics: NeverScrollableScrollPhysics(),
// child: RepaintBoundary(
// key: _globalKey,
// child: Material(
// color: Colors.white,
// child: ListView.builder(
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// itemCount: ayatTangheemTypeMappedDataList.length > 5 ? 5 : ayatTangheemTypeMappedDataList.length,
// itemBuilder: (context, index) {
// var _ayatTangheemTypeMappedData = ayatTangheemTypeMappedDataList[index];
// List<TangheemProperty> _tangheemInsideTableList = [];
// List<TangheemProperty> _tangheemAboveTableList = [];
// List<TangheemProperty> _tangheemBelowTableList = [];
// List<String> _tangheemWords = [];
//
// List<TangheemProperty> _tempPropertyList = List<TangheemProperty>() + _ayatTangheemTypeMappedData?.property ?? [];
// int firstIndex = _tempPropertyList.indexWhere((element) => element.isInsideTable);
// if (firstIndex >= 0) {
// var _tempPropertyListTop = _tempPropertyList.take(firstIndex);
// _tempPropertyListTop = _tempPropertyListTop.where((element) => (element.propertyValue ?? "").isNotEmpty)?.toList() ?? [];
// _tangheemAboveTableList = _tempPropertyListTop;
// _tempPropertyListTop.forEach((element) {
// _tempPropertyList.remove(element);
// });
// var _tempPropertyListInside = _tempPropertyList?.where((element) => (element.isInsideTable))?.toList() ?? [];
// _tempPropertyListInside.forEach((element) {
// _tempPropertyList.remove(element);
// });
// _tempPropertyListInside = _tempPropertyListInside.where((element) => (element.propertyValue ?? "").isNotEmpty)?.toList() ?? [];
// _tangheemInsideTableList = _tempPropertyListInside;
// var _tempPropertyListBelow = _tempPropertyList;
// _tempPropertyListBelow = _tempPropertyListBelow.where((element) => (element.propertyValue ?? "").isNotEmpty)?.toList() ?? [];
// _tangheemBelowTableList = _tempPropertyListBelow;
// }
//
// _tangheemWords.add(_ayatTangheemTypeMappedData.highlightText ?? "");
// // _tangheemInsideTableList =
// // _ayatTangheemTypeMappedData?.property?.where((element) => (element.isInsideTable) && (element.propertyValue ?? "").isNotEmpty)?.toList() ?? [];
// // _tangheemAboveTableList =
// // _ayatTangheemTypeMappedData?.property?.where((element) => (!element.isInsideTable) && (element.propertyValue ?? "").isNotEmpty)?.toList() ?? [];
// //
// //
//
// var _tempTangheemIndexWord = "";
// if (ayatTangheemTypeMappedDataList.length == 1) {
// _tempTangheemIndexWord = "";
// } else {
// _tempTangheemIndexWord = getArabicIndexWord(index) + " ";
// }
//
// return ListView(
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// padding: EdgeInsets.all(4),
// children: [
// Row(
// children: [
// Text(
// " جملة ${_ayatTangheemTypeMappedData.tangheemTypeName} $_tempTangheemIndexWord",
// style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white, backgroundColor: ColorConsts.primaryBlue),
// ),
// Expanded(
// child: Container(height: 2, color: ColorConsts.primaryBlue),
// ),
// ],
// ),
// SizedBox(height: 8),
// TextHighLightWidget(
// text: _ayatTangheemTypeMappedData.reverseAyatNumber() ?? "",
// valueColor: ColorConsts.primaryBlue,
// highlights: _tangheemWords,
// highLightFontSize: fontSize,
// style: TextStyle(
// fontFamily: "UthmanicHafs",
// fontSize: fontSize,
// fontWeight: FontWeight.bold,
// ),
// ),
// SizedBox(height: 16),
// ListView.separated(
// itemCount: _tangheemAboveTableList.length,
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// separatorBuilder: (context, index) {
// return Divider(
// color: Colors.white,
// height: 4,
// thickness: 0,
// );
// },
// itemBuilder: (context, index) {
// return Row(
// children: [
// Expanded(
// child: Container(
// height: 40,
// padding: EdgeInsets.only(left: 4, right: 8),
// alignment: Alignment.centerRight,
// child: Text(
// _tangheemAboveTableList[index].propertyText,
// maxLines: 1,
// style: TextStyle(fontWeight: FontWeight.bold, color: ColorConsts.secondaryOrange),
// ),
// color: ColorConsts.secondaryWhite,
// ),
// ),
// SizedBox(width: 4),
// Expanded(
// child: Container(
// color: ColorConsts.secondaryWhite,
// padding: EdgeInsets.all(4),
// child: Container(
// color: Colors.white,
// padding: EdgeInsets.only(left: 4, right: 8),
// // alignment: Alignment.centerRight,
// child: Html(
// data: _tangheemAboveTableList[index]?.propertyValue ?? "",
// style: {
// 'html': Style(textAlign: TextAlign.left),
// },
// ),
//
// // Text(
// // _tangheemAboveTableList[index].propertyValue,
// // maxLines: 1,
// // style: TextStyle(
// // color: Color(
// // Utils.stringToHex(_tangheemAboveTableList[index].textColor),
// // ),
// // ),
// // ),
// ),
// ),
// )
// ],
// );
// }),
// if (_tangheemInsideTableList.isNotEmpty)
// Container(
// color: ColorConsts.primaryBlue,
// margin: EdgeInsets.only(top: 8, bottom: 8),
// padding: EdgeInsets.all(8),
// child: Column(
// children: [
// Text(
// "خط النبر و التنغيم ل${_ayatTangheemTypeMappedData.tangheemTypeName ?? ""}",
// style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white),
// ),
// SizedBox(height: 8),
// tangheemInsideTablePropertyView(_tangheemInsideTableList)
// ],
// ),
// ),
// tangheemOutSideTablePropertyView(_tangheemBelowTableList)
// ],
// );
// }),
// ),
// ),
// ),
// ),
// SizedBox(height: 8),
// discussionView(_discussionModel?.data ?? []),
// if (_dataList.isNotEmpty)
// Container(
// margin: EdgeInsets.only(top: 8),
// padding: EdgeInsets.only(bottom: 20),
// width: double.infinity,
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(8),
// ),
// child: Column(
// children: [
// Container(
// height: 60,
// width: double.infinity,
// margin: EdgeInsets.only(bottom: 8),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: ColorConsts.primaryBlue,
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(8),
// topRight: Radius.circular(8),
// ),
// ),
// child: Text(
// "قائمة الأساليب اللغوية في هذه الآية",
// style: TextStyle(fontSize: 16, color: Colors.white),
// ),
// ),
// ListView.separated(
// padding: EdgeInsets.fromLTRB(4, 8, 4, 4),
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// itemCount: _dataList.length,
// separatorBuilder: (context, index) => SizedBox(height: 16),
// itemBuilder: (context, index) {
// return InkWell(
// onTap: () {
// List<AyatTangheemTypeMappedData> list = _dataList;
// var removedData = list[index];
// list.remove(removedData);
// list.insert(0, removedData);
// TangheemDetailParams tangheem = TangheemDetailParams(selectedTangheemTypeId: _dataList[index].ayaTangheemTypeId, ayatTangheemTypeMappedDataList: list);
// Navigator.pushNamed(context, TangheemDetailScreen.routeName, arguments: tangheem);
// },
// child: Text(
// _dataList[index].tangheemTypeName,
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16, color: ColorConsts.secondaryOrange, height: 1.5),
// ),
// );
// },
// ),
// ],
// ),
// ),
// SizedBox(height: 16),
// AyaRecordWidget()
// ],
// ),
// ),
// if (MediaQuery.of(context).orientation == Orientation.portrait)
// AyaPlayerWidget(
// surahName: _ayatTangheemTypeMappedFirstData?.surahNameAr ?? "",
// ayaTangheemTypeId: _ayatTangheemTypeMappedFirstData?.ayaTangheemTypeId ?? "",
// globalKey: _globalKey,
// ayaNo: _ayatTangheemTypeMappedFirstData?.ayahNo,
// surahNo: _ayatTangheemTypeMappedFirstData?.surahNo,
// voiceNoteList: voiceNoteList),
// if (MediaQuery.of(context).orientation == Orientation.landscape)
// Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// height: 24,
// margin: EdgeInsets.only(bottom: 8, top: 8),
// // color: Colors.transparent,
// child: TextButton(
// onPressed: () {
// setState(() {
// showAyaPlayer = !showAyaPlayer;
// });
// },
// child: Text(
// showAyaPlayer ? "إخفاء التسجيلات" : "إظهار التسجيلات",
// style: TextStyle(color: Colors.black87, fontSize: 12),
// ),
// style: TextButton.styleFrom(
// backgroundColor: ColorConsts.gradientOrange,
// primary: ColorConsts.primaryBlue,
// padding: EdgeInsets.only(top: 4, bottom: 4, right: 8, left: 8),
// textStyle: TextStyle(color: Colors.white, fontSize: 12),
// ),
// ),
// ),
// if (showAyaPlayer)
// AyaPlayerWidget(
// surahName: _ayatTangheemTypeMappedFirstData?.surahNameAr ?? "",
// ayaTangheemTypeId: _ayatTangheemTypeMappedFirstData?.ayaTangheemTypeId ?? "",
// ayaNo: _ayatTangheemTypeMappedFirstData?.ayahNo,
// surahNo: _ayatTangheemTypeMappedFirstData?.surahNo,
// globalKey: _globalKey,
// voiceNoteList: voiceNoteList),
// ],
// )
// ],
// ),
// );
// }
//
// Widget nextOptionButton(String icon, String text, VoidCallback onPressed) {
// return InkWell(
// onTap: onPressed,
// child: onPressed == null
// ? SizedBox()
// : Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisSize: MainAxisSize.min,
// children: [
// SvgPicture.asset(icon, height: 12, width: 12),
// SizedBox(width: 4),
// Text(
// text,
// style: TextStyle(color: ColorConsts.textGrey),
// ),
// ],
// ),
// );
// }
//
// Widget previousOptionButton(String icon, String text, VoidCallback onPressed) {
// return InkWell(
// onTap: onPressed,
// child: onPressed == null
// ? SizedBox()
// : Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisSize: MainAxisSize.min,
// children: [
// Text(
// text,
// style: TextStyle(color: ColorConsts.textGrey),
// ),
// SizedBox(width: 4),
// SvgPicture.asset(icon, height: 12, width: 12),
// ],
// ),
// );
// }
//
// Widget tangheemOutSideTablePropertyView(List<TangheemProperty> tangheemPropertyList) {
// return ListView.separated(
// itemCount: tangheemPropertyList.length,
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// separatorBuilder: (context, index) {
// return Divider(
// color: Colors.white,
// height: 4,
// thickness: 0,
// );
// },
// itemBuilder: (context, index) {
// return Row(
// children: [
// Expanded(
// child: Container(
// height: 40,
// padding: EdgeInsets.only(left: 4, right: 8),
// alignment: Alignment.centerRight,
// child: Text(
// tangheemPropertyList[index].propertyText,
// maxLines: 1,
// style: TextStyle(fontWeight: FontWeight.bold, color: ColorConsts.secondaryOrange),
// ),
// color: ColorConsts.secondaryWhite,
// ),
// ),
// SizedBox(width: 4),
// Expanded(
// child: Container(
// color: ColorConsts.secondaryWhite,
// padding: EdgeInsets.all(4),
// child: Container(
// color: Colors.white,
// padding: EdgeInsets.only(left: 4, right: 8),
// // alignment: Alignment.centerRight,
// child: Html(
// data: tangheemPropertyList[index]?.propertyValue ?? "",
// style: {
// 'html': Style(textAlign: TextAlign.left),
// },
// ),
// // Text(
// // tangheemPropertyList[index].propertyValue,
// // maxLines: 1,
// // style: TextStyle(
// // color: Color(
// // Utils.stringToHex(tangheemPropertyList[index].textColor),
// // ),
// // ),
// // ),
// ),
// ),
// )
// ],
// );
// });
// }
//
// Widget tangheemInsideTablePropertyView(List<TangheemProperty> tangheemPropertyList) {
// return Container(
// color: Colors.white,
// padding: EdgeInsets.all(2),
// child: Row(
// children: [
// for (var property in tangheemPropertyList)
// Expanded(
// child: Container(
// // color: ColorConsts.secondaryWhite,
// // padding: EdgeInsets.all(8),
// margin: EdgeInsets.only(left: 2, right: 2),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Container(
// color: ColorConsts.secondaryWhite,
// //height: 30,
// alignment: Alignment.center,
// padding: EdgeInsets.only(left: 2, right: 4),
// width: double.infinity,
// child: Text(
// property.propertyText ?? "",
// // maxLines: 1,
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 12, color: ColorConsts.secondaryOrange),
// ),
// ),
// Container(width: double.infinity, height: 4, color: Colors.white),
// Container(
// color: ColorConsts.secondaryWhite,
// padding: EdgeInsets.all(4),
// child: Container(
// color: Colors.white,
// padding: EdgeInsets.only(left: 2, right: 4),
// width: double.infinity,
// child: Html(
// data: property.propertyValue ?? "",
// style: {
// 'html': Style(textAlign: TextAlign.left),
// },
// ),
//
// // Text(
// // property.propertyValue ?? "",
// // maxLines: 1,
// // style: TextStyle(
// // fontSize: 12,
// // color: Color(
// // Utils.stringToHex(property.textColor),
// // ),
// // ),
// // ),
// ),
// ),
// ],
// ),
// ),
// )
// ],
// )
//
// //@todo sikander :commented these line for later discussion
// // ListView.separated(
// // itemCount: tangheemPropertyList.length,
// // physics: NeverScrollableScrollPhysics(),
// // padding: EdgeInsets.zero,
// // shrinkWrap: true,
// // separatorBuilder: (context, index) {
// // return Divider(
// // color: Colors.white,
// // height: 1,
// // thickness: 0,
// // );
// // },
// // itemBuilder: (context, index) {
// // return Container(
// // color: ColorConsts.secondaryWhite,
// // padding: EdgeInsets.all(8),
// // child: Column(
// // mainAxisSize: MainAxisSize.min,
// // crossAxisAlignment: CrossAxisAlignment.start,
// // mainAxisAlignment: MainAxisAlignment.center,
// // children: [
// // Text(
// // tangheemPropertyList[index].propertyText ?? "",
// // style: TextStyle(fontWeight: FontWeight.bold, fontSize: 12, color: ColorConsts.secondaryOrange),
// // ),
// // SizedBox(height: 4),
// // Text(
// // tangheemPropertyList[index].propertyValue ?? "",
// // style: TextStyle(
// // fontSize: 12,
// // color: Color(
// // Utils.stringToHex(tangheemPropertyList[index].textColor),
// // ),
// // ),
// // ),
// // ],
// // ),
// // );
// // },
// // ),
// );
// }
//
// Widget discussionView(List<DiscussionModelData> _discussionList) {
// _discussionList = _discussionList.where((element) => element.status.toLowerCase() == "Accept".toLowerCase()).toList();
// return Stack(
// alignment: Alignment.bottomCenter,
// children: [
// Container(
// margin: EdgeInsets.only(top: 4, bottom: 25),
// padding: EdgeInsets.all(8),
// width: double.infinity,
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(8),
// ),
// child: _discussionList.length > 0
// ? ListView.separated(
// padding: EdgeInsets.only(top: 4, bottom: 24),
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// itemCount: _discussionList.length,
// separatorBuilder: (context, index) => SizedBox(height: 16),
// itemBuilder: (context, index) {
// return Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// Row(
// children: [
// SvgPicture.asset(
// "assets/icons/chat_user.svg",
// width: 60,
// height: 60,
// ),
// SizedBox(width: 8),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text(
// "تعليق على الآية ${_ayatTangheemTypeMappedFirstData.ayatNumberInSurahs}",
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16, color: ColorConsts.primaryBlue, height: 1.5),
// ),
// SizedBox(height: 4),
// Directionality(
// textDirection: TextDirection.ltr,
// child: Text(
// _discussionList[index].date.toFormattedDate(),
// style: TextStyle(fontSize: 12, color: ColorConsts.textGrey, height: 1),
// ),
// ),
// ],
// )
// ],
// ),
// SizedBox(height: 4),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// "تعليق من: " + _discussionList[index].userName,
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14, color: ColorConsts.primaryBlue, height: 1.5),
// ),
// Text(
// _discussionList[index].discussionText,
// style: TextStyle(fontSize: 14, color: ColorConsts.textGrey, height: 1.4),
// ),
// if ((_discussionList[index]?.adminResponse ?? "").isNotEmpty) SizedBox(height: 4),
// if ((_discussionList[index]?.adminResponse ?? "").isNotEmpty)
// Text(
// "رد من المسؤول: " + _discussionList[index].adminResponse,
// style: TextStyle(fontSize: 14, color: ColorConsts.textGrey, height: 1.4),
// ),
// ],
// )
// ],
// );
// },
// )
// : Text(
// "لا يوجد تعليقات",
// style: TextStyle(fontSize: 12, color: ColorConsts.primaryBlue, height: 1.5),
// ),
// ),
// Positioned(
// bottom: 0,
// child: InkWell(
// borderRadius: BorderRadius.circular(30),
// onTap: () async {
// if (!AppState().isUserLogin) {
// Widget cancelButton = FlatButton(
// child: Text("أرغب بالتسجيل"),
// onPressed: () async {
// Navigator.pop(context);
// await Navigator.pushNamed(context, LoginScreen.routeName);
// if (!AppState().isUserLogin) {
// return;
// }
// },
// );
// Widget continueButton = FlatButton(
// child: Text("استمرار كضيف"),
// onPressed: () {
// Navigator.pop(context);
// return;
// },
// );
//
// AlertDialog alert = AlertDialog(
// content: Text("هذه الخاصية متاحه فقط للأعضاء المسجلين"),
// actions: [
// cancelButton,
// continueButton,
// ],
// );
//
// showDialog(
// context: context,
// builder: (BuildContext context) {
// return alert;
// },
// );
//
// return;
// }
// showDialog(
// context: context,
// barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8),
// builder: (BuildContext context) => DiscussionInputDialog(onCommentPress: (comment) {
// sendComment(comment);
// }),
// );
// },
// child: Container(
// height: 40,
// padding: EdgeInsets.only(left: 24, right: 24),
// alignment: Alignment.centerRight,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(30),
// color: ColorConsts.gradientPink,
// gradient: LinearGradient(
// stops: [0.0, 0.5],
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter,
// colors: [ColorConsts.gradientPink, ColorConsts.gradientOrange],
// ),
// ),
// child: Text(
// "إضافة تعليق",
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14, color: Colors.white, height: 1.5),
// ),
// ),
// ),
// ),
// ],
// );
// }
// }

@ -209,14 +209,15 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
myFab("Skip", "assets/images/skip.svg").onPress(() {
// if (AppState().workList!.length - 1 > AppState().workListIndex!) {
// AppState().setWorkListIndex = AppState().workListIndex! + 1;
// workListData = null;
// showFabOptions = false;
// getDataFromState();
// } else if (AppState().workList!.length - 1 == AppState().workListIndex!) {
// Navigator.pop(context);
// }
if (AppState().requestAllList!.length - 1 > AppState().itgWorkListIndex!) {
AppState().itgWorkListIndex = AppState().itgWorkListIndex! + 1;
requestDetails = null;
itgRequest = null;
showFabOptions = false;
getDataFromState();
} else if (AppState().requestAllList!.length - 1 == AppState().itgWorkListIndex!) {
Navigator.pop(context);
}
}),
12.height,
...viewApiButtonsList(allowedActionList),

@ -101,7 +101,7 @@ class ApprovalLevelfragment extends StatelessWidget {
}).expanded,
Container(width: 1, height: 30, color: MyColors.lightGreyEFColor),
LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() {
showMyBottomSheet(context, child: DelegateSheet());
// showMyBottomSheet(context, child: DelegateSheet());
}).expanded,
],
),

@ -1,7 +1,14 @@
import 'dart:collection';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/worklist/worklist_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
import 'package:mohem_flutter_app/ui/work_list/sheets/search_options_sheet.dart';
import 'package:mohem_flutter_app/ui/work_list/sheets/selected_item_sheet.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
@ -10,21 +17,92 @@ import 'package:mohem_flutter_app/widgets/input_widget.dart';
import 'package:mohem_flutter_app/widgets/radio/show_radio.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
class DelegateSheet extends StatelessWidget {
import '../../../models/generic_response_model.dart';
import '../../../models/get_action_history_list_model.dart';
import '../../../models/worklist/get_favorite_replacements_model.dart';
class DelegateSheet extends StatefulWidget {
int? notificationID;
String title,apiMode;
List<GetActionHistoryList>? actionHistoryList;
DelegateSheet({required this.title,required this.apiMode,this.notificationID, this.actionHistoryList});
@override
State<DelegateSheet> createState() => _DelegateSheetState();
}
class _DelegateSheetState extends State<DelegateSheet> {
TextEditingController username = TextEditingController();
bool isNeedEnableTextField = false;
String? selectedFavLetter;
String selectedType = "Workflow";
String inputRes = "";
List<String>? favLetters;
List<GetFavoriteReplacements>? favUsersList;
List<ReplacementList>? replacementList;
Future fetchFavLetters({bool isNeedLoading = true}) async {
favLetters = [];
if (isNeedLoading) Utils.showLoading(context);
List<GetFavoriteReplacements>? favList = await WorkListApiClient().getFavoriteReplacementWithoutImage();
List<String> result = [];
favList!.forEach((element) {
result.add(element.employeeDisplayName![0]);
});
favLetters = LinkedHashSet<String>.from(result).toList();
if (isNeedLoading) Utils.hideLoading(context);
setState(() {
favLetters!.sort((a, b) {
return a.toLowerCase().compareTo(b.toLowerCase());
});
});
return null;
}
Future fetchFavUsersList({bool isNeedLoading = true}) async {
if (isNeedLoading) Utils.showLoading(context);
favUsersList = await WorkListApiClient().getFavoriteReplacementWithImage(selectedFavLetter ?? "");
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
return null;
}
fetchChangeFav({required String email, required String employeName, required String image, required String userName, bool isFav = false, bool isNeedToRefresh = false}) async {
Utils.showLoading(context);
favLetters = null;
selectedFavLetter = null;
GenericResponseModel model = await WorkListApiClient().changeFavoriteReplacements(
email: email,
employeName: employeName,
image: image,
userName: userName,
isFav: isFav,
);
if (isNeedToRefresh) {
await fetchFavLetters(isNeedLoading: false);
if (favLetters != null) await fetchFavUsersList(isNeedLoading: false);
}
Utils.hideLoading(context);
setState(() {});
}
Future fetchUserByInput({bool isNeedLoading = true}) async {
if (isNeedLoading) Utils.showLoading(context);
replacementList = await WorkListApiClient().searchUserByInput(
userId: selectedType == "Employee ID" ? inputRes : "",
userName: selectedType == "Employee Name" ? inputRes : "",
email: selectedType == "Employee Email" ? inputRes : "",
);
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
return null;
}
@override
Widget build(BuildContext context) {
List<String> related = [
"Amjad Khan",
"Munahi Nasser",
];
List<String> favorites = [
"Amjad Khan",
"Muhammad Ahmed",
"Majid Ali",
"Faris Mahmoud",
];
return Container(
width: double.infinity,
height: MediaQuery.of(context).size.height - 80,
@ -37,81 +115,219 @@ class DelegateSheet extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Delegate".toText24(),
widget.title.toText24(),
24.height,
"Search".toText16(),
12.height,
Row(
20.height,
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
flex: 2,
child: ShowRadio(
title: "Name", value: "Name", groupValue: "Name"),
),
Expanded(
flex: 3,
child: ShowRadio(
title: "User Name",
value: "User Name",
groupValue: "Name"),
Container(
padding: EdgeInsets.only(left: 8, right: 4, top: 6, bottom: 6),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.transparent,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: Row(
children: [
Expanded(
child: InputWidget(
"Search By " + selectedType,
"",
username,
isEnableBorder: false,
horizontalPadding: 4,
verticalPadding: 3,
isInputTypeNum: selectedType == "Employee ID" ? true : false,
isEnable: isNeedEnableTextField,
onChange: (v) {
inputRes = v;
},
),
),
Container(
height: 24,
width: 1,
color: Color(0xffE5E5E5),
),
Container(
padding: EdgeInsets.all(8),
child: Row(
children: [
Text(
selectedType,
style: const TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
4.width,
Icon(
Icons.keyboard_arrow_down,
color: Colors.black,
size: 16,
),
],
),
).onPress(() {
showMyBottomSheet(
context,
child: SearchOptionsSheet(
selectedType,
onSelection: (String value) {
selectedType = value;
if (value == "Workflow") {
setState(() {
isNeedEnableTextField = false;
selectedFavLetter = null;
favLetters = null;
favUsersList = null;
});
} else if (value == "Favorites") {
isNeedEnableTextField = false;
fetchFavLetters();
} else {
setState(() {
isNeedEnableTextField = true;
selectedFavLetter = null;
favLetters = null;
favUsersList = null;
});
}
},
),
);
}),
],
),
),
if (isNeedEnableTextField)
FlatButton(
onPressed: () {
fetchUserByInput();
},
child: Text(
"Search",
style: TextStyle(
color: Colors.blue,
decoration: TextDecoration.underline,
),
),
)
],
),
if (!isNeedEnableTextField) 12.height,
Row(
children: [
Expanded(
flex: 2,
child: ShowRadio(
title: "Email",
value: "Email",
groupValue: "Name"),
child: Container(
width: double.infinity,
child: selectedFavLetter == null && favLetters != null
? Container(
width: double.infinity,
alignment: Alignment.center,
child: "Please select letter to see Fav results".toText12(),
)
: favUsersList != null
? ListView.separated(
itemBuilder: (context, index) {
return showFavUserItem(favUsersList![index]);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderColor,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
).onPress(() {});
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: favUsersList!.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
)
: isNeedEnableTextField && replacementList == null
? Container(
width: double.infinity,
alignment: Alignment.center,
child: "Search User".toText12(),
)
: isNeedEnableTextField && replacementList!.length == 0
? Container(
width: double.infinity,
alignment: Alignment.center,
child: "No Data Found".toText12(),
)
: isNeedEnableTextField
? ListView.separated(
itemBuilder: (context, index) {
return showInputUserItem(replacementList![index]);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderColor,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: replacementList!.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
)
: ListView.separated(
itemBuilder: (context, index) {
return showItem(widget.actionHistoryList![index]);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderColor,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: widget.actionHistoryList!.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
),
),
),
if (favLetters != null)
Container(
width: 30,
// color: Colors.red,
child: ListView.separated(
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.all(8),
alignment: Alignment.center,
child: favLetters![index].toText14(color: selectedFavLetter == favLetters![index] ? MyColors.gradiantStartColor : Colors.black),
).onPress(() {
selectedFavLetter = favLetters![index].toUpperCase();
fetchFavUsersList();
});
},
separatorBuilder: (context, index) {
return SizedBox(
height: 0,
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: favLetters!.length,
),
),
],
),
20.height,
InputWidget(
"Search By Username",
"",
username,
isBackgroundEnable: true,
),
24.height,
"Related".toText16(),
12.height,
ListView.separated(
itemBuilder: (context, index) {
return showItem(context, related[index]);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderColor,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: related.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
),
24.height,
"Favorites".toText16(),
12.height,
ListView.separated(
itemBuilder: (context, index) {
return showItem(context, favorites[index],
isEnabled: true);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderColor,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: favorites.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
),
],
),
),
@ -138,26 +354,137 @@ class DelegateSheet extends StatelessWidget {
);
}
Widget showItem(BuildContext context, String name, {bool isEnabled = false}) {
Widget showItem(GetActionHistoryList actionHistory) {
return InkWell(
onTap: () {
showMyBottomSheet(context, child: SelectedItemSheet("Delegate"));
showMyBottomSheet(context,
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
actionHistoryList: actionHistory,
notificationID: widget.notificationID,
));
},
child: Row(
children: [
CircularAvatar(
url: actionHistory.eMPLOYEEIMAGE ?? "",
height: 30,
width: 30,
isImageBase64: true,
),
16.width,
Expanded(
child: name.toText12(),
child: (actionHistory.nAME ?? "").toText12(),
),
Icon(
Icons.star,
size: 16,
color: isEnabled ? MyColors.yellowColor : MyColors.borderColor,
IconButton(
onPressed: () {
actionHistory.isFavorite = true;
fetchChangeFav(
email: actionHistory.eMAILADDRESS ?? "",
employeName: actionHistory.nAME ?? "",
image: actionHistory.eMPLOYEEIMAGE ?? "",
userName: actionHistory.uSERNAME ?? "",
isFav: true,
);
},
icon: Icon(
Icons.star,
size: 16,
color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor,
),
)
],
),
);
}
Widget showFavUserItem(GetFavoriteReplacements actionHistory) {
return InkWell(
onTap: () {
showMyBottomSheet(context,
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
favoriteReplacements: actionHistory,
notificationID: widget.notificationID,
));
},
child: Row(
children: [
CircularAvatar(
url: actionHistory.employeeImage ?? "",
height: 30,
width: 30,
isImageBase64: true,
),
16.width,
Expanded(
child: (actionHistory.employeeDisplayName ?? "").toText12(),
),
IconButton(
onPressed: () {
fetchChangeFav(
email: actionHistory.emailAddress ?? "",
employeName: actionHistory.employeeDisplayName ?? "",
image: actionHistory.employeeImage ?? "",
userName: actionHistory.userName ?? "",
isFav: false,
isNeedToRefresh: true,
);
},
icon: Icon(
Icons.star,
size: 16,
color: MyColors.yellowColor,
),
)
],
),
);
}
Widget showInputUserItem(ReplacementList actionHistory) {
return InkWell(
onTap: () {
showMyBottomSheet(context,
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
replacementList: actionHistory,
notificationID: widget.notificationID,
));
},
child: Row(
children: [
CircularAvatar(
url: actionHistory.employeeImage ?? "",
height: 30,
width: 30,
isImageBase64: true,
),
16.width,
Expanded(
child: (actionHistory.employeeDisplayName ?? "").toText12(),
),
IconButton(
onPressed: () {
actionHistory.isFavorite = !(actionHistory.isFavorite ?? false);
fetchChangeFav(
email: actionHistory.emailAddress ?? "",
employeName: actionHistory.employeeDisplayName ?? "",
image: actionHistory.employeeImage ?? "",
userName: actionHistory.userName ?? "",
isFav: false,
isNeedToRefresh: false,
);
},
icon: Icon(
Icons.star,
size: 16,
color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor,
),
)
],
),
);

@ -141,7 +141,7 @@ class RequestMoreInfoSheet extends StatelessWidget {
Widget showItem(BuildContext context, String name, {bool isEnabled = false}) {
return InkWell(
onTap: () {
showMyBottomSheet(context, child: SelectedItemSheet("Request more info"));
// showMyBottomSheet(context, child: SelectedItemSheet("Request more info"));
},
child: Row(
children: [

@ -0,0 +1,65 @@
import 'package:flutter/material.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 '../../../classes/colors.dart';
import '../../../widgets/radio/show_radio.dart';
class SearchOptionsSheet extends StatelessWidget {
String selectedType;
Function(String) onSelection;
SearchOptionsSheet(this.selectedType, {required this.onSelection});
List<String> searchOptions = [
"Workflow",
"Favorites",
"Employee ID",
"Employee Email",
"Employee Name",
];
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
padding: EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
"Search By".toText16(),
12.height,
ListView.separated(
itemBuilder: (context, index) {
return Container(
width: double.infinity,
padding: EdgeInsets.only(top: 12, bottom: 12),
child: ShowRadio(
title: searchOptions[index],
value: searchOptions[index],
groupValue: selectedType,
selectedColor: MyColors.gradiantStartColor,
),
).onPress(() {
onSelection(searchOptions[index]);
Navigator.pop(context);
});
},
separatorBuilder: (context, index) {
return Container(
width: double.infinity,
height: 1,
color: Color(0xffE3E3E3),
);
},
itemCount: searchOptions.length,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
)
],
),
);
}
}

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

Loading…
Cancel
Save