Merge branch 'master' into development_sikander

# Conflicts:
#	android/app/src/main/AndroidManifest.xml
#	assets/langs/en-US.json
#	lib/config/routes.dart
#	lib/extensions/string_extensions.dart
#	lib/generated/codegen_loader.g.dart
#	lib/main.dart
#	lib/models/generic_response_model.dart
#	lib/ui/my_attendance/my_attendance_screen.dart
#	lib/ui/work_list/worklist_detail_screen.dart
merge-requests/1/merge
Sikander Saleem 3 years ago
commit 95e2e74fd0

@ -1,20 +1,24 @@
<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"/>
<uses-permission android:name="android.permission.NFC" />
<application
android:icon="@mipmap/ic_launcher"
android:label="Mohemm"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round">
android:roundIcon="@mipmap/ic_launcher_round"
android:networkSecurityConfig="@xml/network_security_config">
<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
@ -22,8 +26,7 @@
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/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
@ -31,11 +34,10 @@
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
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.

@ -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": "شهر",

@ -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,7 @@
"maritalStatus ": "Marital Status ",
"fullName": "Full Name",
"remove": "Remove",
"Attendance":"Attendance",
"submit": "Submit",
"areYouSureYouWantToSubmit": "Are you sure you want to submit?",
"comments": "Comments",

@ -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);

@ -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);

@ -27,6 +27,7 @@ class ProfileApiClient {
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
print(responseData);
return responseData.getEmployeeContactsList ?? [];
}, url, postParams);
}
@ -122,10 +123,7 @@ class ProfileApiClient {
Future<List<GetPhoneNumberTypesModel>> getPhoneNumberTypes() async {
String url = "${ApiConsts.erpRest}GET_OBJECT_VALUES";
Map<String, dynamic> postParams = {
"P_MENU_TYPE": "E",
"P_SELECTED_RESP_ID": -999,
};
Map<String, dynamic> postParams = {"P_MENU_TYPE": "E", "P_SELECTED_RESP_ID": -999, "P_OBJECT_NAME": "PHONE_TYPE", "P_OBJECT_TYPE": "LOOKUP"};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);

@ -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);

@ -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";
}

@ -14,6 +14,7 @@ import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listv
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';
@ -71,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(),
@ -112,6 +114,7 @@ class AppRoutes {
dynamicScreen: (context) => DynamicListViewScreen(),
addDynamicInput: (context) => DynamicInputScreen(),
addDynamicInputProfile: (context) => DynamicInputScreenProfile(),
deleteFamilyMember: (context) => DeleteFamilyMember(),
requestSubmitScreen: (context) => RequestSubmitScreen(),
};
}

@ -52,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),
);
@ -72,9 +73,9 @@ extension EmailValidator on String {
style: TextStyle(height: 1, color: color ?? MyColors.darkTextColor, fontSize: 22, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
Widget toText24({Color? color, bool isBold = false, bool 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(

@ -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": "شهر",
@ -370,10 +371,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",
@ -539,6 +540,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",
@ -551,7 +553,8 @@ 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",

@ -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';

@ -10,6 +10,10 @@ 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';
@ -64,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,

@ -6,6 +6,7 @@ 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';
@ -33,6 +34,11 @@ import 'package:mohem_flutter_app/models/profile/phone_number_types_modek.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';
@ -121,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;
GetDefaultValueList? getDefaultValueList;
List<String>? getEITCollectionNotificationBodyList;
List<GetEitCollectionNotificationBodyList>? getEITCollectionNotificationBodyList;
List<GetEITDFFStructureList>? getEITDFFStructureList;
List<GetEITTransactionList>? getEITTransactionList;
List<String>? getEarningsList;
@ -158,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;
@ -215,7 +221,7 @@ class GenericResponseModel {
List<MemberInformationListModel>? memberInformationList;
MemberLoginListModel? memberLoginList;
String? mohemmGetBusinessCardEnabledList;
List? mohemmGetFavoriteReplacementsList;
List<GetFavoriteReplacements>? mohemmGetFavoriteReplacementsList;
String? mohemmGetMobileDeviceInfobyEmpInfoList;
List<GetMobileLoginInfoListModel>? mohemmGetMobileLoginInfoList;
String? mohemmGetPatientIDList;
@ -246,7 +252,7 @@ class GenericResponseModel {
List<PrivilegeListModel>? privilegeList;
String? processTransactions;
String? registerUserNameList;
String? replacementList;
List<ReplacementList>? replacementList;
String? respondAttributesList;
String? respondRolesList;
String? resubmitAbsenceTransactionList;
@ -675,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>[];
@ -685,7 +691,9 @@ class GenericResponseModel {
}
getDeductionsList = json['GetDeductionsList'];
getDefaultValueList = json['GetDefaultValueList'] != null ? GetDefaultValueList.fromJson(json['GetDefaultValueList']) : null;
getEITCollectionNotificationBodyList = json['GetEITCollectionNotificationBodyList'];
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) {
@ -772,7 +780,7 @@ 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) {
@ -887,7 +895,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>[];
@ -942,7 +952,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'];

@ -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'];

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

@ -1,4 +1,3 @@
class GetEmployeePhonesList {
String? dATEFROM;
String? dATETO;
@ -10,20 +9,12 @@ class GetEmployeePhonesList {
String? pHONETYPE;
String? pHONETYPEMEANING;
int? rOWINDEX;
String? aCTION;
GetEmployeePhonesList(
{this.dATEFROM,
this.dATETO,
this.oBJECTVERSIONNUMBER,
this.pARENTID,
this.pARENTTABLE,
this.pHONEID,
this.pHONENUMBER,
this.pHONETYPE,
this.pHONETYPEMEANING,
this.rOWINDEX});
{this.aCTION, this.dATEFROM, this.dATETO, this.oBJECTVERSIONNUMBER, this.pARENTID, this.pARENTTABLE, this.pHONEID, this.pHONENUMBER, this.pHONETYPE, this.pHONETYPEMEANING, this.rOWINDEX});
GetEmployeePhonesList.fromJson(Map<String, dynamic> json) {
aCTION = json['ACTION'];
dATEFROM = json['DATE_FROM'];
dATETO = json['DATE_TO'];
oBJECTVERSIONNUMBER = json['OBJECT_VERSION_NUMBER'];
@ -38,6 +29,7 @@ class GetEmployeePhonesList {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ACTION'] = this.aCTION;
data['DATE_FROM'] = this.dATEFROM;
data['DATE_TO'] = this.dATETO;
data['OBJECT_VERSION_NUMBER'] = this.oBJECTVERSIONNUMBER;

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

@ -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,17 +286,61 @@ 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) {
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,
),
alignment: Alignment.center,
child: Text(
"${val}",
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
color: MyColors.greyA5Color,
),
),
);
}
//check day is Present
else if (getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'Y') {
return Container(
margin: const EdgeInsets.all(4),
decoration: BoxDecoration(
@ -373,7 +361,7 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
),
alignment: Alignment.center,
child: Text(
"${build.date.day}",
"${val}",
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
@ -381,7 +369,9 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
),
),
);
} else if (isAbsent) {
}
//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(
@ -397,7 +387,7 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
),
alignment: Alignment.center,
child: Text(
"${build.date.day}",
"${val}",
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
@ -405,7 +395,7 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
),
),
);
} else if (isMissingDays) {
}
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),

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

@ -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) {
@ -126,10 +132,11 @@ class _LoginScreenState extends State<LoginScreen> {
@override
Widget build(BuildContext context) {
username.text = "15153";
// username.text = "15153";
password.text = "Abcd@1234";
// username.text = "15444";
// password.text = "w123456@";
username.text = "15444";
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);
@ -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);

@ -30,7 +30,16 @@ class MyAttendanceScreen extends StatelessWidget {
height: double.infinity,
child: list.isEmpty
? LocaleKeys.noDataAvailable.tr().toText16().center
: ListView.separated(
: 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",
@ -40,7 +49,10 @@ class MyAttendanceScreen extends StatelessWidget {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(list[index].prompt!, list[index].functionName!));
}),
separatorBuilder: (cxt, index) => 12.height,
itemCount: list.length)),
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(

@ -75,7 +75,8 @@ class _ContactDetailsState extends State<ContactDetails> {
),
backgroundColor: MyColors.backgroundColor,
bottomSheet: footer(),
body: Column(children: [
body: SingleChildScrollView(
child: Column(children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(
@ -84,7 +85,8 @@ class _ContactDetailsState extends State<ContactDetails> {
right: 26,
),
padding: EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 20),
height: 200,
///height: 200,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
@ -152,7 +154,6 @@ class _ContactDetailsState extends State<ContactDetails> {
color: Colors.white,
borderRadius: BorderRadius.circular(10.0),
),
child: SingleChildScrollView(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
@ -177,7 +178,7 @@ class _ContactDetailsState extends State<ContactDetails> {
),
]))
.toList())
])))
]))
// "${getEmployeeAddressList[0].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor),
// "${getEmployeeAddressList[0].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor),
// SizedBox(
@ -208,7 +209,7 @@ class _ContactDetailsState extends State<ContactDetails> {
//]),
//),
//],
]));
])));
}
footer() {

@ -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,11 +62,11 @@ class _FamilyMembersState extends State<FamilyMembers> {
),
backgroundColor: MyColors.backgroundColor,
bottomSheet:footer(),
body: Column(
children: [
SizedBox(height: 20,),
getEmployeeContactsList.length != 0
body: Container(
width: MediaQuery.of(context).size.width,
child: getEmployeeContactsList.length != 0
? SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(
children: <Widget>[
ListView.builder(
@ -77,7 +80,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 26, right: 26,),
margin: EdgeInsets.only(top: 20, left: 21, right: 21,),
padding: EdgeInsets.only(left: 14, right: 14,top: 13, ),
height: 110,
decoration: BoxDecoration(
@ -111,7 +114,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
Container(
child: InkWell(
onTap: () {
showUpdateAlertDialog(context);
},
child: RichText(
text: TextSpan(
@ -148,7 +151,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
Container(
child: InkWell(
onTap: () {
showAlertDialog(context);
showRemoveAlertDialog(context, getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt());
},
child: RichText(
text: TextSpan(
@ -198,7 +201,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
],
),
):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(LocaleKeys.cancel.tr(),),
onPressed: () {
Navigator.pop(context);
},
);
Widget continueButton = TextButton(
child: Text(LocaleKeys.ok.tr(),),
onPressed: () {
continueDynamicForms();
},
);
AlertDialog alert = AlertDialog(
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("CANCEL"),
child: Text(LocaleKeys.cancel.tr(),),
onPressed: () {
Navigator.pop(context);
},
);
Widget continueButton = TextButton(
child: Text("OK"),
onPressed: () {},
child: Text(LocaleKeys.ok.tr(),),
onPressed: () {
Navigator.pushNamed(context, AppRoutes.deleteFamilyMember);
// continueDynamicForms();
},
);
AlertDialog alert = AlertDialog(
title: Text("Confirm"),
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));
}
}

@ -48,16 +48,43 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
),
backgroundColor: MyColors.backgroundColor,
bottomSheet: footer(),
body: Column(children: [
body: SingleChildScrollView(
child: Column(children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 25, right: 25, top: 25),
padding: EdgeInsets.all(20),
// height: 400,
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.0), border: Border.all(color: Color.fromARGB(255, 209, 207, 207))),
child: InkWell(
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Icon(
Icons.add,
color: Color(0xff259CB8),
),
Text(
'Add new row',
style: TextStyle(color: Color(0xff259CB8), fontWeight: FontWeight.bold),
)
]),
onTap: () {
addNewRow();
},
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: widget.getEmployeePhonesList
.map((e) => e.aCTION != 'DELETE_ROW'
? Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 20,
left: 26,
right: 26,
),
padding: EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 20),
height: 400,
padding: EdgeInsets.only(left: 14, right: 14, top: 15, bottom: 15),
// height: 400,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
@ -70,16 +97,12 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
color: Colors.white,
borderRadius: BorderRadius.circular(10.0),
),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: widget.getEmployeePhonesList
.map((e) => Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
PopupMenuButton(
child: DynamicTextFieldWidget(
"Please Select *",
e.pHONETYPEMEANING ?? "",
isEnable: true,
isEnable: false,
isPopup: true,
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
@ -87,12 +110,46 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
],
onSelected: (int index) {
e.pHONETYPEMEANING = getPhoneNumberTypesList[index].mEANING;
e.pHONETYPE = getPhoneNumberTypesList[index].cODE;
setState(() {});
}),
"${e.pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor),
DynamicTextFieldWidget(
"",
e.pHONENUMBER ?? "",
isReadOnly: false,
onChange: (text) {
e.pHONENUMBER = text;
},
).paddingOnly(bottom: 12),
InkWell(
child: Row(mainAxisAlignment: MainAxisAlignment.end, children: [
Icon(
Icons.delete,
color: Colors.red,
size: 18,
),
Text(
'Delete',
style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold),
)
]),
onTap: () {
// widget.getEmployeePhonesList.removeWhere((item) => item.pHONEID == e.pHONEID);
setState(() {
deleteRow(e);
});
},
),
SizedBox(
height: 10,
),
]))
.toList())))
]));
: Container())
.toList()),
SizedBox(
height: 80,
)
])));
}
footer() {
@ -105,11 +162,24 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
],
),
child: DefaultButton(LocaleKeys.update.tr(), () async {
updatePhone();
// context.setLocale(const Locale("en", "US")); // to change Loacle
Profile();
// Profile();
}).insideContainer,
);
}
updatePhone() {}
void updatePhone() {
print(widget.getEmployeePhonesList);
}
void addNewRow() {
setState(() {
widget.getEmployeePhonesList.add(GetEmployeePhonesList(aCTION: 'NEW_ROW'));
});
}
void deleteRow(GetEmployeePhonesList row) {
row.aCTION = 'DELETE_ROW';
}
}

@ -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,46 +115,159 @@ 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"),
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,
),
Expanded(
flex: 3,
child: ShowRadio(
title: "User Name",
value: "User Name",
groupValue: "Name"),
),
child: Row(
children: [
Expanded(
flex: 2,
child: ShowRadio(
title: "Email",
value: "Email",
groupValue: "Name"),
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,
),
],
),
20.height,
InputWidget(
"Search By Username",
"",
username,
isBackgroundEnable: true,
).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;
});
}
},
),
24.height,
"Related".toText16(),
12.height,
ListView.separated(
);
}),
],
),
),
if (isNeedEnableTextField)
FlatButton(
onPressed: () {
fetchUserByInput();
},
child: Text(
"Search",
style: TextStyle(
color: Colors.blue,
decoration: TextDecoration.underline,
),
),
)
],
),
if (!isNeedEnableTextField) 12.height,
Row(
children: [
Expanded(
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 showItem(context, related[index]);
return showInputUserItem(replacementList![index]);
},
separatorBuilder: (context, index) {
return Container(
@ -88,16 +279,12 @@ class DelegateSheet extends StatelessWidget {
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: related.length,
itemCount: replacementList!.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
),
24.height,
"Favorites".toText16(),
12.height,
ListView.separated(
)
: ListView.separated(
itemBuilder: (context, index) {
return showItem(context, favorites[index],
isEnabled: true);
return showItem(widget.actionHistoryList![index]);
},
separatorBuilder: (context, index) {
return Container(
@ -109,9 +296,38 @@ class DelegateSheet extends StatelessWidget {
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: favorites.length,
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,
),
),
],
),
],
),
),
@ -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(
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: isEnabled ? MyColors.yellowColor : MyColors.borderColor,
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,
)
],
),
);
}
}

@ -1,4 +1,5 @@
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/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
@ -8,12 +9,23 @@ 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';
import '../../../app_state/app_state.dart';
import '../../../classes/utils.dart';
import '../../../models/get_action_history_list_model.dart';
import '../../../models/worklist/get_favorite_replacements_model.dart';
import '../../../models/worklist/replacement_list_model.dart';
class SelectedItemSheet extends StatelessWidget {
String title;
String title, apiMode;
int? notificationID;
GetActionHistoryList? actionHistoryList;
GetFavoriteReplacements? favoriteReplacements;
ReplacementList? replacementList;
SelectedItemSheet(this.title);
SelectedItemSheet(this.title, {required this.apiMode, this.notificationID, this.actionHistoryList, this.favoriteReplacements, this.replacementList});
TextEditingController username = TextEditingController();
String comment = "";
@override
Widget build(BuildContext context) {
@ -31,40 +43,19 @@ class SelectedItemSheet extends StatelessWidget {
children: [
title.toText24(),
24.height,
"Search".toText16(),
if (actionHistoryList != null) showItem(actionHistoryList!.nAME, actionHistoryList!.isFavorite),
if (favoriteReplacements != null) showItem(favoriteReplacements!.employeeDisplayName, true),
if (replacementList != null) showItem(replacementList!.employeeDisplayName, replacementList!.isFavorite),
12.height,
Row(
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"),
),
Expanded(
flex: 2,
child: ShowRadio(
title: "Email",
value: "Email",
groupValue: "Name"),
),
],
),
20.height,
showItem("name"),
20.height,
InputWidget(
"Enter a note",
"This is simple note",
username,
isBackgroundEnable: true,
lines: 5,
onChange: (v) {
comment = v;
},
),
],
),
@ -96,7 +87,18 @@ class SelectedItemSheet extends StatelessWidget {
child: DefaultButton(
"Submit",
() {
Navigator.pop(context);
String? email = "", userId = "";
if (actionHistoryList != null) {
email = actionHistoryList!.eMAILADDRESS;
userId = actionHistoryList!.uSERNAME;
} else if (favoriteReplacements != null) {
email = favoriteReplacements!.emailAddress;
userId = favoriteReplacements!.userName;
} else {
email = replacementList!.emailAddress;
userId = replacementList!.userName;
}
performNetworkCall(context, email: email ?? "", userId: userId ?? "");
},
colors: [
Color(0xff32D892),
@ -111,7 +113,21 @@ class SelectedItemSheet extends StatelessWidget {
);
}
Widget showItem(String name) {
Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async {
Utils.showLoading(context);
try{
await WorkListApiClient().submitComment(comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode);
Utils.hideLoading(context);
Navigator.pop(context);
Navigator.pop(context);
Navigator.pop(context, "delegate_reload");
}catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
Widget showItem(String? name, bool? isFav) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
@ -130,19 +146,12 @@ class SelectedItemSheet extends StatelessWidget {
),
16.width,
Expanded(
child: name.toText12(),
child: (name ?? "").toText12(),
),
Container(
decoration: BoxDecoration(
color: MyColors.redColor,
borderRadius: BorderRadius.all(Radius.circular(100)),
),
padding: EdgeInsets.all(3),
child: Icon(
Icon(
Icons.star,
size: 12,
color: Colors.white,
),
color: (isFav ?? false) ? MyColors.yellowColor : MyColors.borderColor,
),
],
),

@ -229,7 +229,11 @@ class _WorkListScreenState extends State<WorkListScreen> {
onTap: () async {
AppState().setItgWorkListIndex = index;
var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.itgDetail);
// if (shouldReloadData != null) {
if (shouldReloadData != null) {
if (shouldReloadData.toString() == "delegate_reload") {
calculateCounter();
getWorkList();
}
// workList!.remove(data);
// AppState().setWorkList = workList;
// if (data.iTEMTYPE == "ITG") {
@ -246,7 +250,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
// }
// calculateCounter();
// if (mounted) setState(() {});
// }
}
},
child: Container(
width: double.infinity,
@ -309,6 +313,10 @@ class _WorkListScreenState extends State<WorkListScreen> {
var data = workList![index];
var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.workListDetail, arguments: workData);
if (shouldReloadData != null) {
if (shouldReloadData.toString() == "delegate_reload") {
calculateCounter();
getWorkList();
} else {
workList!.remove(data);
AppState().setWorkList = workList;
if (data.iTEMTYPE == "ITG") {
@ -324,6 +332,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
calculateCounter();
if (mounted) setState(() {});
}
}
},
child: Container(
width: double.infinity,

@ -24,6 +24,7 @@ import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_mod
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_response_model.dart';
import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart';
import 'package:mohem_flutter_app/ui/work_list/worklist_fragments/actions_fragment.dart';
import 'package:mohem_flutter_app/ui/work_list/worklist_fragments/attachments_fragment.dart';
import 'package:mohem_flutter_app/ui/work_list/worklist_fragments/detail_fragment.dart';
@ -33,6 +34,13 @@ 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/dialogs/accept_reject_input_dialog.dart';
import '../../models/worklist/hr/eit_otification_body_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 '../../widgets/bottom_sheet.dart';
import '../../widgets/dialogs/confirm_dialog.dart';
class WorkListDetailScreen extends StatefulWidget {
WorkListDetailScreen({Key? key}) : super(key: key);
@ -55,10 +63,16 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
List<GetStampMsNotificationBodyList> getStampMsNotifications = [];
List<GetStampNsNotificationBodyList> getStampNsNotifications = [];
List<GetMoNotificationBodyList> getMoNotificationBodyList = [];
List<GetAbsenceCollectionNotificationBodyList>? getAbsenceCollectionNotifications;
List<NotificationGetRespondAttributesList> getNotificationRespondAttributes = [];
NotificationGetRespondAttributesList? notificationNoteInput;
//HR Details Screen Requests
List<GetEitCollectionNotificationBodyList>? getEitCollectionNotificationBodyList = [];
List<GetPhonesNotificationBodyList>? getPhonesNotificationBodyList = [];
List<GetBasicDetNtfBodyList>? getBasicDetNtfBodyList = [];
List<GetAbsenceCollectionNotificationBodyList>? getAbsenceCollectionNotificationBodyList = [];
GetContactNotificationBodyList? getContactNotificationBodyList;
GenericResponseModel? getBasicNTFBody;
GenericResponseModel? getICBody;
GenericResponseModel? subordinatesLeavesModel;
@ -87,11 +101,20 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
}
if (workListData!.iTEMTYPE == "HRSSA") {
if (workListData!.rEQUESTTYPE == "EIT") {
} else {
getBasicNTFBody = await WorkListApiClient().getBasicDetNTFBody(workListData!.nOTIFICATIONID!, -999);
getAbsenceCollectionNotifications = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID!, -999);
subordinatesLeavesModel = await WorkListApiClient().getSubordinatesLeaves("", "");
getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID);
} else if (workListData!.rEQUESTTYPE == "PHONE_NUMBERS") {
getPhonesNotificationBodyList = await WorkListApiClient().getPhonesNotificationBodyList(workListData!.nOTIFICATIONID);
} else if (workListData!.rEQUESTTYPE == "BASIC_DETAILS") {
getBasicDetNtfBodyList = await WorkListApiClient().getBasicDetNtfBodyList(workListData!.nOTIFICATIONID);
} else if (workListData!.rEQUESTTYPE == "ABSENCE") {
getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID);
} else if (workListData!.rEQUESTTYPE == "CONTACT") {
getContactNotificationBodyList = await WorkListApiClient().getContactNotificationBodyList(workListData!.nOTIFICATIONID);
}
// getBasicNTFBody = await WorkListApiClient().getBasicDetNTFBody(workListData!.nOTIFICATIONID!, -999);
// getAbsenceCollectionNotifications = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID!, -999);
// subordinatesLeavesModel = await WorkListApiClient().getSubordinatesLeaves("", "");
}
if (workListData!.iTEMTYPE == "STAMP") {
if (workListData!.rEQUESTTYPE == "STAMP_MS") {
@ -185,9 +208,14 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
InfoFragment(
poHeaderList: getPoNotificationBody?.pOHeader ?? [],
workListData: workListData,
getAbsenceCollectionNotifications: getAbsenceCollectionNotifications,
itemCreationHeader: getItemCreationNtfBody?.itemCreationHeader ?? [],
getStampMsNotifications: getStampMsNotifications),
getStampMsNotifications: getStampMsNotifications,
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList,
getPhonesNotificationBodyList: getPhonesNotificationBodyList,
getBasicDetNtfBodyList: getBasicDetNtfBodyList,
getAbsenceCollectionNotificationBodyList: getAbsenceCollectionNotificationBodyList,
getContactNotificationBodyList: getContactNotificationBodyList,
),
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP")
? DetailFragment(workListData, memberInformationListModel)
: RequestFragment(
@ -195,7 +223,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
poLinesList: getPoNotificationBody?.pOLines ?? [],
itemCreationLines: getItemCreationNtfBody?.itemCreationLines ?? [],
),
ActionsFragment(actionHistoryList),
ActionsFragment(workListData!.nOTIFICATIONID, actionHistoryList),
AttachmentsFragment(getAttachmentList),
],
).expanded,
@ -333,17 +361,57 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
switch (notificationButton.bUTTONACTION) {
case "DELEGATE":
// do something
showMyBottomSheet(context, child: DelegateSheet(title: "Delegate", apiMode: "DELEGATE", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "REQUEST_INFO":
// do something else
showMyBottomSheet(context, child: DelegateSheet(title: "Request Info", apiMode: "REQUEST_INFO", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "RFC":
// do something else
break;
case "UPDATE_ACTION":
// do something else
case "APPROVE_AND_FORWARD":
// do something else
showMyBottomSheet(context,
child: DelegateSheet(title: "Approve and Forward", apiMode: "APPROVE_AND_FORWARD", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "FORWARD":
// do something else
showMyBottomSheet(context, child: DelegateSheet(title: "Forward", apiMode: "FORWARD", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "REJECT":
// do something else
performNetworkCall(context, email: "", userId: "");
break;
case "RETURNED":
// do something else
Navigator.pop(context);
break;
}
}
Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async {
showDialog(
context: context,
builder: (cxt) => ConfirmDialog(
message: "Are you sure want to reject?",
okTitle: "Reject",
onTap: () async {
Navigator.pop(cxt);
Utils.showLoading(context);
try {
await WorkListApiClient().submitComment(comment: "", email: email, userId: userId, notificationId: workListData!.nOTIFICATIONID, apiMode: "REJECT");
Utils.hideLoading(context);
Navigator.pop(context, "delegate_reload");
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
},
),
);
}
Widget myTab(String title, int index) {

@ -13,9 +13,10 @@ import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
class ActionsFragment extends StatelessWidget {
int? notificationID;
List<GetActionHistoryList> actionHistoryList;
ActionsFragment(this.actionHistoryList, {Key? key}) : super(key: key);
ActionsFragment(this.notificationID, this.actionHistoryList, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -96,11 +97,11 @@ class ActionsFragment extends StatelessWidget {
Row(
children: [
LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() {
showMyBottomSheet(context, child: RequestMoreInfoSheet());
showMyBottomSheet(context, child: DelegateSheet(title: "Request Info", apiMode: "REQUEST_INFO", notificationID: notificationID, actionHistoryList: actionHistoryList));
}).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(title: "Delegate", apiMode: "DELEGATE", notificationID: notificationID, actionHistoryList: actionHistoryList));
}).expanded,
],
),

@ -1,9 +1,15 @@
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.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/models/get_attachement_list_model.dart';
import 'package:open_file/open_file.dart';
import 'package:path_provider/path_provider.dart';
class AttachmentsFragment extends StatelessWidget {
final List<GetAttachementList> getAttachmentList;
@ -21,7 +27,11 @@ class AttachmentsFragment extends StatelessWidget {
12.width,
(getAttachmentList[index].fILENAME?.capitalizeFirstofEach ?? "").toText16().expanded,
],
).objectContainerView().onPress(() {});
).objectContainerView().onPress(() async {
print("calling");
String path = await _createFileFromString(getAttachmentList[index].fILEDATA ?? "", getAttachmentList[index].fILECONTENTTYPE ?? "");
OpenFile.open(path);
});
},
separatorBuilder: (BuildContext context, int index) => 12.height,
).paddingAll(21);
@ -51,4 +61,13 @@ class AttachmentsFragment extends StatelessWidget {
}
return icon;
}
Future<String> _createFileFromString(String encodedStr, String ext) async {
Uint8List bytes = base64.decode(encodedStr);
String dir = (await getApplicationDocumentsDirectory()).path;
File file = File("$dir/" + DateTime.now().millisecondsSinceEpoch.toString() + "." + ext);
await file.writeAsBytes(bytes);
// print(file.path);
return file.path;
}
}

@ -14,21 +14,35 @@ import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_mod
import 'package:mohem_flutter_app/models/worklist_response_model.dart';
import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart';
import '../../../models/worklist/hr/eit_otification_body_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';
class InfoFragment extends StatelessWidget {
WorkListResponseModel? workListData;
List<POHeader> poHeaderList;
List<GetAbsenceCollectionNotificationBodyList>? getAbsenceCollectionNotifications;
List<GetStampMsNotificationBodyList>? getStampMsNotifications;
List<GetStampNsNotificationBodyList>? getStampNsNotifications;
List<ItemCreationHeader> itemCreationHeader;
List<GetEitCollectionNotificationBodyList>? getEitCollectionNotificationBodyList;
List<GetPhonesNotificationBodyList>? getPhonesNotificationBodyList;
List<GetBasicDetNtfBodyList>? getBasicDetNtfBodyList;
List<GetAbsenceCollectionNotificationBodyList>? getAbsenceCollectionNotificationBodyList;
GetContactNotificationBodyList? getContactNotificationBodyList;
InfoFragment(
{this.workListData,
InfoFragment({
this.workListData,
this.poHeaderList = const <POHeader>[],
this.itemCreationHeader = const <ItemCreationHeader>[],
this.getAbsenceCollectionNotifications,
this.getStampMsNotifications,
this.getStampNsNotifications});
this.getStampNsNotifications,
this.getEitCollectionNotificationBodyList,
this.getPhonesNotificationBodyList,
this.getBasicDetNtfBodyList,
this.getAbsenceCollectionNotificationBodyList,
this.getContactNotificationBodyList,
});
@override
Widget build(BuildContext context) {
@ -47,11 +61,15 @@ class InfoFragment extends StatelessWidget {
ItemDetailView(LocaleKeys.subject.tr(), workListData!.sUBJECT ?? ""),
],
).objectContainerView(),
if ((getAbsenceCollectionNotifications?.length ?? 0) > 0) getAbsenceCollectionNotificationsListView(getAbsenceCollectionNotifications ?? []).objectContainerView(title: "Absence Notifications"),
if (getStampMsNotifications?.isNotEmpty ?? false) getStampMsNotificationsListView(getStampMsNotifications ?? []).objectContainerView(title: "Stamp Notifications"),
if (getStampNsNotifications?.isNotEmpty ?? false) getStampNsNotificationsListView(getStampNsNotifications ?? []).objectContainerView(title: "Stamp Notifications"),
if (poHeaderList.isNotEmpty) getPoNotificationsListView(),
if (itemCreationHeader.isNotEmpty) getItemCreationHeaderView()
if (itemCreationHeader.isNotEmpty) getItemCreationHeaderView(),
if (getEitCollectionNotificationBodyList?.isNotEmpty ?? false) getEitNotificationsListView(getEitCollectionNotificationBodyList ?? []),
if (getPhonesNotificationBodyList?.isNotEmpty ?? false) getPhonesNotificationBodyListWidget(getPhonesNotificationBodyList ?? []).objectContainerView(title: "Mobile Numbers"),
if (getBasicDetNtfBodyList?.isNotEmpty ?? false) getBasicDetNtfBodyListWidget(getBasicDetNtfBodyList ?? []).objectContainerView(title: "Basic Information"),
if (getAbsenceCollectionNotificationBodyList?.isNotEmpty ?? false) getAbsenceCollectionNotificationBodyListWidget(getAbsenceCollectionNotificationBodyList ?? []),
if (getContactNotificationBodyList != null) getContactNotificationBodyListWidget(getContactNotificationBodyList ?? GetContactNotificationBodyList()).objectContainerView(),
];
return Container(
width: double.infinity,
@ -102,15 +120,15 @@ class InfoFragment extends StatelessWidget {
itemCount: poHeaderList.length);
}
Widget getAbsenceCollectionNotificationsListView(List<GetAbsenceCollectionNotificationBodyList> list) {
List<CollectionNotification> dataList = list.isEmpty ? [] : (list.first.collectionNotification ?? []);
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ItemDetailView(dataList[index].sEGMENTPROMPT!, dataList[index].sEGMENTVALUEDSP!),
separatorBuilder: (cxt, index) => 4.height,
itemCount: dataList.length);
}
// Widget getAbsenceCollectionNotificationsListView(List<GetAbsenceCollectionNotificationBodyList> list) {
// List<CollectionNotificationAbsence> dataList = list.isEmpty ? [] : (list.first.collectionNotification ?? []);
// return ListView.separated(
// shrinkWrap: true,
// physics: const NeverScrollableScrollPhysics(),
// itemBuilder: (cxt, index) => ItemDetailView(dataList[index].sEGMENTPROMPT!, dataList[index].sEGMENTVALUEDSP!),
// separatorBuilder: (cxt, index) => 4.height,
// itemCount: dataList.length);
// }
Widget getStampMsNotificationsListView(List<GetStampMsNotificationBodyList> list) {
return ListView.separated(
@ -169,7 +187,7 @@ class InfoFragment extends StatelessWidget {
ItemDetailView(LocaleKeys.approvedDate.tr(), itemCreationHeader[index].aPPROVEDDATE?.toString() ?? ""),
ItemDetailView(LocaleKeys.itemType.tr(), itemCreationHeader[index].iTEMTYPE?.toString() ?? ""),
ItemDetailView(LocaleKeys.relatedTo.tr(), itemCreationHeader[index].rELATEDTO?.toString() ?? ""),
ItemDetailView(LocaleKeys.requestDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(itemCreationHeader[index].rEQUESTDATE.toString()), false) ?? ""),
ItemDetailView(LocaleKeys.requestDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(itemCreationHeader[index].rEQUESTDATE.toString()), false)),
ItemDetailView(LocaleKeys.analyzedDate.tr(), itemCreationHeader[index].aNALYZEDDATE?.toString() ?? ""),
ItemDetailView(LocaleKeys.urgent.tr(), itemCreationHeader[index].uRGENTFLAGDISP?.toString() ?? ""),
],
@ -177,4 +195,70 @@ class InfoFragment extends StatelessWidget {
separatorBuilder: (cxt, index) => 18.height,
itemCount: itemCreationHeader.length);
}
//HR multiple type requests
Widget getEitNotificationsListView(List<GetEitCollectionNotificationBodyList> list) {
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) {
List<CollectionNotificationEit> dataList = list.isEmpty ? [] : (list[index].collectionNotification ?? []);
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => dataList[index].displayFlag == "Y" ? ItemDetailView(dataList[index].segmentPrompt!, dataList[index].segmentValueDsp!) : Container(),
separatorBuilder: (cxt, index) => dataList[index].displayFlag == "Y" ? 4.height : 0.height,
itemCount: dataList.length)
.objectContainerView();
},
separatorBuilder: (cxt, index) => 12.height,
itemCount: list.length,
);
}
Widget getPhonesNotificationBodyListWidget(List<GetPhonesNotificationBodyList> list) {
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ItemDetailView(LocaleKeys.subject.tr(), list[index].proposedPhoneNumber ?? ""),
separatorBuilder: (cxt, index) => 4.height,
itemCount: list.length);
}
Widget getBasicDetNtfBodyListWidget(List<GetBasicDetNtfBodyList> list) {
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ItemDetailView(list[index].segmentPrompt!, list[index].segmentValueDsp!),
separatorBuilder: (cxt, index) => 4.height,
itemCount: list.length);
}
Widget getAbsenceCollectionNotificationBodyListWidget(List<GetAbsenceCollectionNotificationBodyList> list) {
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) {
List<CollectionNotificationAbsence> dataList = list.isEmpty ? [] : (list[index].collectionNotification ?? []);
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => dataList[index].dISPLAYFLAG == "Y" ? ItemDetailView(dataList[index].sEGMENTPROMPT!, dataList[index].sEGMENTVALUEDSP!) : Container(),
separatorBuilder: (cxt, index) => dataList[index].dISPLAYFLAG == "Y" ? 4.height : 0.height,
itemCount: dataList.length)
.objectContainerView();
},
separatorBuilder: (cxt, index) => 12.height,
itemCount: list.length,
);
}
Widget getContactNotificationBodyListWidget(GetContactNotificationBodyList data) {
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ItemDetailView(data.contactNotificationBody![index].segmentPrompt!, data.contactNotificationBody![index].segmentValueDsp!),
separatorBuilder: (cxt, index) => 4.height,
itemCount: data.contactNotificationBody!.length);
}
}

@ -21,7 +21,7 @@ AppBar AppBarWidget(BuildContext context, {required String title, bool showHomeB
child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
),
4.width,
title.toText24(color: MyColors.darkTextColor, isBold: true, considerHeight: false).expanded,
title.toText24(color: MyColors.darkTextColor, isBold: true).expanded,
],
),
centerTitle: false,

@ -12,21 +12,38 @@ class InputWidget extends StatelessWidget {
final bool isInputTypeNum;
final bool isObscureText;
final bool isBackgroundEnable;
final bool isEnableBorder;
final double verticalPadding;
final double horizontalPadding;
final Function(String)? onChange;
InputWidget(this.labelText, this.hintText, this.controller,
{this.isObscureText = false, this.suffixTap, this.isEnable = true, this.hasSelection = false, this.lines = 1, this.onChange, this.isInputTypeNum = false, this.isBackgroundEnable = false});
InputWidget(
this.labelText,
this.hintText,
this.controller, {
this.isObscureText = false,
this.suffixTap,
this.isEnable = true,
this.hasSelection = false,
this.isEnableBorder = true,
this.lines = 1,
this.onChange,
this.isInputTypeNum = false,
this.isBackgroundEnable = false,
this.verticalPadding = 15,
this.horizontalPadding = 16,
});
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
padding: EdgeInsets.only(left: horizontalPadding, right: horizontalPadding, bottom: verticalPadding, top: verticalPadding),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: isBackgroundEnable ? Color(0xffF7F7F7) : Colors.white,
border: Border.all(
color: Color(0xffefefef),
color: isEnableBorder ? Color(0xffefefef) : Colors.transparent,
width: 1,
),
),

@ -6,8 +6,14 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
class ShowRadio extends StatelessWidget {
String title, value, groupValue;
Color selectedColor;
ShowRadio({required this.title, required this.value, required this.groupValue});
ShowRadio({
required this.title,
required this.value,
required this.groupValue,
this.selectedColor = Colors.black,
});
@override
Widget build(BuildContext context) {
@ -27,7 +33,7 @@ class ShowRadio extends StatelessWidget {
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
color: value == groupValue ? Colors.black : Colors.transparent,
color: value == groupValue ? selectedColor : Colors.transparent,
borderRadius: BorderRadius.all(Radius.circular(100)),
),
),

@ -63,7 +63,10 @@ dependencies:
geolocator: any
# flutter_compass: ^0.6.1
google_maps_flutter_web: ^0.3.2
month_year_picker: ^0.2.0+1
month_picker_dialog: ^0.4.0
open_file: ^3.2.1
wifi_iot: ^0.3.16
dev_dependencies:
flutter_test:

Loading…
Cancel
Save