Merge branch 'master' into development_aamir

# Conflicts:
#	lib/ui/landing/dashboard_screen.dart
faiz_marathon_signalR_critical
Aamir Muhammad 3 years ago
commit 57ebe40b5d

@ -1,7 +1,7 @@
{
"mohemm": "Mohemm",
"english": "English",
"arabic": "Arabic",
"arabic": "عربي",
"login": "تسجيل الدخول",
"pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول",
"username": "اسم المستخدم",
@ -279,7 +279,7 @@
"enterNewInfo": " أدخل معلومات جديدة بسبب تغيير حقيقي في التفاصيل الحالية (على سبيل المثال بسبب تغيير في الحالة الاجتماعية",
"endDate": "تاريخ الانتهاء",
"removeThisMember": "هل انت متأكد تريد ازالة هذا العضو؟",
"updateThisMember ": "هل انت متأكد تريد تحديث بيانات هذا العضو؟",
"wantUpdateThisMember ": "هل انت متأكد تريد تحديث بيانات هذا العضو؟",
"addNewFamilyMember": "اضافة عضو جديد",
"addRow": "اضافة صف جديد",
"pleaseSelect": "الرجاء اختيار",
@ -407,6 +407,18 @@
"rateUI": ".1 كيف تريد تقييم التطبيق",
"submitSurvey": "ارسال الاستبيان",
"typeHere": "اكتب هنا",
"info_detail": "تفاصيل المعلومات",
"amount_detail": "تفاصيل المبلغ",
"currentBalance": "الرصيد الحالي",
"currentLeaveBalance" : "رصيد الاجازات الحالي",
"calculatedDays": "الايام المحسوبه",
"totalDays": "مجموع الأيام",
"usedBalance": "المستخدم",
"infants":"رضيع",
"child":"طفل",
"adult": "بالغ",
"updateMember": "هل انت متأكد تريد تحديث بيانات هذا العضو؟",
"fieldIsEmpty": "'{data}' الحقل فارغ. الرجاء التحديد",
"profile": {
"reset_password": {
"label": "Reset Password",

@ -1,7 +1,7 @@
{
"mohemm": "Mohemm",
"english": "English",
"arabic": "Arabic",
"arabic": "عربي",
"login": "Login",
"pleaseEnterLoginDetails": "Please enter the detail below to login",
"username": "Username",
@ -276,7 +276,7 @@
"enterNewInfo": "Enter new Information because of a real change to the current details (e.g because of a change in marital status)",
"endDate": "*End Date",
"removeThisMember": "Are You Sure You Want to Remove this Member?",
"updateThisMember": "Are You Sure You Want to Update this Member?",
"wantUpdateThisMember": "Are You Sure You Want to Update this Member?",
"addNewFamilyMember": "Add New Family Member",
"addRow": "Add new row",
"pleaseSelect": "Please Select *",
@ -407,6 +407,18 @@
"rateUI": "1. How would you rate this UI?",
"submitSurvey":"Submit Survey",
"typeHere": "Type here",
"info_detail": "Info Detail",
"amount_detail": "Amount Detail",
"currentBalance": "Current Balance",
"currentLeaveBalance" : "Current Leave Balance",
"calculatedDays": "Calculated Days",
"totalDays": "Total Days",
"usedBalance": "Used",
"infants":"Infants",
"child":"Child",
"adult": "Adult",
"updateMember": "Are You Sure You Want to Update this Member?",
"fieldIsEmpty": "'{data}' Field is empty. Please select",
"profile": {
"reset_password": {
"label": "Reset Password",

@ -379,6 +379,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 99Z3UD3LJM;
ENABLE_BITCODE = NO;
@ -391,6 +393,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.cloudsolutions.mohemmtest;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
@ -510,6 +513,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 99Z3UD3LJM;
ENABLE_BITCODE = NO;
@ -522,6 +527,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.cloudsolutions.mohemmtest;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
@ -536,6 +542,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 99Z3UD3LJM;
ENABLE_BITCODE = NO;
@ -548,6 +556,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.cloudsolutions.mohemmtest;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";

@ -18,7 +18,8 @@ class APIError {
APIError(this.errorCode, this.errorMessage);
Map<String, dynamic> toJson() => {'errorCode': errorCode, 'errorMessage': errorMessage};
Map<String, dynamic> toJson() =>
{'errorCode': errorCode, 'errorMessage': errorMessage};
@override
String toString() {
@ -53,7 +54,8 @@ APIException _throwAPIException(Response response) {
return APIException(APIException.INTERNAL_SERVER_ERROR);
case 444:
var downloadUrl = response.headers["location"];
return APIException(APIException.UPGRADE_REQUIRED, arguments: downloadUrl);
return APIException(APIException.UPGRADE_REQUIRED,
arguments: downloadUrl);
default:
return APIException(APIException.OTHER);
}
@ -66,8 +68,13 @@ class ApiClient {
factory ApiClient() => _instance;
Future<U> postJsonForObject<T, U>(FactoryConstructor<U> factoryConstructor, String url, T jsonObject,
{String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0, bool isFormData = false}) async {
Future<U> postJsonForObject<T, U>(
FactoryConstructor<U> factoryConstructor, String url, T jsonObject,
{String? token,
Map<String, dynamic>? queryParameters,
Map<String, String>? headers,
int retryTimes = 0,
bool isFormData = false}) async {
var _headers = {'Accept': 'application/json'};
if (headers != null && headers.isNotEmpty) {
_headers.addAll(headers);
@ -77,7 +84,12 @@ class ApiClient {
var bodyJson = json.encode(jsonObject);
print("body:$bodyJson");
}
var response = await postJsonForResponse(url, jsonObject, token: token, queryParameters: queryParameters, headers: _headers, retryTimes: retryTimes, isFormData: isFormData);
var response = await postJsonForResponse(url, jsonObject,
token: token,
queryParameters: queryParameters,
headers: _headers,
retryTimes: retryTimes,
isFormData: isFormData);
// try {
if (!kReleaseMode) {
logger.i("res: " + response.body);
@ -90,7 +102,8 @@ class ApiClient {
return factoryConstructor(jsonData);
} else {
APIError? apiError;
apiError = APIError(jsonData['ErrorCode'], jsonData['ErrorEndUserMessage']);
apiError =
APIError(jsonData['ErrorCode'], jsonData['ErrorEndUserMessage']);
throw APIException(APIException.BAD_REQUEST, error: apiError);
}
// } catch (ex) {
@ -103,7 +116,11 @@ class ApiClient {
}
Future<Response> postJsonForResponse<T>(String url, T jsonObject,
{String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0, bool isFormData = false}) async {
{String? token,
Map<String, dynamic>? queryParameters,
Map<String, String>? headers,
int retryTimes = 0,
bool isFormData = false}) async {
String? requestBody;
late Map<String, String> stringObj;
if (jsonObject != null) {
@ -117,13 +134,22 @@ class ApiClient {
if (isFormData) {
headers = {'Content-Type': 'application/x-www-form-urlencoded'};
stringObj = ((jsonObject ?? {}) as Map<String, dynamic>).map((key, value) => MapEntry(key, value?.toString() ?? ""));
stringObj = ((jsonObject ?? {}) as Map<String, dynamic>)
.map((key, value) => MapEntry(key, value?.toString() ?? ""));
}
return await _postForResponse(url, isFormData ? stringObj : requestBody, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes);
return await _postForResponse(url, isFormData ? stringObj : requestBody,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes);
}
Future<Response> _postForResponse(String url, requestBody, {String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0}) async {
Future<Response> _postForResponse(String url, requestBody,
{String? token,
Map<String, dynamic>? queryParameters,
Map<String, String>? headers,
int retryTimes = 0}) async {
try {
var _headers = <String, String>{};
if (token != null) {
@ -138,7 +164,9 @@ class ApiClient {
var queryString = new Uri(queryParameters: queryParameters).query;
url = url + '?' + queryString;
}
var response = await _post(Uri.parse(url), body: requestBody, headers: _headers).timeout(Duration(seconds: 60));
var response =
await _post(Uri.parse(url), body: requestBody, headers: _headers)
.timeout(Duration(seconds: 120));
if (response.statusCode >= 200 && response.statusCode < 300) {
return response;
@ -149,7 +177,11 @@ class ApiClient {
if (retryTimes > 0) {
print('will retry after 3 seconds...');
await Future.delayed(Duration(seconds: 3));
return await _postForResponse(url, requestBody, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1);
return await _postForResponse(url, requestBody,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes - 1);
} else {
throw APIException(APIException.OTHER, arguments: e);
}
@ -157,7 +189,11 @@ class ApiClient {
if (retryTimes > 0) {
print('will retry after 3 seconds...');
await Future.delayed(Duration(seconds: 3));
return await _postForResponse(url, requestBody, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1);
return await _postForResponse(url, requestBody,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes - 1);
} else {
throw APIException(APIException.OTHER, arguments: e);
}
@ -167,23 +203,39 @@ class ApiClient {
if (retryTimes > 0) {
print('will retry after 3 seconds...');
await Future.delayed(Duration(seconds: 3));
return await _postForResponse(url, requestBody, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1);
return await _postForResponse(url, requestBody,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes - 1);
} else {
throw APIException(APIException.OTHER, arguments: e);
}
}
}
Future<Response> getJsonForResponse<T>(String url, {String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0}) async {
Future<Response> getJsonForResponse<T>(String url,
{String? token,
Map<String, dynamic>? queryParameters,
Map<String, String>? headers,
int retryTimes = 0}) async {
if (headers == null) {
headers = {'Content-Type': 'application/json'};
} else {
headers['Content-Type'] = 'application/json';
}
return await _getForResponse(url, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes);
return await _getForResponse(url,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes);
}
Future<Response> _getForResponse(String url, {String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0}) async {
Future<Response> _getForResponse(String url,
{String? token,
Map<String, dynamic>? queryParameters,
Map<String, String>? headers,
int retryTimes = 0}) async {
try {
var _headers = <String, String>{};
if (token != null) {
@ -198,7 +250,8 @@ class ApiClient {
var queryString = new Uri(queryParameters: queryParameters).query;
url = url + '?' + queryString;
}
var response = await _get(Uri.parse(url), headers: _headers).timeout(Duration(seconds: 60));
var response = await _get(Uri.parse(url), headers: _headers)
.timeout(Duration(seconds: 60));
if (response.statusCode >= 200 && response.statusCode < 300) {
return response;
@ -209,7 +262,11 @@ class ApiClient {
if (retryTimes > 0) {
print('will retry after 3 seconds...');
await Future.delayed(Duration(seconds: 3));
return await _getForResponse(url, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1);
return await _getForResponse(url,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes - 1);
} else {
throw APIException(APIException.OTHER, arguments: e);
}
@ -217,7 +274,11 @@ class ApiClient {
if (retryTimes > 0) {
print('will retry after 3 seconds...');
await Future.delayed(Duration(seconds: 3));
return await _getForResponse(url, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1);
return await _getForResponse(url,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes - 1);
} else {
throw APIException(APIException.OTHER, arguments: e);
}
@ -227,14 +288,19 @@ class ApiClient {
if (retryTimes > 0) {
print('will retry after 3 seconds...');
await Future.delayed(Duration(seconds: 3));
return await _getForResponse(url, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1);
return await _getForResponse(url,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes - 1);
} else {
throw APIException(APIException.OTHER, arguments: e);
}
}
}
Future<Response> _get(url, {Map<String, String>? headers}) => _withClient((client) => client.get(url, headers: headers));
Future<Response> _get(url, {Map<String, String>? headers}) =>
_withClient((client) => client.get(url, headers: headers));
bool _certificateCheck(X509Certificate cert, String host, int port) => true;
@ -248,5 +314,8 @@ class ApiClient {
}
}
Future<Response> _post(url, {Map<String, String>? headers, body, Encoding? encoding}) => _withClient((client) => client.post(url, headers: headers, body: body, encoding: encoding));
Future<Response> _post(url,
{Map<String, String>? headers, body, Encoding? encoding}) =>
_withClient((client) =>
client.post(url, headers: headers, body: body, encoding: encoding));
}

@ -3,6 +3,7 @@ import 'dart:async';
import 'package:mohem_flutter_app/api/api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/classes/date_uitl.dart';
import 'package:mohem_flutter_app/models/dashboard/get_accrual_balances_list_model.dart';
import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart';
import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart';
@ -37,6 +38,20 @@ class DashboardApiClient {
}, url, postParams);
}
Future<GenericResponseModel?> getCOCNotifications() async {
String url = "${ApiConsts.cocRest}Mohemm_ITG_ReviewerAdmin_Pending_Tasks";
Map<String, dynamic> postParams = {
"Date": DateUtil.getISODateFormat(DateTime.now()),
"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData;
}, url, postParams);
}
Future<ItgFormsModel?> getItgFormsPendingTask() async {
String url = "${ApiConsts.cocRest}ITGFormsPendingTasks";
Map<String, dynamic> postParams = {};
@ -47,7 +62,8 @@ class DashboardApiClient {
}, url, postParams);
}
Future<List<GetAccrualBalancesList>> getAccrualBalances(String effectiveDate) async {
Future<List<GetAccrualBalancesList>> getAccrualBalances(
String effectiveDate) async {
String url = "${ApiConsts.erpRest}GET_ACCRUAL_BALANCES";
Map<String, dynamic> postParams = {"P_EFFECTIVE_DATE": effectiveDate};
postParams.addAll(AppState().postParamsJson);
@ -81,7 +97,10 @@ class DashboardApiClient {
//GET_MENU_ENTRIES
Future<GenericResponseModel?> getGetMenuEntries() async {
String url = "${ApiConsts.erpRest}GET_MENU_ENTRIES";
Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"};
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E"
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
@ -90,7 +109,13 @@ class DashboardApiClient {
}
//Mark Attendance
Future<GenericResponseModel?> markAttendance({String lat = "0", String? long = "0", required int pointType, String nfcValue = "", bool isGpsRequired = false, String QRValue = ""}) async {
Future<GenericResponseModel?> markAttendance(
{String lat = "0",
String? long = "0",
required int pointType,
String nfcValue = "",
bool isGpsRequired = false,
String QRValue = ""}) async {
String url = "${ApiConsts.swpRest}AuthenticateAndSwipeUserSupportNFC";
var uuid = Uuid();
// Generate a v4 (random) id

@ -0,0 +1,74 @@
import 'dart:async';
import 'package:mohem_flutter_app/api/api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/submit_term_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/termination/get_term_cols_structure_list_model.dart';
import 'package:mohem_flutter_app/models/termination/get_term_dff_structure_list_model.dart';
import 'package:mohem_flutter_app/start_term_approval_process_list_model.dart';
class TerminationDffApiClient {
static final TerminationDffApiClient _instance = TerminationDffApiClient._internal();
TerminationDffApiClient._internal();
factory TerminationDffApiClient() => _instance;
Future<List<GetTermColsStructureList>?> getTermColsStructure() async {
String url = "${ApiConsts.erpRest}GET_TERM_COLS_STRUCTURE";
Map<String, dynamic> postParams = {};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel genericResponseModel = GenericResponseModel.fromJson(json);
return genericResponseModel.getTermColsStructureList ?? [];
}, url, postParams);
}
Future<List<GetTermDffStructureList>?> getTermDffStructure(String functionName, String? pDescFlexContextCode) async {
String url = "${ApiConsts.erpRest}GET_TERM_DFF_STRUCTURE";
Map<String, dynamic> postParams = {'P_FUNCTION_NAME': functionName, "P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel genericResponseModel = GenericResponseModel.fromJson(json);
return genericResponseModel.getTermDffStructureList ?? [];
}, url, postParams);
}
Future<SubmitTermTransactionList> submitTermTransaction(String functionName, List<Map<String, dynamic>> list) async {
String url = "${ApiConsts.erpRest}SUBMIT_TERM_TRANSACTION";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_FUNCTION_NAME": functionName,
"EITTransactionTBL": list,
};
postParams.addAll(AppState().postParamsJson);
for (var abc in list) {
print(abc);
}
return await ApiClient().postJsonForObject((json) {
GenericResponseModel genericResponseModel = GenericResponseModel.fromJson(json);
return genericResponseModel.submitTermTransactionList!;
}, url, postParams);
}
Future<StartTermApprovalProcessList> startTermApprovalProcess(String action, String comments, String itemKey, int transactionId) async {
String url = "${ApiConsts.erpRest}START_TERM_APPROVAL_PROCESS";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_ACTION_MODE": action,
"P_COMMENTS": comments,
"P_ITEM_KEY": itemKey,
"P_TRANSACTION_ID": transactionId,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel genericResponseModel = GenericResponseModel.fromJson(json);
return genericResponseModel.startTermApprovalProcessList!;
}, url, postParams);
}
}

@ -296,7 +296,39 @@ class WorkListApiClient {
"RequestType": requestType,
"TaskID": taskId,
"ItemID": itemId,
"EmployeeNumber": "15153",
"EmployeeNumber": employeeNumber,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
ItgFormsModel responseData = ItgFormsModel.fromJson(json);
return responseData.itgRequest;
}, url, postParams);
}
Future<ITGRequest?> rejectITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String comments) async {
String url = "${ApiConsts.cocRest}ITGRejectRequest";
Map<String, dynamic> postParams = {
"RequestType": requestType,
"TaskID": taskId,
"ItemID": itemId,
"EmployeeNumber": employeeNumber,
"Comments": comments,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
ItgFormsModel responseData = ItgFormsModel.fromJson(json);
return responseData.itgRequest;
}, url, postParams);
}
Future<ITGRequest?> approveITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String comments) async {
String url = "${ApiConsts.cocRest}ITGApproveRequest";
Map<String, dynamic> postParams = {
"RequestType": requestType,
"TaskID": taskId,
"ItemID": itemId,
"EmployeeNumber": employeeNumber,
"Comments": comments,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {

@ -25,7 +25,7 @@ class Utils {
static bool get isLoading => _isLoadingVisible;
static void showToast(String message, {bool longDuration = false}) {
static void showToast(String message, {bool longDuration = true}) {
Fluttertoast.showToast(
msg: message,
toastLength: longDuration ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT,

@ -58,6 +58,7 @@ import 'package:mohem_flutter_app/ui/screens/offers_and_discounts/offers_and_dis
import 'package:mohem_flutter_app/ui/screens/pending_transactions/pending_transactions.dart';
import 'package:mohem_flutter_app/ui/screens/pending_transactions/pending_transactions_details.dart';
import 'package:mohem_flutter_app/ui/screens/submenu_screen.dart';
import 'package:mohem_flutter_app/ui/termination/end_employement.dart';
import 'package:mohem_flutter_app/ui/work_list/item_history_screen.dart';
import 'package:mohem_flutter_app/ui/work_list/itg_detail_screen.dart';
import 'package:mohem_flutter_app/ui/work_list/work_list_screen.dart';
@ -153,6 +154,9 @@ class AppRoutes {
static const String performanceEvaluation = "/performanceEvaluation";
static const String endEmploymentScreen = "/endEmploymentScreen";
//My Team
static const String myTeam = "/myTeam";
static const String employeeDetails = "/employeeDetails";
@ -251,6 +255,9 @@ class AppRoutes {
monthlyPaySlip: (context) => MonthlyPaySlipScreen(),
performanceEvaluation: (context) => PerformanceAppraisal(),
endEmploymentScreen: (context) => EndEmploymentScreen(),
//My Team
myTeam: (context) => MyTeam(),
employeeDetails: (context) => EmployeeDetails(),

@ -10,4 +10,6 @@ extension IntExtensions on int {
Widget get divider => Divider(height: toDouble(), thickness: toDouble(), color: MyColors.lightGreyEFColor);
Widget get makeItSquare => SizedBox(width: toDouble(), height: toDouble());
}

@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:intl/intl.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
@ -45,6 +46,20 @@ extension EmailValidator on String {
),
);
Widget toText12Auto({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0}) => AutoSizeText(
this,
textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null,
minFontSize: 8,
style: TextStyle(
fontSize: 12,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: -0.72,
decoration: isUnderLine ? TextDecoration.underline : null,
),
);
Widget toText13({Color? color, bool isUnderLine = false}) => Text(
this,
style: TextStyle(fontSize: 13, fontWeight: FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.52, decoration: isUnderLine ? TextDecoration.underline : null),

@ -17,7 +17,7 @@ class CodegenLoader extends AssetLoader{
static const Map<String,dynamic> ar_SA = {
"mohemm": "Mohemm",
"english": "English",
"arabic": "Arabic",
"arabic": "عربي",
"login": "تسجيل الدخول",
"pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول",
"username": "اسم المستخدم",
@ -27,6 +27,7 @@ class CodegenLoader extends AssetLoader{
"lastLoginDetails": "تفاصيل تسجيل الدخول الأخير:",
"verificationType": "نوع التحقق:",
"pleaseVerify": "ارجوك تحقق",
"pleaseVerifyForBio": "الرجاء التحقق من تسجيل الدخول باستخدام أحد هذه الخيارات",
"verifyThroughFace": "تحقق من خلال الوجه",
"verifyThroughFingerprint": "تحقق من خلال بصمة الإصبع",
"verifyThroughSMS": "تحقق من خلال الرسائل القصيرة",
@ -294,7 +295,7 @@ class CodegenLoader extends AssetLoader{
"enterNewInfo": " أدخل معلومات جديدة بسبب تغيير حقيقي في التفاصيل الحالية (على سبيل المثال بسبب تغيير في الحالة الاجتماعية",
"endDate": "تاريخ الانتهاء",
"removeThisMember": "هل انت متأكد تريد ازالة هذا العضو؟",
"updateThisMember ": "هل انت متأكد تريد تحديث بيانات هذا العضو؟",
"wantUpdateThisMember ": "هل انت متأكد تريد تحديث بيانات هذا العضو؟",
"addNewFamilyMember": "اضافة عضو جديد",
"addRow": "اضافة صف جديد",
"pleaseSelect": "الرجاء اختيار",
@ -420,8 +421,18 @@ class CodegenLoader extends AssetLoader{
"addFavoriteList": "هل تريد اضافة {name} لقائمة المفضله",
"feedbackUserExperience": "هذا للحصول على تعليقات حول تجربة المستخدم",
"rateUI": ".1 كيف تريد تقييم التطبيق",
"Submit Survey": "ارسال الاستبيان",
"submitSurvey": "ارسال الاستبيان",
"typeHere": "اكتب هنا",
"currentBalance": "الرصيد الحالي",
"currentLeaveBalance": "رصيد الاجازات الحالي",
"calculatedDays": "الايام المحسوبه",
"totalDays": "مجموع الأيام",
"usedBalance": "المستخدم",
"infants": "رضيع",
"child": "طفل",
"adult": "بالغ",
"updateMember": "هل انت متأكد تريد تحديث بيانات هذا العضو؟",
"fieldIsEmpty": "'{data}' الحقل فارغ. الرجاء التحديد",
"profile": {
"reset_password": {
"label": "Reset Password",
@ -459,7 +470,7 @@ class CodegenLoader extends AssetLoader{
static const Map<String,dynamic> en_US = {
"mohemm": "Mohemm",
"english": "English",
"arabic": "Arabic",
"arabic": "عربي",
"login": "Login",
"pleaseEnterLoginDetails": "Please enter the detail below to login",
"username": "Username",
@ -469,6 +480,7 @@ static const Map<String,dynamic> en_US = {
"lastLoginDetails": "Last Login Details:",
"verificationType": "Verification Type:",
"pleaseVerify": "Please Verify",
"pleaseVerifyForBio": "Please verify login with one of the following options",
"verifyThroughFace": "Verify Through Face",
"verifyThroughFingerprint": "Verify Through Fingerprint",
"verifyThroughSMS": "Verify Through SMS",
@ -733,7 +745,7 @@ static const Map<String,dynamic> en_US = {
"enterNewInfo": "Enter new Information because of a real change to the current details (e.g because of a change in marital status)",
"endDate": "*End Date",
"removeThisMember": "Are You Sure You Want to Remove this Member?",
"updateThisMember": "Are You Sure You Want to Update this Member?",
"wantUpdateThisMember": "Are You Sure You Want to Update this Member?",
"addNewFamilyMember": "Add New Family Member",
"addRow": "Add new row",
"pleaseSelect": "Please Select *",
@ -862,8 +874,18 @@ static const Map<String,dynamic> en_US = {
"addFavoriteList": "Do you want to add {name} in your favorite list",
"feedbackUserExperience": "This is to get the feedback about the user experience",
"rateUI": "1. How would you rate this UI?",
"Submit Survey": "Submit Survey",
"submitSurvey": "Submit Survey",
"typeHere": "Type here",
"currentBalance": "Current Balance",
"currentLeaveBalance": "Current Leave Balance",
"calculatedDays": "Calculated Days",
"totalDays": "Total Days",
"usedBalance": "Used",
"infants": "Infants",
"child": "Child",
"adult": "Adult",
"updateMember": "Are You Sure You Want to Update this Member?",
"fieldIsEmpty": "'{data}' Field is empty. Please select",
"profile": {
"reset_password": {
"label": "Reset Password",

@ -280,7 +280,7 @@ abstract class LocaleKeys {
static const enterNewInfo = 'enterNewInfo';
static const endDate = 'endDate';
static const removeThisMember = 'removeThisMember';
static const updateThisMember = 'updateThisMember ';
static const wantUpdateThisMember = 'wantUpdateThisMember ';
static const addNewFamilyMember = 'addNewFamilyMember';
static const addRow = 'addRow';
static const pleaseSelect = 'pleaseSelect';
@ -408,6 +408,18 @@ abstract class LocaleKeys {
static const rateUI = 'rateUI';
static const submitSurvey = 'submitSurvey';
static const typeHere = 'typeHere';
static const info_detail = 'info_detail';
static const amount_detail = 'amount_detail';
static const currentBalance = 'currentBalance';
static const currentLeaveBalance = 'currentLeaveBalance';
static const calculatedDays = 'calculatedDays';
static const totalDays = 'totalDays';
static const usedBalance = 'usedBalance';
static const infants = 'infants';
static const child = 'child';
static const adult = 'adult';
static const updateMember = 'updateMember';
static const fieldIsEmpty = 'fieldIsEmpty';
static const profile_reset_password_label = 'profile.reset_password.label';
static const profile_reset_password_username = 'profile.reset_password.username';
static const profile_reset_password_password = 'profile.reset_password.password';

@ -0,0 +1,44 @@
class MohemmITGPendingTaskResponseItem {
int? escalation;
int? exceedTAT;
int? extendTATRequest;
int? open;
int? pendningWithReviewer;
int? waitingForAcceptance;
int? waitingToClose;
int? withInTAT;
MohemmITGPendingTaskResponseItem(
{this.escalation,
this.exceedTAT,
this.extendTATRequest,
this.open,
this.pendningWithReviewer,
this.waitingForAcceptance,
this.waitingToClose,
this.withInTAT});
MohemmITGPendingTaskResponseItem.fromJson(Map<String, dynamic> json) {
escalation = json['escalation'];
exceedTAT = json['exceedTAT'];
extendTATRequest = json['extendTATRequest'];
open = json['open'];
pendningWithReviewer = json['pendningWithReviewer'];
waitingForAcceptance = json['waitingForAcceptance'];
waitingToClose = json['waitingToClose'];
withInTAT = json['withInTAT'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = new Map<String, dynamic>();
data['escalation'] = this.escalation;
data['exceedTAT'] = this.exceedTAT;
data['extendTATRequest'] = this.extendTATRequest;
data['open'] = this.open;
data['pendningWithReviewer'] = this.pendningWithReviewer;
data['waitingForAcceptance'] = this.waitingForAcceptance;
data['waitingToClose'] = this.waitingToClose;
data['withInTAT'] = this.withInTAT;
return data;
}
}

@ -7,6 +7,7 @@ import 'package:mohem_flutter_app/models/dashboard/get_open_missing_swipes_list_
import 'package:mohem_flutter_app/models/dashboard/get_open_notifications_list.dart';
import 'package:mohem_flutter_app/models/dashboard/list_menu.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/models/dashboard/mohemm_itg_pending_task_responseitem.dart';
import 'package:mohem_flutter_app/models/get_absence_collection_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_action_history_list_model.dart';
import 'package:mohem_flutter_app/models/get_approves_list_model.dart';
@ -82,7 +83,10 @@ import 'package:mohem_flutter_app/models/profile/submit_contact_transaction_list
import 'package:mohem_flutter_app/models/start_eit_approval_process_model.dart';
import 'package:mohem_flutter_app/models/start_phone_approval_process_model.dart';
import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/submit_term_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/subordinates_on_leaves_model.dart';
import 'package:mohem_flutter_app/models/termination/get_term_cols_structure_list_model.dart';
import 'package:mohem_flutter_app/models/termination/get_term_dff_structure_list_model.dart';
import 'package:mohem_flutter_app/models/update_item_type_success_list.dart';
import 'package:mohem_flutter_app/models/update_user_item_type_list.dart';
import 'package:mohem_flutter_app/models/vacation_rule/create_vacation_rule_list_model.dart';
@ -100,6 +104,7 @@ import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_bo
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 'package:mohem_flutter_app/start_term_approval_process_list_model.dart';
class GenericResponseModel {
String? date;
@ -235,8 +240,8 @@ class GenericResponseModel {
List<GetSubordinatesLeavesTotalVacationsList>? getSubordinatesLeavesTotalVacationsList;
List<GetSummaryOfPaymentList>? getSummaryOfPaymentList;
List<String>? getSwipesList;
List<String>? getTermColsStructureList;
List<String>? getTermDffStructureList;
List<GetTermColsStructureList>? getTermColsStructureList;
List<GetTermDffStructureList>? getTermDffStructureList;
List<String>? getTermNotificationBodyList;
List<GetTimeCardSummaryList>? getTimeCardSummaryList;
List<GetTicketsByEmployeeList>? getTicketsByEmployeeList;
@ -247,6 +252,7 @@ class GenericResponseModel {
List<GetMowadhafhiProjects>? getMowadhafhiProjects;
List<GetProjectDepartments>? getProjectDepartments;
List<GetDepartmentSections>? getDepartmentSections;
MohemmITGPendingTaskResponseItem? mohemmITGPendingTaskResponseItem;
List<GetPendingTransactionsFunctions>? getPendingTransactionsFunctions;
List<GetPendingTransactionsDetails>? getPendingTransactionsDetails;
List<GetUserItemTypesList>? getUserItemTypesList;
@ -331,7 +337,7 @@ class GenericResponseModel {
String? startHrApprovalProcessList;
StartPhoneApprovalProcess? startPhonesApprovalProcessList;
String? startSitApprovalProcess;
String? startTermApprovalProcessList;
StartTermApprovalProcessList? startTermApprovalProcessList;
SubmitAddressTransaction? submitAddressTransactionList;
SubmitBasicDetailsTransactionList? submitBasicDetTransactionList;
String? submitCEITransactionList;
@ -341,7 +347,7 @@ class GenericResponseModel {
String? submitHrTransactionList;
Map<String, dynamic>? submitPhonesTransactionList;
String? submitSITTransactionList;
String? submitTermTransactionList;
SubmitTermTransactionList? submitTermTransactionList;
List<SubordinatesLeavesList>? subordinatesOnLeavesList;
SumbitAbsenceTransactionList? sumbitAbsenceTransactionList;
String? tokenID;
@ -800,6 +806,29 @@ class GenericResponseModel {
getContactDffStructureList = json['GetContactDffStructureList'];
getContactNotificationBodyList = json["GetContactNotificationBodyList"] == null ? null : GetContactNotificationBodyList.fromJson(json["GetContactNotificationBodyList"]);
if (json['GetContactColsStructureList'] != null) {
getContactColsStructureList = [];
json['GetContactColsStructureList'].forEach((v) {
getContactColsStructureList!.add(GetContactColsStructureList.fromJson(v));
});
}
if (json['GetContactDetailsList'] != null) {
getContactDetailsList = [];
json['GetContactDetailsList'].forEach((v) {
getContactDetailsList!.add(GetContactDetailsList.fromJson(v));
});
}
if (json['GetContactDffStructureList'] != null) {
getContactDffStructureList = [];
json['GetContactDffStructureList'].forEach((v) {
getContactDffStructureList!.add(GetContactDffStructureList.fromJson(v));
});
}
// getContactDetailsList = json['GetContactDetailsList'];
// getContactDffStructureList = json['GetContactDffStructureList'];
getContactNotificationBodyList = json["GetContactNotificationBodyList"] == null ? null : GetContactNotificationBodyList.fromJson(json["GetContactNotificationBodyList"]);
if (json['GetCountriesList'] != null) {
getCountriesList = <GetCountriesListModel>[];
json['GetCountriesList'].forEach((v) {
@ -1011,8 +1040,20 @@ class GenericResponseModel {
});
}
getSwipesList = json['GetSwipesList'];
getTermColsStructureList = json['GetTermColsStructureList'];
getTermDffStructureList = json['GetTermDffStructureList'];
if (json['GetTermColsStructureList'] != null) {
getTermColsStructureList = <GetTermColsStructureList>[];
json['GetTermColsStructureList'].forEach((v) {
getTermColsStructureList!.add(GetTermColsStructureList.fromJson(v));
});
}
if (json['GetTermDffStructureList'] != null) {
getTermDffStructureList = <GetTermDffStructureList>[];
json['GetTermDffStructureList'].forEach((v) {
getTermDffStructureList!.add(new GetTermDffStructureList.fromJson(v));
});
}
getTermNotificationBodyList = json['GetTermNotificationBodyList'];
if (json['GetTimeCardSummaryList'] != null) {
@ -1070,7 +1111,9 @@ class GenericResponseModel {
getDepartmentSections!.add(GetDepartmentSections.fromJson(v));
});
}
if (json['Mohemm_ITG_Pending_Task_ResponseItem'] != null) {
mohemmITGPendingTaskResponseItem = MohemmITGPendingTaskResponseItem.fromJson(json['Mohemm_ITG_Pending_Task_ResponseItem']);
}
if (json['Mohemm_ITG_SectionTopicsList'] != null) {
getSectionTopics = <GetSectionTopics>[];
json['Mohemm_ITG_SectionTopicsList'].forEach((v) {
@ -1267,7 +1310,8 @@ class GenericResponseModel {
startPhonesApprovalProcessList = json['StartPhonesApprovalProcessList'] != null ? StartPhoneApprovalProcess.fromJson(json['startPhonesApprovalProcessList']) : null;
startSitApprovalProcess = json['StartSitApprovalProcess'];
startTermApprovalProcessList = json['StartTermApprovalProcessList'];
startTermApprovalProcessList = json['StartTermApprovalProcessList'] != null ? StartTermApprovalProcessList.fromJson(json['StartTermApprovalProcessList']) : null;
submitAddressTransactionList = json['SubmitAddressTransactionList'] != null ? SubmitAddressTransaction.fromJson(json['SubmitAddressTransactionList']) : null;
submitBasicDetTransactionList = json['SubmitBasicDetTransactionList'] != null ? SubmitBasicDetailsTransactionList.fromJson(json['SubmitBasicDetTransactionList']) : null;
@ -1280,7 +1324,7 @@ class GenericResponseModel {
submitPhonesTransactionList = json['SubmitPhonesTransactionList'];
submitSITTransactionList = json['SubmitSITTransactionList'];
submitTermTransactionList = json['SubmitTermTransactionList'];
submitTermTransactionList = json['SubmitTermTransactionList'] != null ? SubmitTermTransactionList.fromJson(json['SubmitTermTransactionList']) : null;
if (json['SubordinatesOnLeavesList'] != null) {
subordinatesOnLeavesList = <SubordinatesLeavesList>[];
@ -1587,8 +1631,15 @@ class GenericResponseModel {
data['GetSummaryOfPaymentList'] = this.getSummaryOfPaymentList!.map((v) => v.toJson()).toList();
}
data['GetSwipesList'] = this.getSwipesList;
data['GetTermColsStructureList'] = this.getTermColsStructureList;
data['GetTermDffStructureList'] = this.getTermDffStructureList;
if (this.getTermColsStructureList != null) {
data['GetTermColsStructureList'] = this.getTermColsStructureList!.map((v) => v.toJson()).toList();
}
if (this.getTermDffStructureList != null) {
data['GetTermDffStructureList'] = this.getTermDffStructureList!.map((v) => v.toJson()).toList();
}
data['GetTermNotificationBodyList'] = this.getTermNotificationBodyList;
if (this.getTimeCardSummaryList != null) {
data['GetTimeCardSummaryList'] = this.getTimeCardSummaryList!.map((v) => v.toJson()).toList();
@ -1705,8 +1756,10 @@ class GenericResponseModel {
data['StartHrApprovalProcessList'] = this.startHrApprovalProcessList;
data['StartPhonesApprovalProcessList'] = this.startPhonesApprovalProcessList;
data['StartSitApprovalProcess'] = this.startSitApprovalProcess;
data['StartTermApprovalProcessList'] = this.startTermApprovalProcessList;
if (this.startTermApprovalProcessList != null) {
data['StartTermApprovalProcessList'] = this.startTermApprovalProcessList!.toJson();
}
if (this.submitAddressTransactionList != null) {
data['SubmitAddressTransactionList'] = this.submitAddressTransactionList!.toJson();
}
@ -1726,6 +1779,11 @@ class GenericResponseModel {
data['SubmitPhonesTransactionList'] = this.submitPhonesTransactionList;
data['SubmitSITTransactionList'] = this.submitSITTransactionList;
data['SubmitTermTransactionList'] = this.submitTermTransactionList;
if (this.submitTermTransactionList != null) {
data['SubmitTermTransactionList'] = this.submitTermTransactionList!.toJson();
}
data['SubordinatesOnLeavesList'] = this.subordinatesOnLeavesList;
if (this.subordinatesOnLeavesList != null) {

@ -0,0 +1,157 @@
// To parse this JSON data, do
//
// final getPageNotification = getPageNotificationFromJson(jsonString);
import 'dart:convert';
GetPageNotification getPageNotificationFromJson(String str) => GetPageNotification.fromJson(json.decode(str));
String getPageNotificationToJson(GetPageNotification data) => json.encode(data.toJson());
class GetPageNotification {
GetPageNotification({
this.statusCode,
this.message,
this.originalErrMsg,
this.result,
});
final int? statusCode;
final dynamic message;
final dynamic originalErrMsg;
final GetPageNotificationResult? result;
factory GetPageNotification.fromJson(Map<String, dynamic> json) => GetPageNotification(
statusCode: json["statusCode"] == null ? null : json["statusCode"],
message: json["message"],
originalErrMsg: json["originalErrMsg"],
result: json["result"] == null ? null : GetPageNotificationResult.fromJson(json["result"]),
);
Map<String, dynamic> toJson() => {
"statusCode": statusCode == null ? null : statusCode,
"message": message,
"originalErrMsg": originalErrMsg,
"result": result == null ? null : result!.toJson(),
};
}
class GetPageNotificationResult {
GetPageNotificationResult({
this.totalItemsCount,
this.data,
this.errormsg,
});
final dynamic totalItemsCount;
final GetPageNotificationData? data;
final dynamic errormsg;
factory GetPageNotificationResult.fromJson(Map<String, dynamic> json) => GetPageNotificationResult(
totalItemsCount: json["totalItemsCount"],
data: json["data"] == null ? null : GetPageNotificationData.fromJson(json["data"]),
errormsg: json["errormsg"],
);
Map<String, dynamic> toJson() => {
"totalItemsCount": totalItemsCount,
"data": data == null ? null : data!.toJson(),
"errormsg": errormsg,
};
}
class GetPageNotificationData {
GetPageNotificationData({
this.notificationMasterId,
this.notificationType,
this.referenceItemId,
this.notificationTitle,
this.enableAt,
this.applicationItemId,
this.startDate,
this.endDate,
this.isRepeat,
this.channelId,
this.serviceId,
this.channelName,
this.serviceName,
this.isDeleted,
this.showDelete,
this.advertisement,
this.survey,
this.isActive,
this.pageSize,
this.pageNo,
this.languageId,
});
final String? notificationMasterId;
final String? notificationType;
final int? referenceItemId;
final String? notificationTitle;
final String? enableAt;
final dynamic applicationItemId;
final dynamic startDate;
final dynamic endDate;
final bool? isRepeat;
final int? channelId;
final int? serviceId;
final String? channelName;
final String? serviceName;
final bool? isDeleted;
final bool? showDelete;
final dynamic advertisement;
final dynamic survey;
final dynamic isActive;
final dynamic pageSize;
final dynamic pageNo;
final dynamic languageId;
factory GetPageNotificationData.fromJson(Map<String, dynamic> json) => GetPageNotificationData(
notificationMasterId: json["notificationMasterId"] == null ? null : json["notificationMasterId"],
notificationType: json["notificationType"] == null ? null : json["notificationType"],
referenceItemId: json["referenceItemId"] == null ? null : json["referenceItemId"],
notificationTitle: json["notificationTitle"] == null ? null : json["notificationTitle"],
enableAt: json["enableAt"] == null ? null : json["enableAt"],
applicationItemId: json["applicationItemId"],
startDate: json["startDate"],
endDate: json["endDate"],
isRepeat: json["isRepeat"] == null ? null : json["isRepeat"],
channelId: json["channelId"] == null ? null : json["channelId"],
serviceId: json["serviceId"] == null ? null : json["serviceId"],
channelName: json["channelName"] == null ? null : json["channelName"],
serviceName: json["serviceName"] == null ? null : json["serviceName"],
isDeleted: json["isDeleted"] == null ? null : json["isDeleted"],
showDelete: json["showDelete"] == null ? null : json["showDelete"],
advertisement: json["advertisement"],
survey: json["survey"],
isActive: json["isActive"],
pageSize: json["pageSize"],
pageNo: json["pageNo"],
languageId: json["languageId"],
);
Map<String, dynamic> toJson() => {
"notificationMasterId": notificationMasterId == null ? null : notificationMasterId,
"notificationType": notificationType == null ? null : notificationType,
"referenceItemId": referenceItemId == null ? null : referenceItemId,
"notificationTitle": notificationTitle == null ? null : notificationTitle,
"enableAt": enableAt == null ? null : enableAt,
"applicationItemId": applicationItemId,
"startDate": startDate,
"endDate": endDate,
"isRepeat": isRepeat == null ? null : isRepeat,
"channelId": channelId == null ? null : channelId,
"serviceId": serviceId == null ? null : serviceId,
"channelName": channelName == null ? null : channelName,
"serviceName": serviceName == null ? null : serviceName,
"isDeleted": isDeleted == null ? null : isDeleted,
"showDelete": showDelete == null ? null : showDelete,
"advertisement": advertisement,
"survey": survey,
"isActive": isActive,
"pageSize": pageSize,
"pageNo": pageNo,
"languageId": languageId,
};
}

@ -44,22 +44,22 @@ class POHeader {
String? cOMMENTS;
String? cREATIONDATE;
String? cURRENCYNAME;
int? cUSTOMDUTY;
int? dISCOUNTAMOUNT;
int? gROSSAMOUNT;
num? cUSTOMDUTY;
num? dISCOUNTAMOUNT;
num? gROSSAMOUNT;
String? lOCCUR;
int? lOCCURTOTPOAMT;
int? oTHERCHARGES;
num? lOCCURTOTPOAMT;
num? oTHERCHARGES;
String? pAYMENTTERMS;
String? pONUMBER;
String? pREPARER;
String? qUOTATIONDATE;
String? qUOTATIONNUMBER;
int? sALESTAX;
int? sHIPHANDLE;
num? sALESTAX;
num? sHIPHANDLE;
String? sHIPTOLOCATIONNAME;
int? tOTALPODISCOUNT;
int? tOTPOAMT;
num? tOTALPODISCOUNT;
num? tOTPOAMT;
String? tOTPOAMTWORD;
String? vENDORNAME;
String? vENDORSITECODE;

@ -4,7 +4,7 @@ import 'package:mohem_flutter_app/models/itg_forms_models/wf_history_model.dart'
class ITGRequest {
List<AllowedActions>? allowedActions;
Null? attachments;
List<dynamic>? attachments;
List<FieldGoups>? fieldGoups;
Null? grantFields;
List<WFHistory>? wFHistory;

@ -1,6 +1,6 @@
class CalculateAbsenceDuration {
int? pABSENCEDAYS;
int? pABSENCEHOURS;
num? pABSENCEDAYS;
num? pABSENCEHOURS;
String? pRETURNMSG;
String? pRETURNSTATUS;

@ -1,10 +1,10 @@
class GetDeductionsList {
int? aMOUNT;
num? aMOUNT;
String? eLEMENTNAME;
int? fROMROWNUM;
int? nOOFROWS;
int? rOWNUM;
int? tOROWNUM;
num? fROMROWNUM;
num? nOOFROWS;
num? rOWNUM;
num? tOROWNUM;
GetDeductionsList(
{this.aMOUNT,

@ -1,10 +1,10 @@
class GetEarningsList {
int? aMOUNT;
num? aMOUNT;
String? eLEMENTNAME;
int? fROMROWNUM;
int? nOOFROWS;
int? rOWNUM;
int? tOROWNUM;
num? fROMROWNUM;
num? nOOFROWS;
num? rOWNUM;
num? tOROWNUM;
GetEarningsList(
{this.aMOUNT,

@ -1,10 +1,10 @@
class GetSummaryOfPaymentList {
int? tOTALDEDUCTIONSAMOUNT;
int? tOTALDEDUCTIONSPERCENTAGE;
int? tOTALEARNINGSAMOUNT;
int? tOTALEARNINGSPERCENTAGE;
int? tOTALPAYAMOUNT;
int? tOTALPAYPERCENTAGE;
num? tOTALDEDUCTIONSAMOUNT;
num? tOTALDEDUCTIONSPERCENTAGE;
num? tOTALEARNINGSAMOUNT;
num? tOTALEARNINGSPERCENTAGE;
num? tOTALPAYAMOUNT;
num? tOTALPAYPERCENTAGE;
GetSummaryOfPaymentList(
{this.tOTALDEDUCTIONSAMOUNT,

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

@ -0,0 +1,85 @@
class GetTermColsStructureList {
String? aPPLICATIONCOLUMNNAME;
String? dATATYPE;
String? dISPLAYFLAG;
int? mAXIMUMSIZE;
String? oBJECTNAME;
String? oBJECTTYPE;
List<ObjectValuesList>? objectValuesList;
String? rEQUIREDFLAG;
String? sEGMENTPROMPT;
int? sEGMENTSEQNUM;
String? selectedValue;
ObjectValuesList? selectedObjectValue;
GetTermColsStructureList(
{this.aPPLICATIONCOLUMNNAME,
this.dATATYPE,
this.dISPLAYFLAG,
this.mAXIMUMSIZE,
this.oBJECTNAME,
this.oBJECTTYPE,
this.objectValuesList,
this.rEQUIREDFLAG,
this.sEGMENTPROMPT,
this.selectedValue,
this.selectedObjectValue,
this.sEGMENTSEQNUM});
GetTermColsStructureList.fromJson(Map<String, dynamic> json) {
aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME'];
dATATYPE = json['DATATYPE'];
dISPLAYFLAG = json['DISPLAY_FLAG'];
mAXIMUMSIZE = json['MAXIMUM_SIZE'];
oBJECTNAME = json['OBJECT_NAME'];
oBJECTTYPE = json['OBJECT_TYPE'];
objectValuesList = <ObjectValuesList>[];
if (json['ObjectValuesList'] != null) {
json['ObjectValuesList'].forEach((v) {
objectValuesList!.add(new ObjectValuesList.fromJson(v));
});
}
rEQUIREDFLAG = json['REQUIRED_FLAG'];
sEGMENTPROMPT = json['SEGMENT_PROMPT'];
sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = new Map<String, dynamic>();
data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME;
data['DATATYPE'] = this.dATATYPE;
data['DISPLAY_FLAG'] = this.dISPLAYFLAG;
data['MAXIMUM_SIZE'] = this.mAXIMUMSIZE;
data['OBJECT_NAME'] = this.oBJECTNAME;
data['OBJECT_TYPE'] = this.oBJECTTYPE;
if (this.objectValuesList != null) {
data['ObjectValuesList'] = this.objectValuesList!.map((v) => v.toJson()).toList();
}
data['REQUIRED_FLAG'] = this.rEQUIREDFLAG;
data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT;
data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM;
return data;
}
}
class ObjectValuesList {
String? cODE;
String? dESCRIPTION;
String? mEANING;
ObjectValuesList({this.cODE, this.dESCRIPTION, this.mEANING});
ObjectValuesList.fromJson(Map<String, dynamic> json) {
cODE = json['CODE'];
dESCRIPTION = json['DESCRIPTION'];
mEANING = json['MEANING'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = new Map<String, dynamic>();
data['CODE'] = this.cODE;
data['DESCRIPTION'] = this.dESCRIPTION;
data['MEANING'] = this.mEANING;
return data;
}
}

@ -0,0 +1,280 @@
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
class GetTermDffStructureList {
String? aLPHANUMERICALLOWEDFLAG;
String? aPPLICATIONCOLUMNNAME;
String? cHILDSEGMENTSVS;
List<String>? cHILDSEGMENTSVSSplited;
String? dEFAULTTYPE;
String? dEFAULTVALUE;
String? dESCFLEXCONTEXTCODE;
String? dESCFLEXCONTEXTNAME;
String? dESCFLEXNAME;
String? dISPLAYFLAG;
String? eNABLEDFLAG;
ESERVICESDV? eSERVICESDV;
List<ESERVICESVS>? eSERVICESVS;
String? fLEXVALUESETNAME;
String? fORMATTYPE;
String? fORMATTYPEDSP;
String? lONGLISTFLAG;
int? mAXIMUMSIZE;
String? mAXIMUMVALUE;
String? mINIMUMVALUE;
String? mOBILEENABLED;
String? nUMBERPRECISION;
String? nUMERICMODEENABLEDFLAG;
String? pARENTSEGMENTSDV;
List<PARENTSEGMENTSDVSplited>? pARENTSEGMENTSDVSplited;
String? pARENTSEGMENTSVS;
List<PARENTSEGMENTSVSSplitedVS>? pARENTSEGMENTSVSSplitedVS;
String? rEADONLY;
String? rEQUIREDFLAG;
String? sEGMENTNAME;
String? sEGMENTPROMPT;
int? sEGMENTSEQNUM;
String? uPPERCASEONLYFLAG;
String? uSEDFLAG;
String? vALIDATIONTYPE;
String? vALIDATIONTYPEDSP;
GetTermDffStructureList(
{this.aLPHANUMERICALLOWEDFLAG,
this.aPPLICATIONCOLUMNNAME,
this.cHILDSEGMENTSVS,
this.cHILDSEGMENTSVSSplited,
this.dEFAULTTYPE,
this.dEFAULTVALUE,
this.dESCFLEXCONTEXTCODE,
this.dESCFLEXCONTEXTNAME,
this.dESCFLEXNAME,
this.dISPLAYFLAG,
this.eNABLEDFLAG,
this.eSERVICESDV,
this.eSERVICESVS,
this.fLEXVALUESETNAME,
this.fORMATTYPE,
this.fORMATTYPEDSP,
this.lONGLISTFLAG,
this.mAXIMUMSIZE,
this.mAXIMUMVALUE,
this.mINIMUMVALUE,
this.mOBILEENABLED,
this.nUMBERPRECISION,
this.nUMERICMODEENABLEDFLAG,
this.pARENTSEGMENTSDV,
this.pARENTSEGMENTSDVSplited,
this.pARENTSEGMENTSVS,
this.pARENTSEGMENTSVSSplitedVS,
this.rEADONLY,
this.rEQUIREDFLAG,
this.sEGMENTNAME,
this.sEGMENTPROMPT,
this.sEGMENTSEQNUM,
this.uPPERCASEONLYFLAG,
this.uSEDFLAG,
this.vALIDATIONTYPE,
this.vALIDATIONTYPEDSP});
GetTermDffStructureList.fromJson(Map<String, dynamic> json) {
aLPHANUMERICALLOWEDFLAG = json['ALPHANUMERIC_ALLOWED_FLAG'];
aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME'];
cHILDSEGMENTSVS = json['CHILD_SEGMENTS_VS'];
cHILDSEGMENTSVSSplited = json['CHILD_SEGMENTS_VS_Splited'] == null ? <String>[] : json['CHILD_SEGMENTS_VS_Splited'].cast<String>();
dEFAULTTYPE = json['DEFAULT_TYPE'];
dEFAULTVALUE = json['DEFAULT_VALUE'];
dESCFLEXCONTEXTCODE = json['DESC_FLEX_CONTEXT_CODE'];
dESCFLEXCONTEXTNAME = json['DESC_FLEX_CONTEXT_NAME'];
dESCFLEXNAME = json['DESC_FLEX_NAME'];
dISPLAYFLAG = json['DISPLAY_FLAG'];
eNABLEDFLAG = json['ENABLED_FLAG'];
eSERVICESDV = json['E_SERVICES_DV'] != null ? new ESERVICESDV.fromJson(json['E_SERVICES_DV']) : null;
if (json['E_SERVICES_VS'] != null) {
eSERVICESVS = <ESERVICESVS>[];
json['E_SERVICES_VS'].forEach((v) {
eSERVICESVS!.add(ESERVICESVS.fromJson(v));
});
}
fLEXVALUESETNAME = json['FLEX_VALUE_SET_NAME'];
fORMATTYPE = json['FORMAT_TYPE'];
fORMATTYPEDSP = json['FORMAT_TYPE_DSP'];
lONGLISTFLAG = json['LONGLIST_FLAG'];
mAXIMUMSIZE = json['MAXIMUM_SIZE'];
mAXIMUMVALUE = json['MAXIMUM_VALUE'];
mINIMUMVALUE = json['MINIMUM_VALUE'];
mOBILEENABLED = json['MOBILE_ENABLED'];
nUMBERPRECISION = json['NUMBER_PRECISION'];
nUMERICMODEENABLEDFLAG = json['NUMERIC_MODE_ENABLED_FLAG'];
pARENTSEGMENTSDV = json['PARENT_SEGMENTS_DV'];
if (json['PARENT_SEGMENTS_DV_Splited'] != null) {
pARENTSEGMENTSDVSplited = <PARENTSEGMENTSDVSplited>[];
json['PARENT_SEGMENTS_DV_Splited'].forEach((v) {
pARENTSEGMENTSDVSplited!.add(PARENTSEGMENTSDVSplited.fromJson(v));
});
}
pARENTSEGMENTSVS = json['PARENT_SEGMENTS_VS'];
if (json['PARENT_SEGMENTS_VS_SplitedVS'] != null) {
pARENTSEGMENTSVSSplitedVS = <PARENTSEGMENTSVSSplitedVS>[];
json['PARENT_SEGMENTS_VS_SplitedVS'].forEach((v) {
pARENTSEGMENTSVSSplitedVS!.add(PARENTSEGMENTSVSSplitedVS.fromJson(v));
});
}
rEADONLY = json['READ_ONLY'];
rEQUIREDFLAG = json['REQUIRED_FLAG'];
sEGMENTNAME = json['SEGMENT_NAME'];
sEGMENTPROMPT = json['SEGMENT_PROMPT'];
sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM'];
uPPERCASEONLYFLAG = json['UPPERCASE_ONLY_FLAG'];
uSEDFLAG = json['USED_FLAG'];
vALIDATIONTYPE = json['VALIDATION_TYPE'];
vALIDATIONTYPEDSP = json['VALIDATION_TYPE_DSP'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = new Map<String, dynamic>();
data['ALPHANUMERIC_ALLOWED_FLAG'] = this.aLPHANUMERICALLOWEDFLAG;
data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME;
data['CHILD_SEGMENTS_VS'] = this.cHILDSEGMENTSVS;
data['CHILD_SEGMENTS_VS_Splited'] = this.cHILDSEGMENTSVSSplited;
data['DEFAULT_TYPE'] = this.dEFAULTTYPE;
data['DEFAULT_VALUE'] = this.dEFAULTVALUE;
data['DESC_FLEX_CONTEXT_CODE'] = this.dESCFLEXCONTEXTCODE;
data['DESC_FLEX_CONTEXT_NAME'] = this.dESCFLEXCONTEXTNAME;
data['DESC_FLEX_NAME'] = this.dESCFLEXNAME;
data['DISPLAY_FLAG'] = this.dISPLAYFLAG;
data['ENABLED_FLAG'] = this.eNABLEDFLAG;
if (this.eSERVICESDV != null) {
data['E_SERVICES_DV'] = this.eSERVICESDV!.toJson();
}
if (this.eSERVICESVS != null) {
data['E_SERVICES_VS'] = this.eSERVICESVS!.map((v) => v.toJson()).toList();
}
data['FLEX_VALUE_SET_NAME'] = this.fLEXVALUESETNAME;
data['FORMAT_TYPE'] = this.fORMATTYPE;
data['FORMAT_TYPE_DSP'] = this.fORMATTYPEDSP;
data['LONGLIST_FLAG'] = this.lONGLISTFLAG;
data['MAXIMUM_SIZE'] = this.mAXIMUMSIZE;
data['MAXIMUM_VALUE'] = this.mAXIMUMVALUE;
data['MINIMUM_VALUE'] = this.mINIMUMVALUE;
data['MOBILE_ENABLED'] = this.mOBILEENABLED;
data['NUMBER_PRECISION'] = this.nUMBERPRECISION;
data['NUMERIC_MODE_ENABLED_FLAG'] = this.nUMERICMODEENABLEDFLAG;
data['PARENT_SEGMENTS_DV'] = this.pARENTSEGMENTSDV;
if (this.pARENTSEGMENTSDVSplited != null) {
data['PARENT_SEGMENTS_DV_Splited'] = this.pARENTSEGMENTSDVSplited!.map((v) => v.toJson()).toList();
}
data['PARENT_SEGMENTS_VS'] = this.pARENTSEGMENTSVS;
if (this.pARENTSEGMENTSVSSplitedVS != null) {
data['PARENT_SEGMENTS_VS_SplitedVS'] = this.pARENTSEGMENTSVSSplitedVS!.map((v) => v.toJson()).toList();
}
data['READ_ONLY'] = this.rEADONLY;
data['REQUIRED_FLAG'] = this.rEQUIREDFLAG;
data['SEGMENT_NAME'] = this.sEGMENTNAME;
data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT;
data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM;
data['UPPERCASE_ONLY_FLAG'] = this.uPPERCASEONLYFLAG;
data['USED_FLAG'] = this.uSEDFLAG;
data['VALIDATION_TYPE'] = this.vALIDATIONTYPE;
data['VALIDATION_TYPE_DSP'] = this.vALIDATIONTYPEDSP;
return data;
}
bool get isDefaultTypeIsCDPS => (dEFAULTTYPE == "C" || dEFAULTTYPE == "D" || dEFAULTTYPE == "P" || dEFAULTTYPE == "S");
}
class ESERVICESDV {
String? pIDCOLUMNNAME;
String? pRETURNMSG;
String? pRETURNSTATUS;
String? pVALUECOLUMNNAME;
ESERVICESDV({this.pIDCOLUMNNAME, this.pRETURNMSG, this.pRETURNSTATUS, this.pVALUECOLUMNNAME});
ESERVICESDV.fromJson(Map<String, dynamic> json) {
pIDCOLUMNNAME = json['P_ID_COLUMN_NAME'];
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
pVALUECOLUMNNAME = json['P_VALUE_COLUMN_NAME'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = new Map<String, dynamic>();
data['P_ID_COLUMN_NAME'] = this.pIDCOLUMNNAME;
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
data['P_VALUE_COLUMN_NAME'] = this.pVALUECOLUMNNAME;
return data;
}
}
// class ESERVICESVS {
// String? dESCRIPTION;
// int? fROMROWNUM;
// String? iDCOLUMNNAME;
// int? nOOFROWS;
// int? rOWNUM;
// int? tOROWNUM;
// String? vALUECOLUMNNAME;
//
// ESERVICESVS({this.dESCRIPTION, this.fROMROWNUM, this.iDCOLUMNNAME, this.nOOFROWS, this.rOWNUM, this.tOROWNUM, this.vALUECOLUMNNAME});
//
// ESERVICESVS.fromJson(Map<String, dynamic> json) {
// dESCRIPTION = json['DESCRIPTION'];
// fROMROWNUM = json['FROM_ROW_NUM'];
// iDCOLUMNNAME = json['ID_COLUMN_NAME'];
// nOOFROWS = json['NO_OF_ROWS'];
// rOWNUM = json['ROW_NUM'];
// tOROWNUM = json['TO_ROW_NUM'];
// vALUECOLUMNNAME = json['VALUE_COLUMN_NAME'];
// }
//
// Map<String, dynamic> toJson() {
// Map<String, dynamic> data = new Map<String, dynamic>();
// data['DESCRIPTION'] = this.dESCRIPTION;
// data['FROM_ROW_NUM'] = this.fROMROWNUM;
// data['ID_COLUMN_NAME'] = this.iDCOLUMNNAME;
// data['NO_OF_ROWS'] = this.nOOFROWS;
// data['ROW_NUM'] = this.rOWNUM;
// data['TO_ROW_NUM'] = this.tOROWNUM;
// data['VALUE_COLUMN_NAME'] = this.vALUECOLUMNNAME;
// return data;
// }
// }
class PARENTSEGMENTSDVSplited {
String? isRequired;
String? name;
PARENTSEGMENTSDVSplited({this.isRequired, this.name});
PARENTSEGMENTSDVSplited.fromJson(Map<String, dynamic> json) {
isRequired = json['IsRequired'];
name = json['Name'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = new Map<String, dynamic>();
data['IsRequired'] = this.isRequired;
data['Name'] = this.name;
return data;
}
}
class PARENTSEGMENTSVSSplitedVS {
String? isRequired;
String? name;
PARENTSEGMENTSVSSplitedVS({this.isRequired, this.name});
PARENTSEGMENTSVSSplitedVS.fromJson(Map<String, dynamic> json) {
isRequired = json['IsRequired'];
name = json['Name'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = new Map<String, dynamic>();
data['IsRequired'] = this.isRequired;
data['Name'] = this.name;
return data;
}
}

@ -15,6 +15,7 @@ import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart';
import 'package:mohem_flutter_app/models/dashboard/list_menu.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/models/dashboard/menus.dart';
import 'package:mohem_flutter_app/models/dashboard/mohemm_itg_pending_task_responseitem.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart';
@ -72,6 +73,41 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
return true;
}
void initProvider() {
isAttendanceTrackingLoading = true;
endTime = 0;
isTimeRemainingInSeconds = 0;
progress = 0.0;
attendanceTracking = null;
isWorkListLoading = true;
workListCounter = 0;
isMissingSwipeLoading = true;
missingSwipeCounter = 0;
isLeaveTicketBalanceLoading = true;
accrualList = null;
leaveBalanceAccrual = null;
ticketBalance = 0;
isServicesMenusLoading = true;
homeMenus = null;
getMenuEntriesList = null;
isOffersLoading = true;
getOffersList = [];
drawerMenuItemList = [
DrawerMenuItem("assets/images/drawer/my_profile.svg", LocaleKeys.myProfile.tr(), AppRoutes.profile),
DrawerMenuItem("assets/images/drawer/performance_evaluation.svg", LocaleKeys.performanceEvaluation.tr(), AppRoutes.performanceEvaluation),
DrawerMenuItem("assets/images/drawer/mowadhafi.svg", LocaleKeys.mowadhafhi.tr(), AppRoutes.mowadhafhi),
DrawerMenuItem("assets/images/drawer/pending_trasactions.svg", LocaleKeys.pendingTransactions.tr(), AppRoutes.pendingTransactions),
DrawerMenuItem("assets/images/drawer/change_password.svg", LocaleKeys.changePassword.tr(), AppRoutes.changePassword),
];
notifyListeners();
}
int calculateSeconds(String time) {
int hour = int.parse(time.split(":")[0]);
int mints = int.parse(time.split(":")[1]);
@ -81,27 +117,31 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void update(context) {
fetchAttendanceTracking(context);
// isAttendanceTrackingLoading = !isAttendanceTrackingLoading;
// isWorkListLoading = !isWorkListLoading;
// attendanceTracking?.pSwipeIn = "a";
// isTimeRemainingInSeconds = calculateSeconds("00:10:30");
// endTime = DateTime.now().millisecondsSinceEpoch + Duration(seconds: isTimeRemainingInSeconds).inMilliseconds;
// notifyListeners();
}
ItgFormsModel? itgFormsModel;
List<GetOpenNotificationsList>? getOpenNotificationsList;
MohemmITGPendingTaskResponseItem? cocCount;
int cocFinalCount = 0;
//Work List API's & Methods
Future fetchWorkListCounter(context, {bool showLoading = false}) async {
try {
if (showLoading) Utils.showLoading(context);
GenericResponseModel? genericResponseModel = await DashboardApiClient().getOpenNotifications();
isWorkListLoading = false;
getOpenNotificationsList = genericResponseModel?.getOpenNotificationsList;
workListCounter = genericResponseModel?.pOPENNTFNUMBER ?? 0;
itgFormsModel = await DashboardApiClient().getItgFormsPendingTask();
workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0);
GenericResponseModel? cocGenericResponseModel = await DashboardApiClient().getCOCNotifications();
cocCount = cocGenericResponseModel?.mohemmITGPendingTaskResponseItem;
if (cocCount != null) {
cocFinalCount = (cocCount?.escalation ?? 0) + (cocCount?.waitingToClose ?? 0) + (cocCount?.waitingForAcceptance ?? 0) + (cocCount?.extendTATRequest ?? 0);
workListCounter += cocFinalCount;
}
if (showLoading) Utils.hideLoading(context);
notifyListeners();
} catch (ex) {
@ -146,13 +186,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
//List Menu API's & Methods
List<DrawerMenuItem> drawerMenuItemList = [
DrawerMenuItem("assets/images/drawer/my_profile.svg", LocaleKeys.myProfile.tr(), AppRoutes.profile),
DrawerMenuItem("assets/images/drawer/performance_evaluation.svg", LocaleKeys.performanceEvaluation.tr(), AppRoutes.performanceEvaluation),
DrawerMenuItem("assets/images/drawer/mowadhafi.svg", LocaleKeys.mowadhafhi.tr(), AppRoutes.mowadhafhi),
DrawerMenuItem("assets/images/drawer/pending_trasactions.svg", LocaleKeys.pendingTransactions.tr(), AppRoutes.pendingTransactions),
DrawerMenuItem("assets/images/drawer/change_password.svg", LocaleKeys.changePassword.tr(), AppRoutes.changePassword),
];
List<DrawerMenuItem> drawerMenuItemList = [];
void fetchListMenu() async {
try {

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

@ -1,5 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
@ -37,12 +38,17 @@ class EmployeeDigitialIdDialog extends StatelessWidget {
boxShadow: [BoxShadow(color: Colors.white60, blurRadius: 10, spreadRadius: 10)],
),
clipBehavior: Clip.antiAlias,
child: Image.memory(
Utils.getPostBytes(
AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
),
fit: BoxFit.cover,
),
child: (AppState().memberInformationList!.eMPLOYEEIMAGE == null || AppState().memberInformationList!.eMPLOYEEIMAGE!.isEmpty)
? Container(
color: Colors.grey[300],
child: SvgPicture.asset("assets/images/user.svg"),
)
: Image.memory(
Utils.getPostBytes(
AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
),
fit: BoxFit.cover,
),
),
16.width,
(AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText20(),
@ -55,9 +61,9 @@ class EmployeeDigitialIdDialog extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
12.height,
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText16(),
(AppState().memberInformationList!.eMPLOYEEDISPLAYNAME ?? "").toText16(),
4.height,
(AppState().memberInformationList!.pOSITIONNAME ?? "").toText12(isBold: false),
(showJobName(AppState().memberInformationList!.pOSITIONNAME ?? "")).toText12(isBold: false),
],
),
),
@ -76,4 +82,14 @@ class EmployeeDigitialIdDialog extends StatelessWidget {
),
);
}
String showJobName(String position){
try{
var p=position.split(".");
return p[0]+" "+p[1];
}catch(e){
return "";
}
}
}

@ -23,6 +23,7 @@ import 'package:mohem_flutter_app/widgets/mark_attendance_widget.dart';
import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
import 'package:mohem_flutter_app/widgets/shimmer/offers_shimmer_widget.dart';
import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
class DashboardScreen extends StatefulWidget {
DashboardScreen({Key? key}) : super(key: key);
@ -37,12 +38,25 @@ class _DashboardScreenState extends State<DashboardScreen> {
late DashboardProviderModel data;
final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey();
final RefreshController _refreshController =
RefreshController(initialRefresh: false);
int currentIndex = 0;
@override
void initState() {
super.initState();
data = Provider.of<DashboardProviderModel>(context, listen: false);
_onRefresh();
}
@override
void dispose() {
super.dispose();
}
void _onRefresh() async {
data.initProvider();
data.fetchListMenu();
data.fetchAttendanceTracking(context);
data.fetchWorkListCounter(context);
@ -50,11 +64,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
data.fetchLeaveTicketBalance(context, DateTime.now());
data.fetchMenuEntries();
data.getCategoryOffersListAPI(context);
}
@override
void dispose() {
super.dispose();
_refreshController.refreshCompleted();
}
@override
@ -97,7 +107,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
_scaffoldState.currentState!.openDrawer();
});
}),
Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
Image.asset("assets/images/logos/main_mohemm_logo.png",
width: 134, height: 28)
.expanded,
SizedBox(
width: 36,
height: 36,
@ -124,48 +136,161 @@ class _DashboardScreenState extends State<DashboardScreen> {
],
).paddingOnly(left: 21, right: 21, top: 48, bottom: 7),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color),
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true),
16.height,
Row(
children: [
Expanded(
child: AspectRatio(
aspectRatio: 159 / 159,
child: Consumer<DashboardProviderModel>(
builder: (context, model, child) {
return (model.isAttendanceTrackingLoading
? GetAttendanceTrackingShimmer()
: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [
MyColors.gradiantEndColor,
MyColors.gradiantStartColor,
]),
),
child: Stack(
alignment: Alignment.center,
children: [
if (model.isTimeRemainingInSeconds == 0)SvgPicture.asset("assets/images/thumb.svg"),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
child: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: const MaterialClassicHeader(
color: MyColors.gradiantEndColor,
),
controller: _refreshController,
onRefresh: _onRefresh,
child: SingleChildScrollView(
child: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.goodMorning
.tr()
.toText14(color: MyColors.grey77Color),
(AppState().memberInformationList!.eMPLOYEENAME ?? "")
.toText24(isBold: true),
16.height,
Row(
children: [
Expanded(
child: AspectRatio(
aspectRatio: 159 / 159,
child: Consumer<DashboardProviderModel>(
builder: (context, model, child) {
return (model.isAttendanceTrackingLoading
? GetAttendanceTrackingShimmer()
: Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(15),
gradient:
const LinearGradient(
transform:
GradientRotation(
.46),
begin: Alignment
.topRight,
end: Alignment
.bottomLeft,
colors: [
MyColors
.gradiantEndColor,
MyColors
.gradiantStartColor,
]),
),
child: Stack(
alignment: Alignment.center,
children: [
if (model
.isTimeRemainingInSeconds ==
0)
SvgPicture.asset(
"assets/images/thumb.svg"),
Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Expanded(
child: Column(
mainAxisSize:
MainAxisSize
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
LocaleKeys
.markAttendance
.tr()
.toText14(
color: Colors
.white,
isBold:
true),
if (model
.isTimeRemainingInSeconds ==
0)
"01-02-2022".toText12(
color: Colors
.white),
if (model
.isTimeRemainingInSeconds !=
0)
Column(
mainAxisSize:
MainAxisSize
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
9.height,
CountdownTimer(
endTime: model
.endTime,
onEnd:
null,
endWidget: "00:00:00".toText14(
color: Colors
.white,
isBold:
true),
textStyle: TextStyle(
color: Colors
.white,
fontSize:
14,
letterSpacing:
-0.48,
fontWeight:
FontWeight.bold),
),
LocaleKeys
.timeLeftToday
.tr()
.toText12(
color:
Colors.white),
9.height,
ClipRRect(
borderRadius:
BorderRadius
.all(
Radius.circular(
20),
),
child:
LinearProgressIndicator(
value: model
.progress,
minHeight:
8,
valueColor:
const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor:
const Color(0xff196D73),
),
),
],
),
],
).paddingOnly(
top: 12,
right: 15,
left: 12),
),
Row(
children: [
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
if (model.isTimeRemainingInSeconds == 0)"01-02-2022".toText12(color: Colors.white),
if (model.isTimeRemainingInSeconds != 0)
Column(
Expanded(
child: Column(
mainAxisSize:
MainAxisSize
.min,
@ -173,306 +298,243 @@ class _DashboardScreenState extends State<DashboardScreen> {
CrossAxisAlignment
.start,
children: [
9.height,
CountdownTimer(
endTime: model
.endTime,
onEnd: null,
endWidget: "00:00:00".toText14(
color: Colors
.white,
isBold:
true),
textStyle: TextStyle(
color: Colors
.white,
fontSize:
14,
letterSpacing:
-0.48,
fontWeight:
FontWeight.bold),
),
LocaleKeys
.timeLeftToday
.checkIn
.tr()
.toText12(
color:
Colors.white),
9.height,
ClipRRect(
borderRadius:
BorderRadius
.all(
Radius.circular(
20),
),
child:
LinearProgressIndicator(
value: model
.progress,
minHeight:
8,
valueColor: const AlwaysStoppedAnimation<
Color>(
Colors
.white),
backgroundColor:
const Color(
0xff196D73),
),
),
(model.attendanceTracking!.pSwipeIn ==
null
? "--:--"
: model
.attendanceTracking!
.pSwipeIn)
.toString()
.toText14(
color: Colors
.white,
isBold:
true),
4.height,
],
),
],
).paddingOnly(
top: 12,
right: 15,
left: 12),
),
Row(
children: [
Expanded(
child: Column(
mainAxisSize:
MainAxisSize
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
LocaleKeys
.checkIn
.tr()
.toText12(
color: Colors
.white),
(model.attendanceTracking!.pSwipeIn ==
null
? "--:--"
: model
.attendanceTracking!
.pSwipeIn)
.toString()
.toText14(
color: Colors
.white,
isBold:
true),
4.height,
],
).paddingOnly(
left: 12),
),
Container(
width: 45,
height: 45,
padding:
const EdgeInsets
).paddingOnly(
left: 12),
),
Container(
width: 45,
height: 45,
padding:
const EdgeInsets
.only(
left: 14,
right:
14),
decoration:
const BoxDecoration(
color: Color(
0xff259EA4),
borderRadius:
BorderRadius
.only(
left: 14,
right: 14),
decoration:
const BoxDecoration(
color: Color(
0xff259EA4),
borderRadius:
BorderRadius
.only(
bottomRight:
Radius
.circular(
15),
bottomRight: Radius
.circular(
15),
),
),
),
child: SvgPicture.asset(
model.isTimeRemainingInSeconds ==
0
? "assets/images/play.svg"
: "assets/images/stop.svg"),
).onPress(() {
showMyBottomSheet(
context,
child:
MarkAttendanceWidget(
model));
}),
],
),
],
),
],
),
).onPress(
() {
Navigator.pushNamed(context,
AppRoutes.todayAttendance);
},
))
.animatedSwither();
},
child: SvgPicture.asset(
model.isTimeRemainingInSeconds ==
0
? "assets/images/play.svg"
: "assets/images/stop.svg"),
).onPress(() {
showMyBottomSheet(
context,
child:
MarkAttendanceWidget(
model));
}),
],
),
],
),
],
),
).onPress(
() {
Navigator.pushNamed(
context,
AppRoutes
.todayAttendance);
},
))
.animatedSwither();
},
),
),
),
),
9.width,
Expanded(
child: MenusWidget(),
),
],
),
],
).paddingOnly(left: 21, right: 21, top: 7),
ServicesWidget(),
// 8.height,
Container(
width: double.infinity,
padding: const EdgeInsets.only(top: 31),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(50),
topLeft: Radius.circular(50)),
border: Border.all(
color: MyColors.lightGreyEDColor, width: 1),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
9.width,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
LocaleKeys.offers.tr().toText12(),
Row(
children: [
LocaleKeys.discounts
.tr()
.toText24(isBold: true),
6.width,
Container(
padding: const EdgeInsets.only(
left: 8, right: 8),
decoration: BoxDecoration(
color: MyColors.yellowColor,
borderRadius:
BorderRadius.circular(10),
),
child: LocaleKeys.newString
.tr()
.toText10(isBold: true)),
],
),
],
),
child: MenusWidget(),
),
LocaleKeys.viewAllOffers
.tr()
.toText12(isUnderLine: true)
.onPress(() {
Navigator.pushNamed(
context, AppRoutes.offersAndDiscounts);
})
],
).paddingOnly(left: 21, right: 21),
Consumer<DashboardProviderModel>(
builder: (context, model, child) {
return SizedBox(
height: 103 + 33,
child: ListView.separated(
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(
left: 21, right: 21, top: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (cxt, index) {
return model.isOffersLoading
? const OffersShimmerWidget()
: InkWell(
onTap: () {
navigateToDetails(
data.getOffersList[index]);
},
child: SizedBox(
width: 73,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Container(
width: 73,
height: 73,
decoration: BoxDecoration(
borderRadius:
const BorderRadius
.all(
Radius.circular(100),
),
border: Border.all(
color: MyColors
.lightGreyE3Color,
width: 1),
),
child: ClipRRect(
borderRadius:
const BorderRadius
.all(
Radius.circular(50),
),
],
).paddingOnly(left: 21, right: 21, top: 7),
ServicesWidget(),
// 8.height,
Container(
width: double.infinity,
padding: const EdgeInsets.only(top: 31),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(50),
topLeft: Radius.circular(50)),
border: Border.all(
color: MyColors.lightGreyEDColor, width: 1),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
LocaleKeys.offers.tr().toText12(),
Row(
children: [
LocaleKeys.discounts
.tr()
.toText24(isBold: true),
6.width,
Container(
padding: const EdgeInsets.only(
left: 8, right: 8),
decoration: BoxDecoration(
color: MyColors.yellowColor,
borderRadius:
BorderRadius.circular(10),
),
child: LocaleKeys.newString
.tr()
.toText10(isBold: true)),
],
),
],
),
),
LocaleKeys.viewAllOffers
.tr()
.toText12(isUnderLine: true)
.onPress(() {
Navigator.pushNamed(
context, AppRoutes.offersAndDiscounts);
})
],
).paddingOnly(left: 21, right: 21),
Consumer<DashboardProviderModel>(
builder: (context, model, child) {
return SizedBox(
height: 103 + 33,
child: ListView.separated(
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(
left: 21, right: 21, top: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (cxt, index) {
return model.isOffersLoading
? const OffersShimmerWidget()
: InkWell(
onTap: () {
navigateToDetails(
data.getOffersList[index]);
},
child: SizedBox(
width: 73,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Container(
width: 73,
height: 73,
decoration: BoxDecoration(
borderRadius:
const BorderRadius
.all(
Radius.circular(100),
),
border: Border.all(
color: MyColors
.lightGreyE3Color,
width: 1),
),
child: Hero(
tag: "ItemImage" +
child: ClipRRect(
borderRadius:
const BorderRadius
.all(
Radius.circular(50),
),
child: Hero(
tag: "ItemImage" +
data
.getOffersList[
index]
.rowID!,
transitionOnUserGestures:
true,
child: Image.network(
data
.getOffersList[
index]
.rowID!,
transitionOnUserGestures:
true,
child: Image.network(
data
.getOffersList[
index]
.bannerImage!,
fit: BoxFit.contain,
.bannerImage!,
fit: BoxFit.contain,
),
),
),
),
),
4.height,
Expanded(
child: AppState()
.isArabic(context)
? data
.getOffersList[
index]
.titleAR!
.toText12(
isCenter: true,
maxLine: 1)
: data
.getOffersList[
index]
.title!
.toText12(
isCenter: true,
maxLine: 1),
),
],
4.height,
Expanded(
child: AppState()
.isArabic(context)
? data
.getOffersList[
index]
.titleAR!
.toText12(
isCenter:
true,
maxLine: 1)
: data
.getOffersList[
index]
.title!
.toText12(
isCenter:
true,
maxLine: 1),
),
],
),
),
),
);
},
separatorBuilder: (cxt, index) => 8.width,
itemCount: 6),
);
},
),
],
),
)
],
);
},
separatorBuilder: (cxt, index) => 8.width,
itemCount: 6),
);
},
),
],
),
)
],
),
),
),
)
@ -547,15 +609,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
).paddingAll(4),
label: LocaleKeys.itemsForSale.tr(),
),
BottomNavigationBarItem(
icon: SvgPicture.asset(
"assets/icons/chat/chat.svg",
color: currentIndex == 4
? MyColors.grey3AColor
: MyColors.grey98Color,
).paddingAll(4),
label: LocaleKeys.chat.tr(),
),
],
currentIndex: currentIndex,
selectedLabelStyle: const TextStyle(
@ -580,8 +633,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
Navigator.pushNamed(context, AppRoutes.workList);
} else if (index == 3) {
Navigator.pushNamed(context, AppRoutes.itemsForSale);
} else if (index == 4) {
Navigator.pushNamed(context, AppRoutes.chat);
}
},
),

@ -124,7 +124,7 @@ class _AppDrawerState extends State<AppDrawer> {
9.width,
title.toText14(color: color).expanded
],
).paddingOnly(left: 21, top: 10, bottom: 10).onPress(closeDrawer
).paddingOnly(left: 21, top: 10, bottom: 10, right: 21).onPress(closeDrawer
? () async {
Navigator.pop(context);
Future.delayed(const Duration(microseconds: 200), onPress);

@ -1,6 +1,7 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
@ -43,7 +44,11 @@ class MenusWidget extends StatelessWidget {
Expanded(
child: data.workListCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
),
SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
RotatedBox(
quarterTurns: AppState().isArabic(context) ? 2:4,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
),
],
)
],
@ -70,7 +75,10 @@ class MenusWidget extends StatelessWidget {
Expanded(
child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
),
SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
RotatedBox(
quarterTurns: AppState().isArabic(context) ? 2:4,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
),
],
)
],
@ -97,7 +105,10 @@ class MenusWidget extends StatelessWidget {
Expanded(
child: data.leaveBalance.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
),
SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
RotatedBox(
quarterTurns: AppState().isArabic(context) ? 2:4,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
),
],
)
],
@ -124,7 +135,10 @@ class MenusWidget extends StatelessWidget {
Expanded(
child: data.ticketBalance.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
),
SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
RotatedBox(
quarterTurns: AppState().isArabic(context) ? 2:4,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
),
],
)
],

@ -1,6 +1,7 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
@ -22,10 +23,10 @@ class ServicesWidget extends StatelessWidget {
"assets/images/monthly_attendance.svg",
"assets/images/ticket_request.svg",
"assets/images/ticket_request.svg",
"assets/images/dynamic_screens.svg",
"assets/images/dynamic_screens.svg",
"assets/images/dynamic_screens.svg",
"assets/images/dynamic_screens.svg"
"assets/images/ticket_request.svg",
"assets/images/ticket_request.svg",
"assets/images/ticket_request.svg",
"assets/images/ticket_request.svg"
];
return Consumer<DashboardProviderModel>(
@ -73,9 +74,13 @@ class ServicesWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText11(isBold: true),
child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText10(isBold: true),
),
SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)
RotatedBox(
quarterTurns: AppState().isArabic(context) ? 2:4,
child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)
),
],
)
],

@ -81,8 +81,8 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
Utils.showLoading(context);
CalculateAbsenceDuration duration = await LeaveBalanceApiClient()
.calculateAbsenceDuration(selectedAbsenceType!.aBSENCEATTENDANCETYPEID!, Utils.getMonthNamedFormat(startDateTime!), Utils.getMonthNamedFormat(endDateTime!), -999);
print(duration.toJson());
totalDays = duration.pABSENCEDAYS;
totalDays = duration.pABSENCEDAYS?.toInt();
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
@ -205,7 +205,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
),
12.height,
DynamicTextFieldWidget(
"Total Days",
LocaleKeys.totalDays.tr(),
totalDays?.toString() ?? "Calculated days",
isInputTypeNum: true,
isEnable: false,

@ -62,7 +62,7 @@ class _LeaveBalanceState extends State<LeaveBalance> {
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
children: [
const BalancesDashboardWidget("Current Leave Balance", true),
BalancesDashboardWidget(LocaleKeys.currentLeaveBalance.tr(), true),
12.height,
absenceTransList == null
? const SizedBox()

@ -130,8 +130,8 @@ class _LoginScreenState extends State<LoginScreen> {
if (isAppOpenBySystem == null) {
isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool;
print('isAppOpenBySystem:$isAppOpenBySystem');
// username.text = "15153";
// password.text = "Abcd@12345";
username.text = "15153";
password.text = "Abcd@12345";
if (isAppOpenBySystem!) checkFirebaseToken();
}

@ -57,21 +57,30 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
@override
Widget build(BuildContext context) {
mobileLoginInfoListModel ??= ModalRoute.of(context)!.settings.arguments as GetMobileLoginInfoListModel;
String empName = AppState().isArabic(context) ? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr! : AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn!;
mobileLoginInfoListModel ??= ModalRoute.of(context)!.settings.arguments
as GetMobileLoginInfoListModel;
String empName = AppState().isArabic(context)
? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr!
: AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn!;
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false)
? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {
? LocaleKeys.viewBusinessCard
.tr()
.toText12(color: MyColors.textMixColor, isUnderLine: true)
.onPress(() {
showMDialog(context, child: BusinessCardDialog());
})
: null,
actions: [
Center(
child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {
child: LocaleKeys.employeeDigitalID
.tr()
.toText12(color: MyColors.textMixColor, isUnderLine: true)
.onPress(() {
showMDialog(context, child: EmployeeDigitialIdDialog());
})),
21.width
@ -90,9 +99,12 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.welcomeBack.tr().toText12(),
mobileLoginInfoListModel!.employeeName!.toText24(isBold: true),
mobileLoginInfoListModel!.employeeName!
.toText24(isBold: true),
10.height,
LocaleKeys.wouldYouLikeToLoginWithCurrentUsername.tr().toText16(),
LocaleKeys.wouldYouLikeToLoginWithCurrentUsername
.tr()
.toText16(),
Container(
height: 72,
margin: const EdgeInsets.only(top: 23, bottom: 23),
@ -114,26 +126,42 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
LocaleKeys.lastLoginDetails.tr().toText16(),
DateUtil.formatDateToDate(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!), false).toText12(),
DateUtil.formatDateToDate(
DateUtil.convertStringToDate(
mobileLoginInfoListModel!.editedOn!),
false)
.toText12(),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
LocaleKeys.verificationType.tr().toText10(color: MyColors.grey57Color),
getVerificationType(mobileLoginInfoListModel!.loginType!).toText12(),
LocaleKeys.verificationType
.tr()
.toText10(color: MyColors.grey57Color),
getVerificationType(
mobileLoginInfoListModel!.loginType!)
.toText12(),
Expanded(child: SizedBox()),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!)).toText12(),
DateUtil.formatDateToTime(
DateUtil.convertStringToDate(
mobileLoginInfoListModel!.editedOn!))
.toText12(),
],
)
],
),
),
LocaleKeys.pleaseVerify.tr().toText16(),
if (isNeedVerifyWithFaceIDAndBiometrics) LocaleKeys.pleaseVerifyForBio.tr().toText12(),
if (isNeedVerifyWithFaceIDAndBiometrics)
LocaleKeys.pleaseVerifyForBio.tr().toText12(),
GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 13,
mainAxisSpacing: 9),
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 9),
shrinkWrap: true,
@ -186,7 +214,9 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
DefaultButton(
LocaleKeys.useAnotherAccount.tr(),
() {
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route<dynamic> route) => false, arguments: false);
Navigator.pushNamedAndRemoveUntil(
context, AppRoutes.login, (Route<dynamic> route) => false,
arguments: false);
},
).insideContainer,
],
@ -218,11 +248,19 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
}
Future<bool> loginWithFaceIDAndBiometrics() async {
IOSAuthMessages iosStrings =
const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID');
IOSAuthMessages iosStrings = const IOSAuthMessages(
cancelButton: 'cancel',
goToSettingsButton: 'settings',
goToSettingsDescription: 'Please set up your Touch ID.',
lockOut: 'Please reenable your Touch ID');
bool authenticated = false;
try {
authenticated = await auth.authenticate(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, biometricOnly: true, iOSAuthStrings: iosStrings);
authenticated = await auth.authenticate(
localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true,
stickyAuth: true,
biometricOnly: true,
iOSAuthStrings: iosStrings);
} on PlatformException catch (e) {
print(e);
Utils.hideLoading(context);
@ -231,8 +269,11 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
return authenticated;
}
Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) {
bool isDisable = ((_flag == 3 && !checkBiometricIsAvailable(BiometricType.face)) || (_flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint)));
Widget _loginOptionButton(
String _title, String _icon, int _flag, int? _loginIndex) {
bool isDisable = ((_flag == 3 &&
!checkBiometricIsAvailable(BiometricType.face)) ||
(_flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint)));
return InkWell(
onTap: isDisable
? null
@ -243,18 +284,21 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
});
} else {
if (_flag == 3 || _flag == 4) {
bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics();
bool authenticateWithFaceAndTouchID =
await loginWithFaceIDAndBiometrics();
if (!authenticateWithFaceAndTouchID) {
return;
} else {
if (mobileLoginInfoListModel!.loginType == 3 || mobileLoginInfoListModel!.loginType == 4) {
if (mobileLoginInfoListModel!.loginType == 3 ||
mobileLoginInfoListModel!.loginType == 4) {
// bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics();
// if (!authenticateWithFaceAndTouchID) {
// return;
// } else {
// performApiCall(_title, _icon, _flag, isDirectLogin: true);
// }
performApiCall(_title, _icon, _flag, _flag, isDirectLogin: true);
performApiCall(_title, _icon, _flag, _flag,
isDirectLogin: true);
} else {
isNeedVerifyWithFaceIDAndBiometrics = true;
selectedFlag = _flag;
@ -272,7 +316,8 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
}
},
child: Container(
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
padding:
const EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: isDisable ? Colors.grey.withOpacity(0.3) : Colors.white,
@ -298,13 +343,23 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
Widget getButton(int flag) {
switch (flag) {
case 1:
return _loginOptionButton(LocaleKeys.verifyThroughSMS.tr(), 'assets/images/login/verify_sms.svg', flag, null);
return _loginOptionButton(LocaleKeys.verifyThroughSMS.tr(),
'assets/images/login/verify_sms.svg', flag, null);
case 2:
return _loginOptionButton(LocaleKeys.verifyThroughWhatsapp.tr(), 'assets/images/login/verify_whatsapp.svg', flag, null);
return _loginOptionButton(LocaleKeys.verifyThroughWhatsapp.tr(),
'assets/images/login/verify_whatsapp.svg', flag, null);
case 3:
return _loginOptionButton(LocaleKeys.verifyThroughFace.tr(), 'assets/images/login/verify_face.svg', flag, BiometricType.face.index);
return _loginOptionButton(
LocaleKeys.verifyThroughFace.tr(),
'assets/images/login/verify_face.svg',
flag,
BiometricType.face.index);
case 4:
return _loginOptionButton(LocaleKeys.verifyThroughFingerprint.tr(), 'assets/images/login/verify_thumb.svg', flag, BiometricType.fingerprint.index);
return _loginOptionButton(
LocaleKeys.verifyThroughFingerprint.tr(),
'assets/images/login/verify_thumb.svg',
flag,
BiometricType.fingerprint.index);
default:
return const SizedBox();
}
@ -321,7 +376,9 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
return isAvailable;
}
Future<void> performApiCall(String _title, String _icon, int _flag, int sendVerificationFlat, {bool isDirectLogin = false}) async {
Future<void> performApiCall(
String _title, String _icon, int _flag, int sendVerificationFlat,
{bool isDirectLogin = false}) async {
try {
if (isDirectLogin)
setState(() {
@ -330,10 +387,16 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
else
Utils.showLoading(context);
await LoginApiClient().checkMobileAppVersion();
await LoginApiClient().memberLogin(AppState().getUserName!, AppState().password!);
await LoginApiClient()
.memberLogin(AppState().getUserName!, AppState().password!);
if (!isDirectLogin)
BasicMemberInformationModel? memberInformationModel =
await LoginApiClient().mohemmSendActivationCodeByOTPNotificationType(0, AppState().memberLoginList?.pMOBILENUMBER, sendVerificationFlat, AppState().getUserName);
await LoginApiClient()
.mohemmSendActivationCodeByOTPNotificationType(
0,
AppState().memberLoginList?.pMOBILENUMBER,
sendVerificationFlat,
AppState().getUserName);
if (isDirectLogin) performDirectApiCall(_title, _icon, _flag, "");
if (!isDirectLogin) Utils.hideLoading(context);
if (!isDirectLogin)
@ -355,25 +418,34 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
}
}
Future<void> performDirectApiCall(String _title, String _icon, int _flag, String value, {bool isDirectLogin = false}) async {
Future<void> performDirectApiCall(
String _title, String _icon, int _flag, String value,
{bool isDirectLogin = false}) async {
try {
GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(false, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName);
GenericResponseModel? genericResponseModel1 = await LoginApiClient().insertMobileLoginInfoNEW(
AppState().memberLoginList?.pEMAILADDRESS ?? "",
genericResponseModel?.pSESSIONID ?? 0,
genericResponseModel?.memberInformationList![0].eMPLOYEENAME ?? "",
_flag,
AppState().memberLoginList?.pMOBILENUMBER ?? "",
AppState().getUserName!,
mobileLoginInfoListModel!.deviceToken!,
Platform.isAndroid ? "android" : "ios");
GenericResponseModel? genericResponseModel = await LoginApiClient()
.checkActivationCode(false, AppState().memberLoginList?.pMOBILENUMBER,
value, AppState().getUserName);
GenericResponseModel? genericResponseModel1 = await LoginApiClient()
.insertMobileLoginInfoNEW(
AppState().memberLoginList?.pEMAILADDRESS ?? "",
genericResponseModel?.pSESSIONID ?? 0,
genericResponseModel?.memberInformationList![0].eMPLOYEENAME ??
"",
_flag,
AppState().memberLoginList?.pMOBILENUMBER ?? "",
AppState().getUserName!,
mobileLoginInfoListModel!.deviceToken!,
Platform.isAndroid ? "android" : "ios");
AppState().setMemberInformationListModel =
genericResponseModel!.memberInformationList?.first;
if (genericResponseModel?.errorMessage != null) {
Utils.showToast(genericResponseModel?.errorMessage ?? "");
// Navigator.pop(context);
}
Utils.hideLoading(context);
Navigator.pop(context);
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.dashboard, (Route<dynamic> route) => false);
Navigator.pushNamedAndRemoveUntil(
context, AppRoutes.dashboard, (Route<dynamic> route) => false);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);

@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/leave_balance_api_client.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/api/termination_dff_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';
@ -128,6 +129,13 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
params!.pItemId,
params!.transactionId,
);
}else if (params!.approvalFlag == 'endEmployment') {
await TerminationDffApiClient().startTermApprovalProcess(
LocaleKeys.submit.tr(),
comments.text,
params!.pItemId,
params!.transactionId,
);
} else {}
Utils.hideLoading(context);

@ -3,6 +3,7 @@ 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/leave_balance_api_client.dart';
import 'package:mohem_flutter_app/api/my_attendance_api_client.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
@ -92,7 +93,11 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
genericResponseModel = await MyAttendanceApiClient().validateEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values);
SubmitEITTransactionList submitEITTransactionList = await MyAttendanceApiClient().submitEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values);
Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams("title", submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit'));
await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit'));
Utils.showLoading(context);
await LeaveBalanceApiClient().cancelHrTransaction(submitEITTransactionList.pTRANSACTIONID!);
Utils.hideLoading(context);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
@ -104,26 +109,26 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
Future calGetValueSetValues(GetEITDFFStructureList structureList) async {
try {
Utils.showLoading(context);
String segmentId = structureList.cHILDSEGMENTSVS!;
if (dESCFLEXCONTEXTCODE.isEmpty) dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!;
List<GetEITDFFStructureList> filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVS == segmentId).toList() ?? [];
List<Map<String, dynamic>> values = filteredList
.map((e) => GetSetValuesRequestModel(
sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME)
.toJson())
.toList();
List<ESERVICESVS> eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
List<GetEITDFFStructureList> abc = genericResponseModel?.getEITDFFStructureList ?? [];
getEitDffStructureList = abc;
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS);
getEitDffStructureList![index].eSERVICESVS!.clear();
if (eServicesResponseModel.isNotEmpty) getEitDffStructureList![index].eSERVICESVS!.addAll(eServicesResponseModel);
// getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? [];
//getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList();
Utils.hideLoading(context);
setState(() {});
Utils.showLoading(context);
String segmentId = structureList.cHILDSEGMENTSVS!;
if (dESCFLEXCONTEXTCODE.isEmpty) dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!;
List<GetEITDFFStructureList> filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVSSplited!.contains(segmentId)).toList() ?? [];
List<Map<String, dynamic>> values = filteredList
.map((e) => GetSetValuesRequestModel(
sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME)
.toJson())
.toList();
List<ESERVICESVS> eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
List<GetEITDFFStructureList> abc = genericResponseModel?.getEITDFFStructureList ?? [];
getEitDffStructureList = abc;
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS);
getEitDffStructureList![index].eSERVICESVS!.clear();
if (eServicesResponseModel.isNotEmpty) getEitDffStructureList![index].eSERVICESVS!.addAll(eServicesResponseModel);
// getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? [];
//getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList();
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);

@ -60,48 +60,49 @@ class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
super.dispose();
}
late bool isTicketRequest;
@override
Widget build(BuildContext context) {
if (dynamicParams == null) {
dynamicParams = ModalRoute.of(context)!.settings.arguments as DynamicListViewParams;
isTicketRequest = dynamicParams!.dynamicId == "HMG_TKT_NEW_EIT_SS";
getTransactions();
}
Widget dataWidget = ListView(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
children: [
// HMG_TKT_NEW_EIT_SS Id used for ticket balance dashboard
if (isTicketRequest) ...[const BalancesDashboardWidget("Current Ticket Balance", false), 12.height],
getEITTransactionList == null
? const SizedBox()
: (getEITTransactionList!.isEmpty
? Utils.getNoDataWidget(context).paddingOnly(top: isTicketRequest ? 50 : 0)
: ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (cxt, int parentIndex) => getEITTransactionList![parentIndex].collectionTransaction!.isEmpty
? const SizedBox()
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++)
if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y")
ItemDetailView(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!,
getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
],
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
itemCount: getEITTransactionList!.length)),
],
);
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(context, title: dynamicParams!.title),
body: Center(
child: ListView(
physics: const BouncingScrollPhysics(),
shrinkWrap: true,
padding: const EdgeInsets.all(21),
children: [
// HMG_TKT_NEW_EIT_SS Id used for ticket balance dashboard
if (dynamicParams!.dynamicId == "HMG_TKT_NEW_EIT_SS") ...[const BalancesDashboardWidget("Current Ticket Balance", false), 12.height],
getEITTransactionList == null
? const SizedBox()
: (getEITTransactionList!.isEmpty
? Utils.getNoDataWidget(context)
: ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (cxt, int parentIndex) => getEITTransactionList![parentIndex].collectionTransaction!.isEmpty
? const SizedBox()
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++)
if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y")
ItemDetailView(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!,
getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
],
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
itemCount: getEITTransactionList!.length)),
],
),
),
body: isTicketRequest ? dataWidget : dataWidget.center,
floatingActionButton: Container(
height: 54,
width: 54,

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
@ -39,7 +40,7 @@ class ServicesMenuListScreen extends StatelessWidget {
? Utils.getNoDataWidget(context)
: ListView.separated(
padding: const EdgeInsets.all(21),
itemBuilder: (cxt, index) => itemView("assets/images/pdf.svg", servicesMenuData.list[index].prompt!).onPress(() {
itemBuilder: (cxt, index) => itemView("assets/images/pdf.svg", servicesMenuData.list[index].prompt!, context).onPress(() {
if (servicesMenuData.list[index].parentMenuName == "MBL_PERINFO_SS") {
if (servicesMenuData.list[index].requestType == "BASIC_DETAILS") {
Navigator.pushNamed(context, AppRoutes.basicDetails);
@ -55,7 +56,14 @@ class ServicesMenuListScreen extends StatelessWidget {
Navigator.pushNamed(context, AppRoutes.leaveBalance);
return;
}
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(servicesMenuData.list[index].prompt!, servicesMenuData.list[index].functionName!));
if (servicesMenuData.list[index].requestType == "EIT") {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(servicesMenuData.list[index].prompt!, servicesMenuData.list[index].functionName!));
} else {
if (servicesMenuData.list[index].requestType == "TERMINATION") {
Navigator.pushNamed(context, AppRoutes.endEmploymentScreen, arguments: DynamicListViewParams(servicesMenuData.list[index].prompt!, servicesMenuData.list[index].functionName!));
}
}
}),
separatorBuilder: (cxt, index) => 12.height,
itemCount: servicesMenuData.list.length),
@ -63,15 +71,15 @@ class ServicesMenuListScreen extends StatelessWidget {
);
}
Widget itemView(String icon, String title) {
Widget itemView(String icon, String title, context) {
return Row(
children: [
(title).toText16().expanded,
12.width,
SvgPicture.asset(
"assets/images/arrow_next.svg",
color: MyColors.darkIconColor,
)
RotatedBox(
quarterTurns: AppState().isArabic(context) ? 2 : 4,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkIconColor),
),
],
).objectContainerView();
}

@ -67,17 +67,23 @@ class _MyTeamState extends State<MyTeam> {
Row(
children: [
TextField(
onChanged: dropdownValue == "name"
onChanged: dropdownValue.toLowerCase() == "name"
? (String value) {
getEmployeeSListOnSearch =
getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEENAME!.toLowerCase().contains(value.toLowerCase())).toList();
setState(() {});
}
: (String value) {
getEmployeeSListOnSearch =
getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEEEMAILADDRESS!.toLowerCase().contains(value.toLowerCase())).toList();
setState(() {});
},
: dropdownValue.toLowerCase() == "username"
? (String value) {
getEmployeeSListOnSearch =
getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEENUMBER!.toLowerCase().contains(value.toLowerCase())).toList();
setState(() {});
}
: (String value) {
getEmployeeSListOnSearch =
getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEEEMAILADDRESS!.toLowerCase().contains(value.toLowerCase())).toList();
setState(() {});
},
style: const TextStyle(
fontSize: 14.0,
color: MyColors.grey3AColor,
@ -113,9 +119,9 @@ class _MyTeamState extends State<MyTeam> {
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 12),
separatorBuilder: (BuildContext cxt,int index) => 12.height,
separatorBuilder: (BuildContext cxt, int index) => 12.height,
itemCount: _textEditingController!.text.isNotEmpty ? getEmployeeSListOnSearch.length : getEmployeeSubordinatesList.length,
itemBuilder: (BuildContext cxt,int index) {
itemBuilder: (BuildContext cxt, int index) {
var phoneNumber = Uri.parse('tel:${getEmployeeSListOnSearch[index].eMPLOYEEMOBILENUMBER}');
return InkWell(
onTap: () async {
@ -177,7 +183,7 @@ class _MyTeamState extends State<MyTeam> {
}
// todo @fatima add translation for below list
List<String> list = [LocaleKeys.name.tr(), LocaleKeys.email.tr()];
List<String> list = [LocaleKeys.name.tr(), LocaleKeys.email.tr(), LocaleKeys.username.tr()];
Widget dropDown() {
return PopupMenuButton(
itemBuilder: (_) => <PopupMenuItem<int>>[

@ -73,7 +73,7 @@ class _TeamMembersState extends State<TeamMembers> {
var phoneNumber = Uri.parse('tel:${getEmployeeSubordinatesList[index].eMPLOYEEMOBILENUMBER}');
return InkWell(
onTap: () async {
// Navigator.pushNamed(context, AppRoutes.employeeDetails, arguments: getEmployeeSubordinatesList[index]);
Navigator.pushNamed(context, AppRoutes.employeeDetails, arguments: getEmployeeSubordinatesList[index]);
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,

@ -40,7 +40,7 @@ class _MonthlyPaySlipScreenState extends State<MonthlyPaySlipScreen> {
}
void getData() async {
try {
// try {
Utils.showLoading(context);
paySlipList = await MonthlyPaySlipApiClient().getPaySlip();
if (paySlipList.isNotEmpty) {
@ -49,14 +49,14 @@ class _MonthlyPaySlipScreenState extends State<MonthlyPaySlipScreen> {
}
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
// } catch (ex) {
// Utils.hideLoading(context);
// Utils.handleException(ex, context, null);
// }
}
Future getDataByActionContextID(int actionContextID, {bool showLoading = false}) async {
try {
// try {
if (showLoading) {
Utils.showLoading(context);
}
@ -74,12 +74,12 @@ class _MonthlyPaySlipScreenState extends State<MonthlyPaySlipScreen> {
Utils.hideLoading(context);
setState(() {});
}
} catch (ex) {
if (showLoading) {
Utils.hideLoading(context);
}
Utils.handleException(ex, context, null);
}
// } catch (ex) {
// if (showLoading) {
// Utils.hideLoading(context);
// }
// Utils.handleException(ex, context, null);
// }
}
@override

@ -48,7 +48,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
}
void callAddAndUpdateFamilyMember() async {
try {
try {
Utils.showLoading(context);
getBasicDetDffStructureList = await ProfileApiClient().getBasicDetDffStructure();
getContactColsStructureList = await ProfileApiClient().getContactColsStructureList(args['actionType']);
@ -199,8 +199,8 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
});
} else {
return DynamicTextFieldWidget(
(model!.sEGMENTPROMPT ?? "") + (model!.rEQUIREDFLAG == "Y" ? "*" : ""),
model!.getContactDetailsList!.sEGMENTVALUEDSP ?? "",
(model!.sEGMENTPROMPT ?? "") + (model!.rEQUIREDFLAG == "Y" ? "*" : "") ,
( model!.getContactDetailsList!.sEGMENTVALUEDSP ?? "")+ (model!.aPPLICATIONCOLUMNNAME == "NATIONAL_IDENTIFIER" ? "1-1111-1111-1" : ""),
onChange: (text) {
model!.getContactDetailsList!.sEGMENTVALUEDSP = text;
},
@ -357,7 +357,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
void submitUpdateForm() async {
try {
try {
List<Map<String, dynamic>> values1 = getBasicDetDffStructureList!.map((e) {
String? dateVal = '';
String? vatcherVal = '';
@ -418,12 +418,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
}).toList();
List<Map<String, dynamic>> valuesFinal = [...values1, ...values2, ...values3];
Utils.showLoading(context);
if (args['actionType'] == "ADD") {
var relationID = null;
submitContactTransactionList = await ProfileApiClient().submitContactTransactionAddAndUpdate(args['actionType'], relationID, valuesFinal);
} else if (args['actionType'] == "UPDATE") {
submitContactTransactionList = await ProfileApiClient().submitContactTransactionAddAndUpdate(args['actionType'], args['relationID'], valuesFinal);
}
submitContactTransactionList = await ProfileApiClient().submitContactTransactionAddAndUpdate(args['actionType'], args['relationID'] ?? 0, valuesFinal);
var transactionId = submitContactTransactionList!.pTRANSACTIONID;
var itemKey = submitContactTransactionList!.pITEMKEY;
Utils.hideLoading(context);

@ -84,24 +84,8 @@ class _ContactDetailsState extends State<ContactDetails> {
if (getEmployeePhonesList.isNotEmpty)
Stack(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
menuEntriesPhone.updateButton == 'Y'
? IconButton(
icon: Icon(
Icons.edit_location_alt_outlined,
size: 20,
),
onPressed: () {
updatePhone();
},
)
: Container()
],
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
itemBuilder: (cxt, index) => Column(
@ -113,38 +97,20 @@ class _ContactDetailsState extends State<ContactDetails> {
),
separatorBuilder: (cxt, index) => 12.height,
itemCount: getEmployeePhonesList.length),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: getEmployeePhonesList
// .map((e) => Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
// "${e.pHONETYPEMEANING}".toText13(color: MyColors.lightGrayColor),
// "${e.pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor),
// ]))
// .toList())
if (menuEntriesPhone.updateButton == 'Y')
Positioned(
top: 1,
right: 1,
child: const Icon(Icons.edit_location_alt_outlined, size: 20).onPress(updatePhone),
),
],
).objectContainerView(),
12.height,
if (getEmployeeAddressList.isNotEmpty)
Stack(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
menuEntriesAddress.updateButton == 'Y'
? IconButton(
icon: Icon(
Icons.edit_location_alt_outlined,
size: 20,
),
onPressed: () {
addUpdateAddress();
},
)
: Container()
],
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
itemBuilder: (cxt, index) => Column(
@ -156,14 +122,12 @@ class _ContactDetailsState extends State<ContactDetails> {
),
separatorBuilder: (cxt, index) => 12.height,
itemCount: getEmployeeAddressList.length),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: getEmployeeAddressList
// .map((e) => Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
// "${e.sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor),
// "${e.sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor),
// ]))
// .toList())
if (menuEntriesAddress.updateButton == 'Y')
Positioned(
top: 1,
right: 1,
child: const Icon(Icons.edit_location_alt_outlined, size: 20).onPress(addUpdateAddress),
),
],
).objectContainerView()
],

@ -67,11 +67,17 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
getBasicDetColsStructureList = genericResponseModel?.getBasicDetColsStructureList ?? [];
if (dynamicParams!.correctOrNew == 1) {
getBasicDetDffStructureList?.forEach((element) {
element.userBasicDetail = dynamicParams!.getEmployeeBasicDetailsList!.singleWhere((userDetail) => userDetail.aPPLICATIONCOLUMNNAME == element.aPPLICATIONCOLUMNNAME);
getBasicDetDffStructureList?.forEach((GetBasicDetDffStructureList element) {
element.userBasicDetail =
dynamicParams!.getEmployeeBasicDetailsList!.singleWhere((GetEmployeeBasicDetailsList userDetail) => userDetail.aPPLICATIONCOLUMNNAME == element.aPPLICATIONCOLUMNNAME);
});
getBasicDetColsStructureList?.forEach((element) {
element.userBasicDetail = dynamicParams!.getEmployeeBasicDetailsList!.singleWhere((userDetail) => userDetail.aPPLICATIONCOLUMNNAME == element.aPPLICATIONCOLUMNNAME);
getBasicDetColsStructureList?.forEach((GetBasicDetColsStructureList element) {
element.userBasicDetail =
dynamicParams!.getEmployeeBasicDetailsList!.singleWhere((GetEmployeeBasicDetailsList userDetail) => userDetail.aPPLICATIONCOLUMNNAME == element.aPPLICATIONCOLUMNNAME);
if (element.objectValuesList != null) {
ObjectValuesList dropDownListValue = element.objectValuesList!.singleWhere((ObjectValuesList dropdown) => dropdown.cODE == element.userBasicDetail!.vARCHAR2VALUE);
element.userBasicDetail!.sEGMENTVALUEDSP = dropDownListValue.mEANING;
}
});
} else {
getBasicDetDffStructureList?.forEach((element) {

@ -98,7 +98,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
recognizer: TapGestureRecognizer()
..onTap = () async {
relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt();
menuEntries.updateButton == 'Y'? showUpdateAlertDialog(context, relationId!.toInt(), 2, LocaleKeys.update.tr()):null;
menuEntries.updateButton == 'Y'? showUpdateAlertDialog(context, relationId!.toInt(), 2, "UPDATE"):null;
}
)
],
@ -161,7 +161,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
title: Text(
LocaleKeys.confirm.tr(),
),
content: Text(LocaleKeys.updateThisMember.tr()),
content: Text(LocaleKeys.updateMember.tr()),
actions: [
cancelButton,
continueButton,

@ -4,6 +4,8 @@ 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/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_phones_model.dart';
@ -26,6 +28,7 @@ class PhoneNumbers extends StatefulWidget {
class _PhoneNumbersState extends State<PhoneNumbers> {
List<GetPhoneNumberTypesModel> getPhoneNumberTypesList = [];
SubmitPhonesTransactionList submitPhoneNumbers = SubmitPhonesTransactionList();
@override
void initState() {
super.initState();
@ -46,129 +49,66 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
title: LocaleKeys.profile_contactDetails.tr(),
),
backgroundColor: MyColors.backgroundColor,
bottomSheet: footer(),
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(
LocaleKeys.addRow.tr(),
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: 15, bottom: 15),
// height: 400,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 26,
offset: Offset(0, 3),
),
],
color: Colors.white,
borderRadius: BorderRadius.circular(10.0),
),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
PopupMenuButton(
child: DynamicTextFieldWidget(
LocaleKeys.pleaseSelect.tr(),
e.pHONETYPEMEANING ?? "",
isEnable: false,
isPopup: true,
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < getPhoneNumberTypesList.length; i++) PopupMenuItem<int>(child: Text(getPhoneNumberTypesList![i].mEANING!), value: i),
],
onSelected: (int index) {
e.pHONETYPEMEANING = getPhoneNumberTypesList[index].mEANING;
e.pHONETYPE = getPhoneNumberTypesList[index].cODE;
setState(() {});
}),
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(
LocaleKeys.delete.tr(),
style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold),
)
]),
onTap: () {
// widget.getEmployeePhonesList.removeWhere((item) => item.pHONEID == e.pHONEID);
setState(() {
deleteRow(e);
});
},
),
SizedBox(
height: 10,
),
]))
: Container())
.toList()),
SizedBox(
height: 80,
)
],
),
),
);
}
Widget footer() {
return Container(
decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10),
color: MyColors.white,
boxShadow: [
BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3),
body: Column(
children: [
ListView(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
children: [
DefaultButton("+ ${LocaleKeys.addRow.tr()}", () {
widget.getEmployeePhonesList.add(GetEmployeePhonesList(aCTION: 'NEW_ROW'));
setState(() {});
}),
12.height,
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) {
var element = widget.getEmployeePhonesList[index];
return element.aCTION != 'DELETE_ROW'
? Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
PopupMenuButton(
child: DynamicTextFieldWidget(
LocaleKeys.selectTypeT.tr(),
element.pHONETYPEMEANING ?? LocaleKeys.pleaseSelect.tr(),
isEnable: false,
isPopup: true,
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < getPhoneNumberTypesList.length; i++) PopupMenuItem<int>(child: Text(getPhoneNumberTypesList![i].mEANING!), value: i),
],
onSelected: (int index) {
element.pHONETYPEMEANING = getPhoneNumberTypesList[index].mEANING;
element.pHONETYPE = getPhoneNumberTypesList[index].cODE;
setState(() {});
}),
DynamicTextFieldWidget(
"Value",
element.pHONENUMBER ?? "",
isReadOnly: false,
onChange: (text) {
element.pHONENUMBER = text;
},
).paddingOnly(bottom: 12),
Row(mainAxisAlignment: MainAxisAlignment.end, children: [
Icon(Icons.delete, color: MyColors.redColor, size: 18),
LocaleKeys.delete.tr().toText14(color: MyColors.redColor),
]).onPress(() {
element.aCTION = 'DELETE_ROW';
setState(() {});
}),
]).objectContainerView().paddingOnly(bottom: 12)
: Container();
},
separatorBuilder: (cxt, index) => 0.height,
itemCount: widget.getEmployeePhonesList.length)
],
).expanded,
DefaultButton(LocaleKeys.update.tr(), () async {
updatePhone();
}).insideContainer
],
),
child: DefaultButton(LocaleKeys.update.tr(), () async {
updatePhone();
// context.setLocale(const Locale("en", "US")); // to change Loacle
// Profile();
}).insideContainer,
);
}
@ -176,7 +116,6 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
Utils.showLoading(context);
setUpdateStatus();
submitPhoneNumbers = await ProfileApiClient().submitPhoneNumbers(widget.getEmployeePhonesList);
Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(LocaleKeys.profile_contactDetails.tr(), submitPhoneNumbers.pTRANSACTIONID!, submitPhoneNumbers.pITEMKEY!, 'phone_numbers'));
@ -191,14 +130,4 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
}
});
}
void addNewRow() {
setState(() {
widget.getEmployeePhonesList.add(GetEmployeePhonesList(aCTION: 'NEW_ROW'));
});
}
void deleteRow(GetEmployeePhonesList row) {
row.aCTION = 'DELETE_ROW';
}
}

@ -42,23 +42,23 @@ class ProfileInFo extends StatelessWidget {
appreciationTime(LocaleKeys.day.tr(), memberInfo.sERVICEDAYS.toString()),
]).paddingOnly(bottom: 12, top: 12),
const Divider(height: 8, thickness: 8, color: MyColors.lightGreyEFColor),
Column(
// mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(LocaleKeys.profile_profileCompletionPer.tr() + ' 75%').toText16(),
8.height,
Row(
children: [
for (var i = 0; i < 4; i++)
if (i < 3) Expanded(child: drawSlider(Color(0xff2BB8A6))) else Expanded(child: drawSlider(const Color(0xffefefef)))
],
),
14.height,
LocaleKeys.profile_completeProfile.tr().toText16(color: MyColors.textMixColor, isUnderLine: true),
],
).paddingOnly(left: 21, right: 21, bottom: 18, top: 12),
const Divider(height: 8, thickness: 8, color: MyColors.lightGreyEFColor),
// Column(
// // mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// (LocaleKeys.profile_profileCompletionPer.tr() + ' 75%').toText16(),
// 8.height,
// Row(
// children: [
// for (var i = 0; i < 4; i++)
// if (i < 3) Expanded(child: drawSlider(Color(0xff2BB8A6))) else Expanded(child: drawSlider(const Color(0xffefefef)))
// ],
// ),
// 14.height,
// LocaleKeys.profile_completeProfile.tr().toText16(color: MyColors.textMixColor, isUnderLine: true),
// ],
// ).paddingOnly(left: 21, right: 21, bottom: 18, top: 12),
// const Divider(height: 8, thickness: 8, color: MyColors.lightGreyEFColor),
ListView.separated(
padding: EdgeInsets.zero,
shrinkWrap: true,

@ -190,9 +190,10 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
6.width,
SimpleButton(LocaleKeys.add.tr(), () {
ImageOptions.showImageOptionsNew(context, (String image, File file) {
// setState(() {
// images.add(image);
// });
setState(() {
images.add(image);
Navigator.of(context).pop();
});
});
}, fontSize: 14),
],
@ -243,41 +244,43 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
Future<void> getAdDetails() async {
// todo need to change this method later , its not a good approach to do it like this.
String details = await Utils.getStringFromPrefs(SharedPrefsConsts.editItemForSale);
var body = json.decode(details);
if(details.isNotEmpty) {
var body = json.decode(details);
GetRegionsList selectedRegionAd = GetRegionsList();
GetRegionsList selectedRegionAd = GetRegionsList();
GetSaleCategoriesList selectedSaleCategoryAd = GetSaleCategoriesList();
GetSaleCategoriesList selectedSaleCategoryAd = GetSaleCategoriesList();
itemTitle = body["itemTitle"];
itemDescription = body["itemDescription"];
selectedItemCondition = body["itemCondition"].toString().toLowerCase();
selectedRegionAd.regionID = body["selectedRegion"]["regionID"];
selectedRegionAd.regionName = body["selectedRegion"]["regionName"];
selectedRegion = selectedRegionAd;
itemPrice = body["itemPrice"];
selectedSaleCategoryAd.categoryID = body["selectedSaleCategory"]["categoryID"];
selectedSaleCategoryAd.title = body["selectedSaleCategory"]["title"];
if (body["itemPhotos"].length != 0) {
images.add(body["itemPhotos"][0]);
}
ItemReviewModel itemReviewModel =
ItemReviewModel(body["itemTitle"], body["itemDescription"], body["itemCondition"].toString().toLowerCase(), selectedRegionAd, body["itemPrice"], images, selectedSaleCategoryAd);
itemTitle = body["itemTitle"];
itemDescription = body["itemDescription"];
selectedItemCondition = body["itemCondition"].toString().toLowerCase();
selectedRegionAd.regionID = body["selectedRegion"]["regionID"];
selectedRegionAd.regionName = body["selectedRegion"]["regionName"];
selectedRegion = selectedRegionAd;
itemPrice = body["itemPrice"];
selectedSaleCategoryAd.categoryID = body["selectedSaleCategory"]["categoryID"];
selectedSaleCategoryAd.title = body["selectedSaleCategory"]["title"];
if (body["itemPhotos"].length != 0) {
images.add(body["itemPhotos"][0]);
}
ItemReviewModel itemReviewModel =
ItemReviewModel(body["itemTitle"], body["itemDescription"], body["itemCondition"].toString().toLowerCase(), selectedRegionAd, body["itemPrice"], images, selectedSaleCategoryAd);
AddItemDetailsFragment.itemReviewModel = itemReviewModel;
SelectCategoryFragment.selectedSaleCategory = selectedSaleCategoryAd;
AddItemDetailsFragment.itemReviewModel = itemReviewModel;
SelectCategoryFragment.selectedSaleCategory = selectedSaleCategoryAd;
}
}
void getRegions() async {
try {
// try {
Utils.showLoading(context);
getRegionsList = await ItemsForSaleApiClient().getRegions();
await getAdDetails();
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
// } catch (ex) {
// Utils.hideLoading(context);
// Utils.handleException(ex, context, null);
// }
}
}

@ -25,6 +25,7 @@ class _ItemsForSaleFragmentState extends State<ItemsForSaleFragment> {
List<GetSaleCategoriesList> getSaleCategoriesList = [];
List<GetItemsForSaleList> getItemsForSaleList = [];
List<GetItemsForSaleList> _foundItemsForSaleList = [];
ScrollController gridScrollController = ScrollController();
int currentPageNo = 1;
@ -61,20 +62,10 @@ class _ItemsForSaleFragmentState extends State<ItemsForSaleFragment> {
isInputTypeNum: false,
isReadOnly: false,
onChange: (String value) {
// _runFilter(value);
_runFilter(value);
},
).paddingOnly(left: 21, right: 21, top: 21),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
LocaleKeys.browseCategories.tr().toText17(),
// todo @haroon define the purpose of this icon button
IconButton(
icon: const Icon(Icons.filter_alt_sharp, color: MyColors.darkIconColor, size: 28.0),
onPressed: () => Navigator.pop(context),
),
],
).paddingOnly(left: 21, right: 21),
LocaleKeys.browseCategories.tr().toText17().paddingOnly(left: 21, right: 21, top: 21),
SizedBox(
height: 105.0,
child: getSaleCategoriesList.isNotEmpty
@ -132,10 +123,22 @@ class _ItemsForSaleFragmentState extends State<ItemsForSaleFragment> {
);
}
void _runFilter(String enteredKeyword) {
List<GetItemsForSaleList> results = [];
if (enteredKeyword.isEmpty) {
results = getItemsForSaleList;
} else {
results = getItemsForSaleList.where((offer) => offer.title!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList();
}
setState(() {
_foundItemsForSaleList = results;
});
}
List<Widget> getItemsForSaleWidgets() {
List<Widget> itemsList = [];
getItemsForSaleList.forEach((element) {
_foundItemsForSaleList.forEach((element) {
itemsList.add(getItemCard(element));
});
@ -200,6 +203,7 @@ class _ItemsForSaleFragmentState extends State<ItemsForSaleFragment> {
getItemsForSaleListLocal.clear();
getItemsForSaleListLocal = await ItemsForSaleApiClient().getItemsForSale(itgPageNo, itgCategoryID);
getItemsForSaleList.addAll(getItemsForSaleListLocal);
_foundItemsForSaleList = getItemsForSaleList;
Utils.hideLoading(context);
setState(() {});
} catch (ex) {

@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:mohem_flutter_app/api/mowadhafhi/mowadhafhi_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
@ -53,44 +54,44 @@ class _MowadhafhiHomeState extends State<MowadhafhiHome> {
body: Column(
children: [
(getTicketsByEmployeeList == null
? const SizedBox()
: (getTicketsByEmployeeList!.isEmpty)
? Utils.getNoDataWidget(context)
: ListView.separated(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.pushNamed(context, AppRoutes.mowadhafhiDetails, arguments: getTicketsByEmployeeList![index].ticketId);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
getTicketsByEmployeeList![index].ticketTypeName!.toText14(color: MyColors.darkTextColor).expanded,
getTicketsByEmployeeList![index].created!.split(" ")[0].toText12(color: MyColors.grey70Color),
],
),
getTicketsByEmployeeList![index].description!.toText12(color: MyColors.grey57Color),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
getTicketsByEmployeeList![index].ticketStatusInternalName!.toText14(color: MyColors.textMixColor),
SvgPicture.asset(
"assets/images/arrow_next.svg",
color: MyColors.darkIconColor,
)
],
),
],
).objectContainerView(),
);
},
separatorBuilder: (BuildContext context, int index) => 12.height,
itemCount: getTicketsByEmployeeList!.length))
? const SizedBox()
: (getTicketsByEmployeeList!.isEmpty)
? Utils.getNoDataWidget(context)
: ListView.separated(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.pushNamed(context, AppRoutes.mowadhafhiDetails, arguments: getTicketsByEmployeeList![index].ticketId);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
getTicketsByEmployeeList![index].ticketTypeName!.toText14(color: MyColors.darkTextColor).expanded,
getTicketsByEmployeeList![index].created!.split(" ")[0].toText12(color: MyColors.grey70Color),
],
),
getTicketsByEmployeeList![index].description!.toText12(color: MyColors.grey57Color),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
getTicketsByEmployeeList![index].ticketStatusInternalName!.toText14(color: MyColors.textMixColor),
RotatedBox(
quarterTurns: AppState().isArabic(context) ? 2 : 4,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkIconColor),
),
],
),
],
).objectContainerView(),
);
},
separatorBuilder: (BuildContext context, int index) => 12.height,
itemCount: getTicketsByEmployeeList!.length))
.expanded,
DefaultButton(LocaleKeys.createRequest.tr(), () async {
await Navigator.pushNamed(context, AppRoutes.mowadhafhiHRRequest);

@ -25,6 +25,7 @@ class OffersAndDiscountsHome extends StatefulWidget {
class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
List<GetCategoriesList> getCategoriesList = [];
List<OffersListModel> getOffersList = [];
List<OffersListModel> _foundOffersList = [];
int currentCategoryID = 0;
@ -54,18 +55,10 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
isInputTypeNum: false,
isReadOnly: false,
onChange: (String value) {
// _runFilter(value);
_runFilter(value);
},
).paddingOnly(left: 21, right: 21, top: 21),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
LocaleKeys.browseCategories.tr().toText17(),
const Icon(Icons.filter_alt_sharp, color: MyColors.darkIconColor, size: 28.0).onPress(() {
Navigator.pop(context);
}),
],
).paddingOnly(left: 21, right: 21, top: 21),
LocaleKeys.browseCategories.tr().toText17().paddingOnly(left: 21, right: 21, top: 21),
SizedBox(
height: 110.0,
child: getCategoriesList.isNotEmpty
@ -81,6 +74,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
onTap: () {
setState(() {
currentCategoryID = getCategoriesList[index].id!;
getCategoryOffersListAPI();
// getItemsForSaleList.clear();
// currentPageNo = 1;
// getItemsForSale(currentPageNo, currentCategoryID);
@ -146,7 +140,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
List<Widget> getItemsForSaleWidgets() {
List<Widget> itemsList = [];
for (var element in getOffersList) {
for (var element in _foundOffersList) {
itemsList.add(getItemCard(element));
}
@ -213,6 +207,18 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
);
}
void _runFilter(String enteredKeyword) {
List<OffersListModel> results = [];
if (enteredKeyword.isEmpty) {
results = getOffersList;
} else {
results = getOffersList.where((offer) => offer.title!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList();
}
setState(() {
_foundOffersList = results;
});
}
void navigateToDetails(OffersListModel offersListModelObj) {
List<OffersListModel> getOffersDetailList = [];
getOffersDetailList.clear();
@ -258,6 +264,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
try {
Utils.showLoading(context);
getOffersList = await OffersAndDiscountsApiClient().getOffersList(currentCategoryID, 100);
_foundOffersList = getOffersList;
Utils.hideLoading(context);
setState(() {});
} catch (ex) {

@ -45,7 +45,8 @@ class _PendingTransactionsState extends State<PendingTransactions> {
),
body: Column(
children: [
Column(
ListView(
padding: const EdgeInsets.all(21),
children: [
PopupMenuButton(
child: DynamicTextFieldWidget(
@ -86,7 +87,7 @@ class _PendingTransactionsState extends State<PendingTransactions> {
},
)
],
).objectContainerView().expanded,
).expanded,
DefaultButton(
LocaleKeys.submit.tr(),
selectedFunction == null

@ -0,0 +1,625 @@
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/leave_balance_api_client.dart';
import 'package:mohem_flutter_app/api/my_attendance_api_client.dart';
import 'package:mohem_flutter_app/api/termination_dff_api_client.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/dyanmic_forms/get_set_values_request_model.dart';
import 'package:mohem_flutter_app/models/dyanmic_forms/validate_eit_transaction_model.dart';
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart' as dff;
import 'package:mohem_flutter_app/models/submit_term_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/termination/get_term_cols_structure_list_model.dart';
import 'package:mohem_flutter_app/models/termination/get_term_dff_structure_list_model.dart';
import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
class EndEmploymentScreen extends StatefulWidget {
EndEmploymentScreen({Key? key}) : super(key: key);
@override
_EndEmploymentScreenState createState() {
return _EndEmploymentScreenState();
}
}
class _EndEmploymentScreenState extends State<EndEmploymentScreen> {
List<GetTermColsStructureList>? termColsList;
List<GetTermDffStructureList>? termDffList;
DynamicListViewParams? dynamicParams;
@override
void initState() {
super.initState();
}
void getTerminationDffStructure() async {
try {
Utils.showLoading(context);
List results = await Future.wait([
TerminationDffApiClient().getTermColsStructure(),
TerminationDffApiClient().getTermDffStructure(dynamicParams!.dynamicId, null),
]);
termColsList = results[0];
termDffList = results[1];
termColsList = termColsList?.where((element) => element.dISPLAYFLAG == 'Y').toList() ?? [];
termDffList = termDffList?.where((element) => element.dISPLAYFLAG == 'Y').toList() ?? [];
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
void validateTransaction() {
String errorMessage = "";
for (var element in termColsList!) {
if (element.rEQUIREDFLAG == "Y") {
if (element.objectValuesList!.isEmpty) {
if ((element.selectedValue ?? "").isEmpty) {
errorMessage = element.sEGMENTPROMPT!;
break;
}
} else {
if (element.selectedObjectValue == null) {
errorMessage = element.sEGMENTPROMPT!;
break;
}
}
}
}
if (errorMessage.isEmpty) {
for (var element in termDffList!) {
if (element.rEQUIREDFLAG == "Y") {
if (element.eSERVICESDV?.pVALUECOLUMNNAME == null) {
errorMessage = element.sEGMENTPROMPT!;
break;
}
}
}
}
if (errorMessage.isNotEmpty) {
Utils.showToast(LocaleKeys.fieldIsEmpty.tr(namedArgs: {'data': errorMessage}));
} else {
submitTransaction();
}
}
void submitTransaction() async {
try {
Utils.showLoading(context);
List<Map<String, dynamic>> values = termDffList!.map((e) {
String tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? "";
if (e.fORMATTYPE == "X") {
// for date format type, date format is changed
tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? "";
if (tempVar.isNotEmpty) {
if (!tempVar.contains("/")) {
DateTime date = DateFormat('yyyy-MM-dd').parse(tempVar);
tempVar = DateFormat('yyyy/MM/dd HH:mm:ss').format(date);
}
}
}
return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: tempVar.toString()).toJson();
}).toList();
termColsList!.forEach((element) {
String? value = "";
ValidateEitTransactionModel model = ValidateEitTransactionModel(nAME: element.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1);
if (element.dATATYPE == "DATE") {
value = element.selectedValue == null ? null : Utils.formatDate(DateTime.parse(element.selectedValue!).toString());
model.dATEVALUE = value;
} else if (element.dATATYPE == "VARCHAR2") {
if (element.objectValuesList!.isEmpty) {
value = element.selectedValue;
} else {
value = element.selectedObjectValue?.cODE;
}
model.vARCHAR2VALUE = value;
}
values.add(model.toJson());
});
SubmitTermTransactionList submitTermTransaction = await TerminationDffApiClient().submitTermTransaction(dynamicParams!.dynamicId, values);
Utils.hideLoading(context);
await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitTermTransaction.pTRANSACTIONID!, submitTermTransaction.pITEMKEY!, "endEmployment"));
Utils.showLoading(context);
await LeaveBalanceApiClient().cancelHrTransaction(submitTermTransaction.pTRANSACTIONID!);
Utils.hideLoading(context);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
@override
void dispose() {
super.dispose();
}
String dESCFLEXCONTEXTCODE = "";
String descFlexConTextTitle = "";
Future calGetValueSetValues(GetTermDffStructureList structureList) async {
try {
Utils.showLoading(context);
String segmentId = structureList.cHILDSEGMENTSVS!;
if (dESCFLEXCONTEXTCODE.isEmpty) dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!;
List<GetTermDffStructureList> filteredList = termDffList?.where((element) => element.cHILDSEGMENTSVS == segmentId).toList() ?? [];
List<Map<String, dynamic>> values = filteredList
.map((e) => GetSetValuesRequestModel(
sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME)
.toJson())
.toList();
List<dff.ESERVICESVS> eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
List<GetTermDffStructureList> abc = termDffList ?? [];
termDffList = abc;
int index = termDffList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS);
termDffList![index].eSERVICESVS!.clear();
if (eServicesResponseModel.isNotEmpty) termDffList![index].eSERVICESVS!.addAll(eServicesResponseModel);
// getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? [];
//getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList();
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
@override
Widget build(BuildContext context) {
if (dynamicParams == null) {
dynamicParams = ModalRoute.of(context)!.settings.arguments as DynamicListViewParams;
getTerminationDffStructure();
}
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(context, title: dynamicParams!.title),
body: Column(
children: [
(termColsList == null && termDffList == null
? const SizedBox()
: (((termColsList?.length ?? 0) + (termDffList?.length ?? 0)) < 1
? Utils.getNoDataWidget(context)
: ListView(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
children: [
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, int index) => termColWidget(termColsList![index]),
separatorBuilder: (cxt, index) => 12.height,
itemCount: termColsList!.length,
),
12.height,
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, int index) => dffColWidget(termDffList![index], index),
separatorBuilder: (cxt, index) => 12.height,
itemCount: termDffList!.length,
),
],
)))
.expanded,
DefaultButton(
LocaleKeys.next.tr(),
(((termColsList?.length ?? 0) + (termDffList?.length ?? 0)) < 1)
? null
: () {
validateTransaction();
},
).insideContainer,
],
),
);
}
Widget termColWidget(GetTermColsStructureList termColObject) {
if (termColObject.dATATYPE == "VARCHAR2") {
if (termColObject.objectValuesList!.isEmpty) {
return DynamicTextFieldWidget(
(termColObject.sEGMENTPROMPT ?? "") + (termColObject.rEQUIREDFLAG == "Y" ? "*" : ""),
termColObject.selectedValue ?? "",
onChange: (text) {
termColObject.selectedValue = text;
},
);
}
return PopupMenuButton(
child: DynamicTextFieldWidget(
(termColObject.sEGMENTPROMPT ?? "") + (termColObject.rEQUIREDFLAG == "Y" ? "*" : ""),
termColObject.selectedObjectValue?.mEANING ?? LocaleKeys.pleaseSelect.tr(),
isEnable: false,
isPopup: true,
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < termColObject.objectValuesList!.length; i++) PopupMenuItem<int>(value: i, child: Text(termColObject.objectValuesList![i].mEANING ?? "")),
],
onSelected: (int popipIndex) async {
termColObject.selectedObjectValue = termColObject.objectValuesList![popipIndex];
print(termColObject.selectedObjectValue?.toJson());
setState(() {});
});
}
if (termColObject.dATATYPE == "DATE") {
return DynamicTextFieldWidget(
(termColObject.sEGMENTPROMPT ?? "") + (termColObject.rEQUIREDFLAG == "Y" ? "*" : ""),
(termColObject.selectedValue != null) ? Utils.getMonthNamedFormat(DateTime.parse(termColObject.selectedValue!)) : LocaleKeys.pleaseSelectDate.tr(),
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
DateTime? selectedDate;
if (termColObject.selectedValue == null) {
selectedDate = DateTime.now();
} else {
selectedDate = DateTime.parse(termColObject.selectedValue!);
}
DateTime date = await Utils.selectDate(context, selectedDate);
termColObject.selectedValue = date.toString();
setState(() {});
},
);
}
return const SizedBox();
}
Widget dffColWidget(GetTermDffStructureList model, int index) {
if (model.dISPLAYFLAG != "N") {
if (model.vALIDATIONTYPE == "N") {
if (model.fORMATTYPE == "C") {
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y",
onChange: (text) {
model.eSERVICESDV ??= ESERVICESDV();
model.eSERVICESDV!.pIDCOLUMNNAME = text;
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "N") {
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y",
isInputTypeNum: true,
onChange: (text) {
model.eSERVICESDV ??= ESERVICESDV();
model.eSERVICESDV!.pIDCOLUMNNAME = text;
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "X") {
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? ("");
if (termDffList![index].isDefaultTypeIsCDPS) {
if (displayText.contains(" 00:00:00")) {
displayText = displayText.replaceAll(" 00:00:00", "");
}
if (displayText.contains("/")) {
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
}
}
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
displayText,
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
if ((termDffList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (termDffList![index].isDefaultTypeIsCDPS) {
selectedDate = DateFormat("yyyy/MM/dd").parse(termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else {
selectedDate = DateTime.parse(termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
}
DateTime date = await _selectDate(context);
String dateString = date.toString().split(' ').first;
// DateTime date1 = DateTime(date.year, date.month, date.day);
// getEitDffStructureList![index].fieldAnswer = date.toString();
ESERVICESDV eservicesdv;
if (termDffList![index].isDefaultTypeIsCDPS) {
eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: Utils.formatDate(dateString),
pRETURNMSG: "null",
pRETURNSTATUS: termDffList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: termDffList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
} else {
eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: dateString,
pRETURNMSG: "null",
pRETURNSTATUS: termDffList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: termDffList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
}
termDffList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
await calGetValueSetValues(model);
}
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "Y") {
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? "";
// if (termDffList![index].isDefaultTypeIsCDPS) {
// displayText = Utils.reverseFormatDate(displayText);
// // if (displayText.contains(" 00:00:00")) {
// // displayText = displayText.replaceAll(" 00:00:00", "");
// // }
// // if (!displayText.contains("-")) {
// // displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
// // }
// }
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
displayText,
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
if ((termDffList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (termDffList![index].isDefaultTypeIsCDPS) {
String tempDate = termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!;
if (tempDate.contains("00:00:00")) {
tempDate = tempDate.replaceAll("00:00:00", '').trim();
}
if (tempDate.contains("/")) {
selectedDate = DateFormat("yyyy/MM/dd").parse(tempDate);
} else {
selectedDate = DateFormat("yyyy-MM-dd").parse(tempDate);
}
} else {
selectedDate = DateTime.parse(termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
}
DateTime date = await _selectDate(context);
String dateString = date.toString().split(' ').first;
// getEitDffStructureList![index].fieldAnswer = date.toString();
ESERVICESDV eservicesdv;
if (termDffList![index].isDefaultTypeIsCDPS) {
eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: Utils.formatDate(dateString),
pRETURNMSG: "null",
pRETURNSTATUS: termDffList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: termDffList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
} else {
eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: dateString,
pRETURNMSG: "null",
pRETURNSTATUS: termDffList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: termDffList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
}
termDffList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
await calGetValueSetValues(model);
}
},
).paddingOnly(bottom: 12);
}
} else {
return PopupMenuButton(
child: DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pVALUECOLUMNNAME ?? LocaleKeys.pleaseSelect.tr(),
isEnable: false,
isPopup: true,
isInputTypeNum: true,
isReadOnly: model.rEADONLY == "Y",
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
if (model.rEADONLY != "Y")
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i),
],
onSelected: (int popipIndex) async {
ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME,
pRETURNMSG: "null",
pRETURNSTATUS: "null", //getEitDffStructureList![popipIndex].dEFAULTVALUE,
pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME);
termDffList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
await calGetValueSetValues(model);
}
});
}
} else {
return const SizedBox();
}
if (model.fORMATTYPE == "N") {
if (model.eSERVICESVS?.isNotEmpty ?? false) {
return PopupMenuButton(
child: DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pVALUECOLUMNNAME ?? "",
isEnable: false,
isPopup: true,
isInputTypeNum: true,
isReadOnly: model.rEADONLY == "Y",
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
if (model.rEADONLY != "Y")
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(value: i, child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!)),
],
onSelected: (int popipIndex) async {
ESERVICESDV eservicesdv =
ESERVICESDV(pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME, pRETURNMSG: "null", pRETURNSTATUS: "null", pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME);
termDffList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
await calGetValueSetValues(model);
}
});
}
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y",
onChange: (text) {
//model.fieldAnswer = text;
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "X" || model.fORMATTYPE == "Y") {
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? "";
if (termDffList![index].isDefaultTypeIsCDPS) {
if (displayText.contains(" 00:00:00")) {
displayText = displayText.replaceAll(" 00:00:00", "");
}
if (!displayText.contains("-")) {
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
}
}
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
displayText,
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
if ((termDffList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (termDffList![index].isDefaultTypeIsCDPS) {
selectedDate = DateFormat("yyyy/MM/dd").parse(termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else {
selectedDate = DateTime.parse(termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
}
DateTime date = await _selectDate(context);
String dateString = date.toString().split(' ').first;
// termDffList![index].fieldAnswer = date.toString();
ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: dateString,
pRETURNMSG: "null",
pRETURNSTATUS: termDffList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: termDffList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
termDffList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
await calGetValueSetValues(model);
}
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "I") {
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
suffixIconData: Icons.access_time_filled_rounded,
isEnable: false,
onTap: () async {
if ((termDffList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
var timeString = termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!.split(":");
selectedDate = DateTime(0, 0, 0, int.parse(timeString[0]), int.parse(timeString[1]));
//DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
TimeOfDay _time = await _selectTime(context);
DateTime tempTime = DateTime(0, 1, 1, _time.hour, _time.minute);
String time = DateFormat('HH:mm').format(tempTime).trim();
// DateTime date1 = DateTime(date.year, date.month, date.day);
// getEitDffStructureList![index].fieldAnswer = date.toString();
ESERVICESDV eservicesdv = ESERVICESDV(pIDCOLUMNNAME: time, pRETURNMSG: "null", pRETURNSTATUS: termDffList![index].dEFAULTVALUE, pVALUECOLUMNNAME: time);
termDffList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
await calGetValueSetValues(model);
}
},
).paddingOnly(bottom: 12);
}
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [],
).objectContainerView();
}
DateTime selectedDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day);
Future<DateTime> _selectDate(BuildContext context) async {
DateTime time = selectedDate;
if (Platform.isIOS) {
await showCupertinoModalPopup(
context: context,
builder: (cxt) => Container(
height: 250,
color: Colors.white,
child: CupertinoDatePicker(
backgroundColor: Colors.white,
mode: CupertinoDatePickerMode.date,
onDateTimeChanged: (value) {
if (value != null && value != selectedDate) {
time = value;
}
},
initialDateTime: selectedDate,
),
),
);
} else {
DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101));
if (picked != null && picked != selectedDate) {
time = picked;
}
}
time = DateTime(time.year, time.month, time.day);
return time;
}
Future<TimeOfDay> _selectTime(BuildContext context) async {
TimeOfDay time = TimeOfDay(hour: selectedDate.hour, minute: selectedDate.minute);
if (Platform.isIOS) {
await showCupertinoModalPopup(
context: context,
builder: (cxt) => Container(
height: 250,
color: Colors.white,
child: CupertinoDatePicker(
backgroundColor: Colors.white,
mode: CupertinoDatePickerMode.time,
use24hFormat: true,
onDateTimeChanged: (value) {
if (value != null && value != selectedDate) {
time = TimeOfDay(hour: value.hour, minute: value.minute);
}
},
initialDateTime: selectedDate,
),
),
);
} else {
TimeOfDay? picked = await showTimePicker(
context: context,
initialTime: time,
builder: (cxt, child) {
return MediaQuery(data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: child ?? Container());
});
if (picked != null && picked != time) {
time = picked;
}
// final DateTime? picked =
// await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101));
// if (picked != null && picked != selectedDate) {
// time = picked;
// }
}
return time;
}
}

@ -11,8 +11,6 @@ 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/generic_response_model.dart';
import 'package:mohem_flutter_app/models/get_notification_buttons_list_model.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/allowed_actions_model.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/itg_request_model.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/request_detail_model.dart';
@ -20,7 +18,7 @@ import 'package:mohem_flutter_app/ui/work_list/itg_fragments/approval_level_frag
import 'package:mohem_flutter_app/ui/work_list/itg_fragments/request_detail_fragment.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/dialogs/accept_reject_input_dialog.dart';
import 'package:mohem_flutter_app/widgets/dialogs/itg_comments_dialog.dart';
class ItgDetailScreen extends StatefulWidget {
ItgDetailScreen({Key? key}) : super(key: key);
@ -58,12 +56,11 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
void getItgData() async {
try {
Utils.showLoading(context);
itgRequest = await WorkListApiClient().getITGFormDetails(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, "");
itgRequest = await WorkListApiClient().getITGFormDetails(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "");
allowedActionList = itgRequest?.allowedActions ?? [];
if (allowedActionList.isNotEmpty) {
isCloseAvailable = allowedActionList.any((element) => element.action == "CLOSE");
isApproveAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Approve");
// isAnswerAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Answer");
isRejectAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Reject");
}
Utils.hideLoading(context);
@ -341,34 +338,39 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
void performAction(String actionMode) {
showDialog(
context: context,
builder: (cxt) => AcceptRejectInputDialog(
message: LocaleKeys.requestedItems.tr(),
// notificationGetRespond: notificationNoteInput,
builder: (cxt) => ITGCommentsDialog(
message: LocaleKeys.writeComment.tr(),
onTap: (note) {
Map<String, dynamic> payload = {
"P_ACTION_MODE": actionMode,
"P_APPROVER_INDEX": null,
"P_COMMENTS": "",
"P_FORWARD_TO_USER_NAME": "",
// "P_NOTIFICATION_ID": workListData!.nOTIFICATIONID!,
"RespondAttributeList": [
// if (notificationNoteInput != null) {notificationNoteInput!.attributeName: note}
],
};
performNotificationAction(payload);
if (actionMode == "APPROVED") {
performApproveAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note);
} else {
performRejectAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note);
}
},
),
);
}
void performNotificationAction(Map<String, dynamic> payload) async {
void performRejectAction(String requestType, int taskId, int itemId, String employeeNumber, String comments) async {
try {
Utils.showLoading(context);
ITGRequest? itgRequest = await WorkListApiClient().rejectITGRequest(requestType, taskId, itemId, employeeNumber, comments);
Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
Navigator.pop(context, "delegate_reload");
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
void performApproveAction(String requestType, int taskId, int itemId, String employeeNumber, String comments) async {
try {
Utils.showLoading(context);
GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload);
ITGRequest? itgRequest = await WorkListApiClient().approveITGRequest(requestType, taskId, itemId, employeeNumber, comments);
Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
Navigator.pop(context, true);
Navigator.pop(context, "delegate_reload");
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);

@ -11,9 +11,13 @@ class RequestDetailFragment extends StatelessWidget {
List<Fields> fields;
RequestDetailFragment({Key? key, this.fields = const <Fields>[]}) : super(key: key);
double itemHeight = 0;
double itemWidth = 0;
@override
Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
itemHeight = (size.height - kToolbarHeight - 24) / 9;
itemWidth = size.width / 2;
List<Widget> uiList = [detailView()];
return Container(
width: double.infinity,
@ -28,6 +32,43 @@ class RequestDetailFragment extends StatelessWidget {
}
Widget detailView() {
bool isOdd = false;
if (fields.length % 2 != 0) {
isOdd = true;
fields.add(new Fields());
}
return GridView.builder(
itemCount: fields.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (fields[index].value == null) {
return ItemDetailViewGridItem(
index,
fields[index].title, fields[index].multipleValue?.join(", ") ?? "",
isNeedToShowEmptyDivider: (fields.length == index + 1)
? isOdd
? true
: false
: false,
);
}
return ItemDetailViewGridItem(
index,
fields[index].title,
fields[index].value ?? "",
isNeedToShowEmptyDivider: (fields.length == index + 1)
? isOdd
? true
: false
: false,
);
},
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight),
),
).objectContainerView();
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),

@ -19,6 +19,7 @@ import 'package:mohem_flutter_app/models/worklist_response_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
class WorkListScreen extends StatefulWidget {
WorkListScreen({Key? key}) : super(key: key);
@ -32,19 +33,70 @@ class WorkListScreen extends StatefulWidget {
class _WorkListScreenState extends State<WorkListScreen> {
List<WorkListItemTypeModelData> workListItemTypes = [
WorkListItemTypeModelData(
value: 0, name: 'HR', fullName: LocaleKeys.humanResource.tr(), active: false, color: [Color(0xff32D892), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'HRSSA', disable: false),
value: 0,
name: 'HR',
fullName: LocaleKeys.humanResource.tr(),
active: false,
color: [Color(0xff32D892), Color(0xff1AB170)],
icon: "assets/images/miss_swipe.svg",
key: 'HRSSA',
disable: false),
WorkListItemTypeModelData(
value: 0, name: 'MO', fullName: LocaleKeys.moveOrder.tr(), active: false, color: [Color(0xff58DCFA), Color(0xff3CB9D5)], icon: "assets/images/miss_swipe.svg", key: 'INVMOA', disable: false),
value: 0, name: 'MR', fullName: LocaleKeys.moveOrder.tr(), active: false, color: [Color(0xff58DCFA), Color(0xff3CB9D5)], icon: "assets/images/miss_swipe.svg", key: 'INVMOA', disable: false),
WorkListItemTypeModelData(
value: 0, name: 'PR', fullName: LocaleKeys.purchaseRequisition.tr(), active: false, color: [Color(0xff48EACF), Color(0xff3DCAB3)], icon: "assets/images/miss_swipe.svg", key: 'REQAPPRV', disable: false),
value: 0,
name: 'PR',
fullName: LocaleKeys.purchaseRequisition.tr(),
active: false,
color: [Color(0xff48EACF), Color(0xff3DCAB3)],
icon: "assets/images/miss_swipe.svg",
key: 'REQAPPRV',
disable: false),
WorkListItemTypeModelData(
value: 0, name: 'PO', fullName: LocaleKeys.purchaseOrder.tr(), active: false, color: [Color(0xff5099E3), Color(0xff3670AA)], icon: "assets/images/miss_swipe.svg", key: 'POAPPRV', disable: false),
value: 0,
name: 'PO',
fullName: LocaleKeys.purchaseOrder.tr(),
active: false,
color: [Color(0xff5099E3), Color(0xff3670AA)],
icon: "assets/images/miss_swipe.svg",
key: 'POAPPRV',
disable: false),
WorkListItemTypeModelData(
value: 0, name: 'ITG', fullName: LocaleKeys.ITGForms.tr(), active: false, color: [Color(0xffEB8C90), Color(0xffDE6C70)], icon: "assets/images/miss_swipe.svg", key: 'ITG', disable: false),
value: 0,
name: 'ITG',
fullName: LocaleKeys.ITGForms.tr(),
active: false,
color: [Color(0xffEB8C90), Color(0xffDE6C70)],
icon: "assets/images/miss_swipe.svg",
key: 'ITG',
disable: false),
WorkListItemTypeModelData(
value: 0, name: 'IC', fullName: LocaleKeys.itemCreation.tr(), active: false, color: [Color(0xff32D892), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'INVITEM', disable: false),
value: 0,
name: 'IC',
fullName: LocaleKeys.itemCreation.tr(),
active: false,
color: [Color(0xff32D892), Color(0xff1AB170)],
icon: "assets/images/miss_swipe.svg",
key: 'INVITEM',
disable: false),
WorkListItemTypeModelData(
value: 0, name: 'STAMP', fullName: LocaleKeys.stamp.tr(), active: false, color: [Color(0xff32D892), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'STAMP', disable: false),
value: 0,
name: 'STAMP',
fullName: LocaleKeys.stamp.tr(),
active: false,
color: [Color(0xff32D892), Color(0xff1AB170)],
icon: "assets/images/miss_swipe.svg",
key: 'STAMP',
disable: false),
WorkListItemTypeModelData(
value: 0,
name: 'COC',
fullName: LocaleKeys.itemCreation.tr(),
active: false,
color: [Color(0xff787299), Color(0xff1AB170)],
icon: "assets/images/miss_swipe.svg",
key: 'COC',
disable: true)
];
int workListItemIndex = 0;
@ -54,6 +106,8 @@ class _WorkListScreenState extends State<WorkListScreen> {
late DashboardProviderModel providerData;
final RefreshController _refreshController = RefreshController(initialRefresh: false);
@override
void initState() {
super.initState();
@ -67,8 +121,13 @@ class _WorkListScreenState extends State<WorkListScreen> {
workListItemTypes.forEach((workListElement) {
if (workListElement.key == "ITG") {
workListElement.value = providerData.itgFormsModel?.totalCount ?? 0;
} else if (workListElement.key == "COC") {
workListElement.value = providerData.cocFinalCount;
} else {
var tempList = providerData.getOpenNotificationsList?.where((notificationElement) => notificationElement.itemType == workListElement.key).toList();
var tempList = providerData.getOpenNotificationsList
?.where((notificationElement) =>
notificationElement.itemType == workListElement.key)
.toList();
if (tempList!.isNotEmpty) {
workListElement.value = tempList.first.openNtfNumber ?? 0;
}
@ -87,18 +146,26 @@ class _WorkListScreenState extends State<WorkListScreen> {
List<RequestDetails> requestAllList = [];
for (int i = 0; i < (itgFormsModel?.requestType!.length ?? 0); i++) {
itgFormsModel?.requestType![i].requestDetails?.forEach((element) {
element.requestType = itgFormsModel?.requestType![i].requestTypeCode;
element.requestType =
itgFormsModel?.requestType![i].requestTypeCode;
});
requestAllList = requestAllList + (itgFormsModel?.requestType![i].requestDetails ?? []);
requestAllList = requestAllList +
(itgFormsModel?.requestType![i].requestDetails ?? []);
}
AppState().setRequestAllList = requestAllList;
itgFormsModel?.requestType!.insert(0, RequestType(requestDetails: requestAllList, requestTypeCode: "all", requestTypeName: "All"));
itgFormsModel?.requestType!.insert(
0,
RequestType(
requestDetails: requestAllList,
requestTypeCode: "all",
requestTypeName: "All"));
if ((itgFormsModel?.requestType?.length ?? 0) > 0) {
itgRequestTypeIndex = 0;
}
} else {
itgRequestTypeIndex = null;
workList = await WorkListApiClient().getWorkList(pageNumber, workListItemTypes[workListItemIndex].key);
workList = await WorkListApiClient()
.getWorkList(pageNumber, workListItemTypes[workListItemIndex].key);
AppState().setWorkList = workList;
}
Utils.hideLoading(context);
@ -109,6 +176,11 @@ class _WorkListScreenState extends State<WorkListScreen> {
}
}
void _onRefresh() async {
getWorkList();
_refreshController.refreshCompleted();
}
@override
void dispose() {
super.dispose();
@ -129,26 +201,33 @@ class _WorkListScreenState extends State<WorkListScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
height: 1,
color: MyColors.lightGreyEFColor,
),
Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor),
SizedBox(
height: 40,
child: ListView.separated(
itemBuilder: (context, index) {
return Container(
padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8),
padding: const EdgeInsets.only(
left: 21, right: 21, top: 8, bottom: 8),
alignment: Alignment.center,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(6), color: workListItemIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor),
child: ("${workListItemTypes[index].name} ${workListItemTypes[index].value > 0 ? "(${workListItemTypes[index].value})" : ""}")
.toText12(color: workListItemIndex == index ? MyColors.white : MyColors.black),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: workListItemIndex == index
? MyColors.darkIconColor
: MyColors.lightGreyEAColor),
child:
("${workListItemTypes[index].name} ${workListItemTypes[index].value > 0 ? "(${workListItemTypes[index].value})" : ""}")
.toText12(
color: workListItemIndex == index
? MyColors.white
: MyColors.black),
).onPress(() {
if (workListItemIndex != index) {
if (workListItemIndex != index &&
!workListItemTypes[index].disable) {
workListItemIndex = index;
if (workListItemTypes[index].value == 0) {
workList = [];
itgRequestTypeIndex = null;
} else {
workList = null;
}
@ -167,71 +246,87 @@ class _WorkListScreenState extends State<WorkListScreen> {
),
).paddingOnly(top: 21, bottom: 21),
workListItemTypes[workListItemIndex].fullName.toSectionHeading().paddingOnly(left: 21, right: 21),
if (itgRequestTypeIndex != null)
SizedBox(
height: 40,
child: ListView.separated(
itemBuilder: (context, index) {
RequestType type = itgFormsModel!.requestType![index];
return Container(
padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8),
alignment: Alignment.center,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(30), color: itgRequestTypeIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor),
child: ("${type.requestTypeName}").toText12(color: itgRequestTypeIndex == index ? MyColors.white : MyColors.black),
).onPress(() {
if (itgRequestTypeIndex != index) {
itgRequestTypeIndex = index;
setState(() {});
}
});
},
separatorBuilder: (context, index) => 8.width,
shrinkWrap: true,
itemCount: itgFormsModel?.requestType?.length ?? 0,
scrollDirection: Axis.horizontal,
padding: const EdgeInsets.only(left: 21, right: 21),
SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: const MaterialClassicHeader(
color: MyColors.gradiantEndColor,
),
).paddingOnly(top: 16, bottom: 16),
itgRequestTypeIndex != null
? Expanded(
child: ListView.separated(
physics: BouncingScrollPhysics(),
itemBuilder: (context, index) {
return itgRowItem(workListItemTypes[workListItemIndex], itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails![index], index);
},
separatorBuilder: (context, index) => 12.height,
itemCount: itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails?.length ?? 0,
padding: const EdgeInsets.all(21),
),
)
: Expanded(
child: workList != null
? ((workList!).isEmpty
? LocaleKeys.noHistoryAvailable.tr().toText16().center
: ListView.separated(
physics: const BouncingScrollPhysics(),
controller: _refreshController,
onRefresh: _onRefresh,
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: itgRequestTypeIndex != null
? Column(
children: [
SizedBox(
height: 40,
child: ListView.separated(
itemBuilder: (context, index) {
return rowItem(workListItemTypes[workListItemIndex], workList![index], index);
RequestType type = itgFormsModel!.requestType![index];
return Container(
padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8),
alignment: Alignment.center,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(30), color: itgRequestTypeIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor),
child: ("${type.requestTypeName}").toText12(color: itgRequestTypeIndex == index ? MyColors.white : MyColors.black),
).onPress(() {
if (itgRequestTypeIndex != index) {
itgRequestTypeIndex = index;
setState(() {});
}
});
},
separatorBuilder: (context, index) => 12.height,
itemCount: workList?.length ?? 0,
padding: const EdgeInsets.all(21),
))
: const SizedBox(),
),
separatorBuilder: (context, index) => 8.width,
shrinkWrap: true,
itemCount: itgFormsModel?.requestType?.length ?? 0,
scrollDirection: Axis.horizontal,
padding: const EdgeInsets.only(left: 21, right: 21),
),
).paddingOnly(top: 16, bottom: 16),
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return itgRowItem(workListItemTypes[workListItemIndex], itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails![index], index);
},
separatorBuilder: (context, index) => 12.height,
itemCount: itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails?.length ?? 0,
padding: const EdgeInsets.all(21),
),
],
)
: workList != null
? ((workList!).isEmpty
? Utils.getNoDataWidget(context).paddingOnly(top: 100)
: ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return rowItem(workListItemTypes[workListItemIndex], workList![index], index);
},
separatorBuilder: (context, index) => 12.height,
itemCount: workList?.length ?? 0,
padding: const EdgeInsets.all(21),
))
: const SizedBox(),
)).expanded,
],
),
),
);
}
Widget itgRowItem(WorkListItemTypeModelData data, RequestDetails requestDetails, int index) {
Widget itgRowItem(WorkListItemTypeModelData data,
RequestDetails requestDetails, int index) {
return InkWell(
onTap: () async {
AppState().setItgWorkListIndex = index;
var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.itgDetail);
var shouldReloadData =
await Navigator.pushNamed(context, AppRoutes.itgDetail);
if (shouldReloadData != null) {
if (shouldReloadData.toString() == "delegate_reload") {
providerData.itgFormsModel!.totalCount =
providerData.itgFormsModel!.totalCount! - 1;
calculateCounter();
getWorkList();
}
@ -255,7 +350,8 @@ class _WorkListScreenState extends State<WorkListScreen> {
},
child: Container(
width: double.infinity,
padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10),
padding:
const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
@ -274,11 +370,20 @@ class _WorkListScreenState extends State<WorkListScreen> {
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
gradient: LinearGradient(transform: GradientRotation(.218), begin: Alignment.topRight, end: Alignment.bottomRight, colors: data.color),
gradient: LinearGradient(
transform: GradientRotation(.218),
begin: Alignment.topRight,
end: Alignment.bottomRight,
colors: data.color),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [SvgPicture.asset("assets/images/miss_swipe.svg", width: 20, height: 20, color: Colors.white), 2.height, data.name.toText10(color: Colors.white)],
children: [
SvgPicture.asset("assets/images/miss_swipe.svg",
width: 20, height: 20, color: Colors.white),
2.height,
data.name.toText10(color: Colors.white)
],
).paddingAll(6),
),
8.width,
@ -292,10 +397,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
Row(
children: [
DateUtil.formatDateToDate(DateUtil.convertStringToDate(requestDetails.modifiedDate!), false).toText10(color: MyColors.lightTextColor).expanded,
SvgPicture.asset(
"assets/images/arrow_next.svg",
color: MyColors.darkIconColor,
)
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkIconColor)),
],
),
],
@ -307,12 +409,15 @@ class _WorkListScreenState extends State<WorkListScreen> {
);
}
Widget rowItem(WorkListItemTypeModelData data, WorkListResponseModel workData, int index) {
Widget rowItem(WorkListItemTypeModelData data, WorkListResponseModel workData,
int index) {
return InkWell(
onTap: () async {
AppState().setWorkListIndex = index;
var data = workList![index];
var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.workListDetail, arguments: workData);
var shouldReloadData = await Navigator.pushNamed(
context, AppRoutes.workListDetail,
arguments: workData);
if (shouldReloadData != null) {
if (shouldReloadData.toString() == "delegate_reload") {
calculateCounter();
@ -337,7 +442,8 @@ class _WorkListScreenState extends State<WorkListScreen> {
},
child: Container(
width: double.infinity,
padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10),
padding:
const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
@ -356,11 +462,20 @@ class _WorkListScreenState extends State<WorkListScreen> {
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
gradient: LinearGradient(transform: GradientRotation(.218), begin: Alignment.topRight, end: Alignment.bottomRight, colors: data.color),
gradient: LinearGradient(
transform: GradientRotation(.218),
begin: Alignment.topRight,
end: Alignment.bottomRight,
colors: data.color),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [SvgPicture.asset("assets/images/miss_swipe.svg", width: 20, height: 20, color: Colors.white), 2.height, data.name.toText10(color: Colors.white)],
children: [
SvgPicture.asset("assets/images/miss_swipe.svg",
width: 20, height: 20, color: Colors.white),
2.height,
data.name.toText10(color: Colors.white)
],
).paddingAll(6),
),
8.width,
@ -374,10 +489,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
Row(
children: [
DateUtil.formatDateToDate(DateUtil.convertSimpleStringDateToDate(workData.bEGINDATE!), false).toText10(color: MyColors.lightTextColor).expanded,
SvgPicture.asset(
"assets/images/arrow_next.svg",
color: MyColors.darkIconColor,
)
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkIconColor)),
],
),
],

@ -209,6 +209,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
workListData: workListData,
itemCreationHeader: getItemCreationNtfBody?.itemCreationHeader ?? [],
getStampMsNotifications: getStampMsNotifications,
getStampNsNotifications: getStampNsNotifications,
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList,
getPhonesNotificationBodyList: getPhonesNotificationBodyList,
getBasicDetNtfBodyList: getBasicDetNtfBodyList,
@ -222,8 +223,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
poLinesList: getPoNotificationBody?.pOLines ?? [],
itemCreationLines: getItemCreationNtfBody?.itemCreationLines ?? [],
),
ActionsFragment(workListData!.nOTIFICATIONID, actionHistoryList),
AttachmentsFragment(getAttachmentList),
actionHistoryList.isEmpty ? Utils.getNoDataWidget(context) : ActionsFragment(workListData!.nOTIFICATIONID, actionHistoryList),
getAttachmentList.isEmpty ? Utils.getNoDataWidget(context) : AttachmentsFragment(getAttachmentList),
],
).expanded,
if (isApproveAvailable || isRejectAvailable || isCloseAvailable)
@ -232,10 +233,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
decoration: const BoxDecoration(
color: Colors.white,
border: Border(
top: BorderSide(
color: MyColors.lightGreyEFColor,
width: 1.0,
),
top: BorderSide(color: MyColors.lightGreyEFColor, width: 1.0),
),
),
child: Row(
@ -244,29 +242,20 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
DefaultButton(
LocaleKeys.reject.tr(),
() => performAction("REJECTED"),
colors: const [
Color(0xffE47A7E),
Color(0xffDE6D71),
],
colors: const [Color(0xffE47A7E), Color(0xffDE6D71)],
).expanded,
if (isApproveAvailable && isRejectAvailable) 8.width,
if (isApproveAvailable)
DefaultButton(
LocaleKeys.approve.tr(),
() => performAction("APPROVED"),
colors: const [
Color(0xff28C884),
Color(0xff1BB271),
],
colors: const [Color(0xff28C884), Color(0xff1BB271)],
).expanded,
if (isCloseAvailable)
DefaultButton(
LocaleKeys.ok.tr(),
() => performAction("CLOSE"),
colors: const [
Color(0xff32D892),
Color(0xff1AB170),
],
colors: const [Color(0xff32D892), Color(0xff1AB170)],
).expanded,
8.width,
Container(

@ -115,9 +115,15 @@ class ActionsFragment extends StatelessWidget {
if (code == "SUBMIT") {
return const Color(0xff2E303A);
} else if (code == "REJECTED") {
return const Color(0xffD02127);
return MyColors.redColor;
} else if (code == "REJECT") {
return MyColors.redColor;
} else if (code == "PENDING") {
return MyColors.orange;
} else if (code == "APPROVED") {
return const Color(0xff1FA269);
} else if (code != "SUBMIT" && code != "REJECT" && code != "PENDING") {
return const Color(0xff1FA269);
} else if (code == "REQUEST_INFO") {
return const Color(0xff2E303A);
} else {

@ -28,9 +28,12 @@ class AttachmentsFragment extends StatelessWidget {
(getAttachmentList[index].fILENAME?.capitalizeFirstofEach ?? "").toText16().expanded,
],
).objectContainerView().onPress(() async {
print("calling");
String path = await _createFileFromString(getAttachmentList[index].fILEDATA ?? "", getAttachmentList[index].fILECONTENTTYPE ?? "");
OpenFile.open(path);
try {
String path = await _createFileFromString(getAttachmentList[index].fILEDATA ?? "", getAttachmentList[index].fILECONTENTTYPE ?? "");
OpenFile.open(path);
} catch (ex) {
debugPrint("FileErorr:$ex");
}
});
},
separatorBuilder: (BuildContext context, int index) => 12.height,
@ -67,7 +70,6 @@ class AttachmentsFragment extends StatelessWidget {
String dir = (await getApplicationDocumentsDirectory()).path;
File file = File("$dir/" + DateTime.now().millisecondsSinceEpoch.toString() + "." + ext);
await file.writeAsBytes(bytes);
// print(file.path);
return file.path;
}
}

@ -23,37 +23,56 @@ class _DetailFragmentState extends State<DetailFragment> {
@override
Widget build(BuildContext context) {
return Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.from.tr(), widget.workListData!.fROMUSER ?? ""),
ItemDetailView(LocaleKeys.to.tr(), widget.workListData!.tOUSER ?? ""),
ItemDetailView(LocaleKeys.sent.tr(), widget.workListData!.bEGINDATE ?? ""),
ItemDetailView(LocaleKeys.closed.tr(), widget.workListData!.eNDDATE ?? ""),
ItemDetailView(LocaleKeys.id.tr(), widget.workListData!.nOTIFICATIONID?.toString() ?? ""),
ItemDetailView(LocaleKeys.responder.tr(), widget.workListData!.rESPONDER ?? ""),
],
).objectContainerView(),
12.height,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.employeeNumber.tr(), widget.memberInformationListModel!.eMPLOYEENUMBER ?? ""),
ItemDetailView(LocaleKeys.employeeName.tr(), (AppState().isArabic(context) ? widget.memberInformationListModel!.eMPLOYEENAMEAr : widget.memberInformationListModel!.eMPLOYEENAMEEn) ?? ""),
ItemDetailView(LocaleKeys.jobTitle.tr(), makePositionName(widget.memberInformationListModel!.pOSITIONNAME ?? "")),
ItemDetailView(LocaleKeys.grade.tr(), widget.memberInformationListModel!.gRADENAME ?? ""),
ItemDetailView(LocaleKeys.jobCategory.tr(), makePositionName(widget.memberInformationListModel!.pOSITIONNAME ?? "")),
ItemDetailView(LocaleKeys.category.tr(), widget.memberInformationListModel!.eMPLOYMENTCATEGORYMEANING ?? ""),
ItemDetailView(LocaleKeys.employeeEmailAddress.tr(), widget.memberInformationListModel!.eMPLOYEEEMAILADDRESS ?? ""),
ItemDetailView(LocaleKeys.payrollBranch.tr(), widget.memberInformationListModel!.pAYROLLNAME ?? ""),
],
).objectContainerView(),
],
).paddingAll(21);
return SingleChildScrollView(
child: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.from.tr(), widget.workListData!.fROMUSER ?? ""),
ItemDetailViewCol(LocaleKeys.to.tr(), widget.workListData!.tOUSER ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.sent.tr(), widget.workListData!.bEGINDATE ?? ""),
ItemDetailViewCol(LocaleKeys.closed.tr(), widget.workListData!.eNDDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.id.tr(), widget.workListData!.nOTIFICATIONID?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.responder.tr(), widget.workListData!.rESPONDER ?? ""),
isItLast: true,
),
],
).objectContainerView(),
12.height,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), widget.memberInformationListModel!.eMPLOYEENUMBER ?? ""),
ItemDetailViewCol(
LocaleKeys.employeeName.tr(), (AppState().isArabic(context) ? widget.memberInformationListModel!.eMPLOYEENAMEAr : widget.memberInformationListModel!.eMPLOYEENAMEEn) ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.jobTitle.tr(), makePositionName(widget.memberInformationListModel!.pOSITIONNAME ?? "")),
ItemDetailViewCol(LocaleKeys.grade.tr(), widget.memberInformationListModel!.gRADENAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.jobCategory.tr(), makePositionName(widget.memberInformationListModel!.pOSITIONNAME ?? "")),
ItemDetailViewCol(LocaleKeys.category.tr(), widget.memberInformationListModel!.eMPLOYMENTCATEGORYMEANING ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.employeeEmailAddress.tr(), widget.memberInformationListModel!.eMPLOYEEEMAILADDRESS ?? ""),
ItemDetailViewCol(LocaleKeys.payrollBranch.tr(), widget.memberInformationListModel!.pAYROLLNAME ?? ""),
isItLast: true,
),
],
).objectContainerView(),
],
).paddingAll(21),
);
}
String makePositionName(String job) {

@ -42,21 +42,38 @@ class InfoFragment extends StatelessWidget {
this.getContactNotificationBodyList,
});
double itemHeight = 0;
double itemWidth = 0;
@override
Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
itemHeight = (size.height - kToolbarHeight - 24) / 9;
itemWidth = size.width / 2;
List<Widget> uiList = [
if ((workListData?.iTEMTYPE ?? "") == "INVMOA")
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""),
ItemDetailView(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""),
ItemDetailView(LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""),
ItemDetailView(LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""),
ItemDetailView(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""),
ItemDetailView(LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""),
ItemDetailView(LocaleKeys.subject.tr(), workListData!.sUBJECT ?? ""),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""),
ItemDetailViewCol(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""),
ItemDetailViewCol(LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.subject.tr(), workListData!.sUBJECT ?? ""),
Container(),
isItLast: true,
),
],
).objectContainerView(),
if (getStampMsNotifications?.isNotEmpty ?? false) getStampMsNotificationsListView(getStampMsNotifications ?? []).objectContainerView(title: "Stamp Notifications"),
@ -89,31 +106,67 @@ class InfoFragment extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.description.tr(), workListData!.fROMUSER ?? ""),
ItemDetailView(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""),
ItemDetailView(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""),
ItemDetailView(LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""),
ItemDetailView(LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""),
ItemDetailView(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""),
ItemDetailView(LocaleKeys.supplier.tr(), poHeaderList[index].vENDORNAME ?? ""),
ItemDetailView(LocaleKeys.site.tr(), poHeaderList[index].vENDORSITECODE ?? ""),
ItemDetailView(LocaleKeys.buyer.tr(), poHeaderList[index].bUYER ?? ""),
ItemDetailView(LocaleKeys.preparer.tr(), poHeaderList[index].pREPARER ?? ""),
ItemDetailView(LocaleKeys.creationDate.tr(), poHeaderList[index].cREATIONDATE ?? ""),
ItemDetailView(LocaleKeys.shipToLocation.tr(), poHeaderList[index].sHIPTOLOCATIONNAME ?? ""),
ItemDetailView(LocaleKeys.quotationNumber.tr(), poHeaderList[index].qUOTATIONNUMBER ?? ""),
ItemDetailView(LocaleKeys.quotationDate.tr(), poHeaderList[index].qUOTATIONDATE ?? ""),
ItemDetailView(LocaleKeys.paymentTerms.tr(), poHeaderList[index].pAYMENTTERMS ?? ""),
ItemDetailView(LocaleKeys.currency.tr(), poHeaderList[index].cURRENCYNAME ?? ""),
ItemDetailView(LocaleKeys.grossAmount.tr(), poHeaderList[index].gROSSAMOUNT?.toString() ?? ""),
ItemDetailView(LocaleKeys.discountAmount.tr(), poHeaderList[index].dISCOUNTAMOUNT?.toString() ?? ""),
ItemDetailView(LocaleKeys.customDuty.tr(), poHeaderList[index].cUSTOMDUTY?.toString() ?? ""),
ItemDetailView(LocaleKeys.shipHandle.tr(), poHeaderList[index].sHIPHANDLE?.toString() ?? ""),
ItemDetailView(LocaleKeys.otherCharges.tr(), poHeaderList[index].oTHERCHARGES?.toString() ?? ""),
ItemDetailView(LocaleKeys.totalPOAmountWithVAT.tr(), poHeaderList[index].qUOTATIONDATE ?? ""),
ItemDetailView(LocaleKeys.totalPOAmountInWords.tr(), poHeaderList[index].tOTPOAMTWORD ?? ""),
Column(
children: [
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.description.tr(), workListData!.fROMUSER ?? ""),
ItemDetailViewCol(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""),
ItemDetailViewCol(LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""),
ItemDetailViewCol(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.supplier.tr(), poHeaderList[index].vENDORNAME ?? ""),
ItemDetailViewCol(LocaleKeys.site.tr(), poHeaderList[index].vENDORSITECODE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.buyer.tr(), poHeaderList[index].bUYER ?? ""),
ItemDetailViewCol(LocaleKeys.preparer.tr(), poHeaderList[index].pREPARER ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.creationDate.tr(), poHeaderList[index].cREATIONDATE ?? ""),
ItemDetailViewCol(LocaleKeys.shipToLocation.tr(), poHeaderList[index].sHIPTOLOCATIONNAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quotationNumber.tr(), poHeaderList[index].qUOTATIONNUMBER ?? ""),
ItemDetailViewCol(LocaleKeys.quotationDate.tr(), poHeaderList[index].qUOTATIONDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.paymentTerms.tr(), poHeaderList[index].pAYMENTTERMS ?? ""),
ItemDetailViewCol(LocaleKeys.currency.tr(), poHeaderList[index].cURRENCYNAME ?? ""),
isItLast: true,
),
],
).objectContainerView(title: LocaleKeys.info_detail.tr()),
12.height,
Column(
children: [
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.grossAmount.tr(), poHeaderList[index].gROSSAMOUNT?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.discountAmount.tr(), poHeaderList[index].dISCOUNTAMOUNT?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.customDuty.tr(), poHeaderList[index].cUSTOMDUTY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.shipHandle.tr(), poHeaderList[index].sHIPHANDLE?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.otherCharges.tr(), poHeaderList[index].oTHERCHARGES?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.totalPOAmountWithVAT.tr(), poHeaderList[index].qUOTATIONDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.totalPOAmountInWords.tr(), poHeaderList[index].tOTPOAMTWORD ?? ""),
Container(),
isItLast: true,
),
],
).objectContainerView(title: LocaleKeys.amount_detail.tr()),
],
).objectContainerView(),
),
separatorBuilder: (cxt, index) => 4.height,
itemCount: poHeaderList.length);
}
@ -135,22 +188,38 @@ class InfoFragment extends StatelessWidget {
itemBuilder: (cxt, index) => Column(
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.employeeNumber.tr(), list[index].eMPLOYEENUMBER.toString()),
ItemDetailView(LocaleKeys.assignmentNumber.tr(), list[index].aSSIGNMENTNUMBER.toString()),
ItemDetailView(LocaleKeys.employeeName.tr(), list[index].eMPLOYEENAME.toString()),
ItemDetailView(LocaleKeys.scheduleDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(list[index].sCHEDULEDATE.toString()), false)),
ItemDetailView(LocaleKeys.shiftType.tr(), list[index].sHTTYPEDESC.toString()),
ItemDetailView(LocaleKeys.shift.tr(), list[index].sHTNAME.toString()),
ItemDetailView(LocaleKeys.breakText.tr(), list[index].bREAKNAME.toString()),
ItemDetailView(LocaleKeys.actualSwipeStart.tr(), list[index].sHTACTUALSTARTTIME.toString()),
ItemDetailView(LocaleKeys.actualSwipeEnd.tr(), list[index].sHTACTUALENDTIME.toString()),
ItemDetailView(LocaleKeys.approvedSwipeStart.tr(), list[index].aPPROVEDSTARTTIME.toString()),
ItemDetailView(LocaleKeys.approvedSwipeStartReason.tr(), list[index].aPPROVEDSTARTREASON.toString()),
ItemDetailView(LocaleKeys.approvedSwipeEnd.tr(), ""),
ItemDetailView(LocaleKeys.approvedSwipeEndReason.tr(), list[index].aPPROVEDENDREASONDESC.toString()),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), list[index].eMPLOYEENUMBER.toString()),
ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(), list[index].aSSIGNMENTNUMBER.toString()),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.employeeName.tr(), list[index].eMPLOYEENAME.toString()),
ItemDetailViewCol(LocaleKeys.scheduleDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(list[index].sCHEDULEDATE.toString()), false)),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.shiftType.tr(), list[index].sHTTYPEDESC.toString()),
ItemDetailViewCol(LocaleKeys.shift.tr(), list[index].sHTNAME.toString()),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.breakText.tr(), list[index].bREAKNAME.toString()),
ItemDetailViewCol(LocaleKeys.actualSwipeStart.tr(), list[index].sHTACTUALSTARTTIME.toString()),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.actualSwipeEnd.tr(), list[index].sHTACTUALENDTIME.toString()),
ItemDetailViewCol(LocaleKeys.approvedSwipeStart.tr(), list[index].aPPROVEDSTARTTIME.toString()),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.approvedSwipeStartReason.tr(), list[index].aPPROVEDSTARTREASON.toString()),
ItemDetailViewCol(LocaleKeys.approvedSwipeEnd.tr(), ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.approvedSwipeEndReason.tr(), list[index].aPPROVEDENDREASONDESC.toString()),
Container(),
isItLast: true,
),
],
),
separatorBuilder: (cxt, index) => 18.height,
separatorBuilder: (cxt, index) => 1.divider.paddingOnly(top: 8, bottom: 8),
itemCount: list.length);
}
@ -161,13 +230,18 @@ class InfoFragment extends StatelessWidget {
itemBuilder: (cxt, index) => Column(
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.employeeNumber.tr(), list[index].eMPLOYEENUMBER.toString()),
ItemDetailView(LocaleKeys.assignmentNumber.tr(), list[index].aSSIGNMENTNUMBER.toString()),
ItemDetailView(LocaleKeys.employeeName.tr(), list[index].eMPLOYEENAME.toString()),
ItemDetailView(LocaleKeys.scheduleDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(list[index].sCHEDULEDATE.toString()), false)),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), list[index].eMPLOYEENUMBER.toString()),
ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(), list[index].aSSIGNMENTNUMBER.toString()),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.employeeName.tr(), list[index].eMPLOYEENAME.toString()),
ItemDetailViewCol(LocaleKeys.scheduleDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(list[index].sCHEDULEDATE.toString()), false)),
isItLast: true,
),
],
),
separatorBuilder: (cxt, index) => 18.height,
separatorBuilder: (cxt, index) => 1.divider.paddingOnly(top: 8, bottom: 8),
itemCount: list.length);
}
@ -178,16 +252,26 @@ class InfoFragment extends StatelessWidget {
itemBuilder: (cxt, index) => Column(
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.operatingUnit.tr(), itemCreationHeader[index].oPERATINGUNIT?.toString() ?? ""),
ItemDetailView(LocaleKeys.category.tr(), itemCreationHeader[index].cATEGORY?.toString() ?? ""),
ItemDetailView(LocaleKeys.requester.tr(), itemCreationHeader[index].rEQUESTER?.toString() ?? ""),
ItemDetailView(LocaleKeys.analyzedBy.tr(), itemCreationHeader[index].aNALYZEDBY?.toString() ?? ""),
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.analyzedDate.tr(), itemCreationHeader[index].aNALYZEDDATE?.toString() ?? ""),
ItemDetailView(LocaleKeys.urgent.tr(), itemCreationHeader[index].uRGENTFLAGDISP?.toString() ?? ""),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), itemCreationHeader[index].oPERATINGUNIT?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.category.tr(), itemCreationHeader[index].cATEGORY?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.requester.tr(), itemCreationHeader[index].rEQUESTER?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.analyzedBy.tr(), itemCreationHeader[index].aNALYZEDBY?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.approvedDate.tr(), itemCreationHeader[index].aPPROVEDDATE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.itemType.tr(), itemCreationHeader[index].iTEMTYPE?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.relatedTo.tr(), itemCreationHeader[index].rELATEDTO?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.requestDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(itemCreationHeader[index].rEQUESTDATE.toString()), false)),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.analyzedDate.tr(), itemCreationHeader[index].aNALYZEDDATE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.urgent.tr(), itemCreationHeader[index].uRGENTFLAGDISP?.toString() ?? ""),
),
],
).objectContainerView(),
separatorBuilder: (cxt, index) => 18.height,
@ -201,13 +285,31 @@ class InfoFragment extends StatelessWidget {
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();
dataList = dataList.where((o) => o.displayFlag == "Y").toList();
bool isOdd = false;
if (dataList.length % 2 != 0) {
isOdd = true;
dataList.add(new CollectionNotificationEit());
}
return GridView.builder(
itemCount: dataList.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem(
index,
dataList[index].segmentPrompt,
dataList[index].segmentValueDsp,
isNeedToShowEmptyDivider: (dataList.length == index + 1)
? isOdd
? true
: false
: false,
),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight),
),
).objectContainerView();
},
separatorBuilder: (cxt, index) => 12.height,
itemCount: list.length,
@ -215,21 +317,75 @@ class InfoFragment extends StatelessWidget {
}
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);
bool isOdd = false;
if (list.length % 2 != 0) {
isOdd = true;
list.add(new GetPhonesNotificationBodyList());
}
return GridView.builder(
itemCount: list.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem(
index,
LocaleKeys.subject.tr(),
list[index].proposedPhoneNumber ?? "",
isNeedToShowEmptyDivider: (list.length == index + 1)
? isOdd
? true
: false
: false,
),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight),
),
);
return Container(
color: Colors.yellow,
child: ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ItemDetailViewCol(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);
bool isOdd = false;
if (list.length % 2 != 0) {
isOdd = true;
list.add(new GetBasicDetNtfBodyList());
}
return GridView.builder(
itemCount: list.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem(
index,
list[index].segmentPrompt,
list[index].segmentValueDsp,
isNeedToShowEmptyDivider: (list.length == index + 1)
? isOdd
? true
: false
: false,
),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight),
),
);
return Container(
color: Colors.pink,
child: ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ItemDetailViewCol(list[index].segmentPrompt!, list[index].segmentValueDsp!),
separatorBuilder: (cxt, index) => 4.height,
itemCount: list.length),
);
}
Widget getAbsenceCollectionNotificationBodyListWidget(List<GetAbsenceCollectionNotificationBodyList> list) {
@ -238,10 +394,36 @@ class InfoFragment extends StatelessWidget {
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) {
List<CollectionNotificationAbsence> dataList = list.isEmpty ? [] : (list[index].collectionNotification ?? []);
dataList = dataList.where((o) => o.dISPLAYFLAG == "Y").toList();
bool isOdd = false;
if (dataList.length % 2 != 0) {
isOdd = true;
dataList.add(new CollectionNotificationAbsence());
}
return GridView.builder(
itemCount: dataList.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem(
index,
dataList[index].sEGMENTPROMPT,
dataList[index].sEGMENTVALUEDSP,
isNeedToShowEmptyDivider: (dataList.length == index + 1)
? isOdd
? true
: false
: false,
),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight),
),
).objectContainerView();
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => dataList[index].dISPLAYFLAG == "Y" ? ItemDetailView(dataList[index].sEGMENTPROMPT!, dataList[index].sEGMENTVALUEDSP!) : Container(),
itemBuilder: (cxt, index) => dataList[index].dISPLAYFLAG == "Y" ? ItemDetailViewCol(dataList[index].sEGMENTPROMPT!, dataList[index].sEGMENTVALUEDSP!) : Container(),
separatorBuilder: (cxt, index) => dataList[index].dISPLAYFLAG == "Y" ? 4.height : 0.height,
itemCount: dataList.length)
.objectContainerView();
@ -252,11 +434,41 @@ class InfoFragment extends StatelessWidget {
}
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);
bool isOdd = false;
try {
if (data.contactNotificationBody!.length % 2 != 0) {
isOdd = true;
data.contactNotificationBody!.add(new ContactNotificationBody());
}
} catch (e) {}
return GridView.builder(
itemCount: data.contactNotificationBody!.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem(
index,
data.contactNotificationBody![index].segmentPrompt,
data.contactNotificationBody![index].segmentValueDsp,
isNeedToShowEmptyDivider: (data.contactNotificationBody!.length == index + 1)
? isOdd
? true
: false
: false,
),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight),
),
).objectContainerView();
return Container(
color: Colors.orange,
child: ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ItemDetailViewCol(data.contactNotificationBody![index].segmentPrompt!, data.contactNotificationBody![index].segmentValueDsp!),
separatorBuilder: (cxt, index) => 4.height,
itemCount: data.contactNotificationBody!.length),
);
}
}

@ -25,14 +25,16 @@ class RequestFragment extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListView(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
children: [
if (moNotificationBodyList.isNotEmpty) moNotificationDataView(),
if (poLinesList.isNotEmpty) poLinesDataView(),
if (itemCreationLines.isNotEmpty) itemCreationLinesView(),
],
return Container(
child: ListView(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
children: [
if (moNotificationBodyList.isNotEmpty) moNotificationDataView(),
if (poLinesList.isNotEmpty) poLinesDataView(),
if (itemCreationLines.isNotEmpty) itemCreationLinesView(),
],
),
);
}
@ -44,19 +46,34 @@ class RequestFragment extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.code.tr(), poLinesList[index].iTEMCODE ?? ""),
ItemDetailView(LocaleKeys.mfg.tr(), poLinesList[index].uOM ?? ""),
ItemDetailView(LocaleKeys.lineType.tr(), poLinesList[index].qUANTITY?.toString() ?? ""),
ItemDetailView(LocaleKeys.unit.tr(), poLinesList[index].uOM ?? ""),
ItemDetailView(LocaleKeys.price.tr(), poLinesList[index].uNITPRICE?.toString() ?? ""),
ItemDetailView(LocaleKeys.lineAmount.tr(), poLinesList[index].lINEAMOUNT?.toString() ?? ""),
ItemDetailView(LocaleKeys.quantity.tr(), poLinesList[index].qUANTITY?.toString() ?? ""),
ItemDetailView(LocaleKeys.lineDiscount.tr(), poLinesList[index].lINEDISCPERCENTAGE?.toString() ?? ""),
ItemDetailView(LocaleKeys.needByDate.tr(), poLinesList[index].nEEDBYDATE ?? ""),
ItemDetailView(LocaleKeys.promisedDate.tr(), poLinesList[index].pROMISEDDATE ?? ""),
ItemDetailView(LocaleKeys.deliverToLocation.tr(), poLinesList[index].dELIVERTOLOCATION ?? ""),
ItemDetailView(LocaleKeys.requisitionNumber.tr(), poLinesList[index].rEQUESTOR ?? ""),
ItemDetailView(LocaleKeys.requester.tr(), poLinesList[index].pRNUM ?? ""),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.code.tr(), poLinesList[index].iTEMCODE ?? ""),
ItemDetailViewCol(LocaleKeys.mfg.tr(), poLinesList[index].uOM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.lineType.tr(), poLinesList[index].qUANTITY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.unit.tr(), poLinesList[index].uOM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.price.tr(), poLinesList[index].uNITPRICE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.lineAmount.tr(), poLinesList[index].lINEAMOUNT?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quantity.tr(), poLinesList[index].qUANTITY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.lineDiscount.tr(), poLinesList[index].lINEDISCPERCENTAGE?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.needByDate.tr(), poLinesList[index].nEEDBYDATE ?? ""),
ItemDetailViewCol(LocaleKeys.promisedDate.tr(), poLinesList[index].pROMISEDDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.deliverToLocation.tr(), poLinesList[index].dELIVERTOLOCATION ?? ""),
ItemDetailViewCol(LocaleKeys.requisitionNumber.tr(), poLinesList[index].rEQUESTOR ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.requester.tr(), poLinesList[index].pRNUM ?? ""),
Container(),
),
12.height,
Row(
children: [
@ -92,21 +109,35 @@ class RequestFragment extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.code.tr(), moNotificationBodyList[index].iTEMCODE ?? ""),
ItemDetailView(LocaleKeys.unit.tr(), moNotificationBodyList[index].uOM ?? ""),
ItemDetailView(LocaleKeys.quantity.tr(), moNotificationBodyList[index].qUANTITY?.toString() ?? ""),
ItemDetailView(LocaleKeys.dateRequired.tr(), moNotificationBodyList[index].dATEREQUIRED ?? ""),
ItemDetailView(LocaleKeys.lineStatus.tr(), moNotificationBodyList[index].lINESTATUS ?? ""),
ItemDetailView(LocaleKeys.statusDate.tr(), moNotificationBodyList[index].sTATUSDATE ?? ""),
ItemDetailView(LocaleKeys.transactionType.tr(), moNotificationBodyList[index].tRANSACTIONTYPENAME ?? ""),
ItemDetailView(LocaleKeys.operatingUnit.tr(), moNotificationBodyList[index].oPERATINGUNIT ?? ""),
ItemDetailView(LocaleKeys.organizationCode.tr(), moNotificationBodyList[index].oRGANIZATIONCODE ?? ""),
ItemDetailView(LocaleKeys.organization.tr(), moNotificationBodyList[index].oRGANIZATIONNAME ?? ""),
ItemDetailView(LocaleKeys.fromSubInventory.tr(), moNotificationBodyList[index].fROMSUBINVENTORY ?? ""),
ItemDetailView(LocaleKeys.fromLocator.tr(), moNotificationBodyList[index].fROMLOCATOR ?? ""),
ItemDetailView(LocaleKeys.toSubInventory.tr(), moNotificationBodyList[index].tOSUBINVENTORY ?? ""),
ItemDetailView(LocaleKeys.toLocator.tr(), moNotificationBodyList[index].tOLOCATOR ?? ""),
ItemDetailView(LocaleKeys.shipToLocator.tr(), moNotificationBodyList[index].sHIPTOLOCATION ?? ""),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.code.tr(), moNotificationBodyList[index].iTEMCODE ?? ""),
ItemDetailViewCol(LocaleKeys.unit.tr(), moNotificationBodyList[index].uOM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quantity.tr(), moNotificationBodyList[index].qUANTITY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.dateRequired.tr(), moNotificationBodyList[index].dATEREQUIRED ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.lineStatus.tr(), moNotificationBodyList[index].lINESTATUS ?? ""),
ItemDetailViewCol(LocaleKeys.statusDate.tr(), moNotificationBodyList[index].sTATUSDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.transactionType.tr(), moNotificationBodyList[index].tRANSACTIONTYPENAME ?? ""),
ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), moNotificationBodyList[index].oPERATINGUNIT ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.organizationCode.tr(), moNotificationBodyList[index].oRGANIZATIONCODE ?? ""),
ItemDetailViewCol(LocaleKeys.organization.tr(), moNotificationBodyList[index].oRGANIZATIONNAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.fromSubInventory.tr(), moNotificationBodyList[index].fROMSUBINVENTORY ?? ""),
ItemDetailViewCol(LocaleKeys.fromLocator.tr(), moNotificationBodyList[index].fROMLOCATOR ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.toSubInventory.tr(), moNotificationBodyList[index].tOSUBINVENTORY ?? ""),
ItemDetailViewCol(LocaleKeys.toLocator.tr(), moNotificationBodyList[index].tOLOCATOR ?? ""),
),
ItemDetailGrid(ItemDetailViewCol(LocaleKeys.shipToLocator.tr(), moNotificationBodyList[index].sHIPTOLOCATION ?? ""), Container()),
12.height,
DefaultButton(LocaleKeys.itemHistory.tr(), () {
Navigator.pushNamed(
@ -129,28 +160,51 @@ class RequestFragment extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.productName.tr(), itemCreationLines[index].pRODUCTNAME ?? ""),
ItemDetailView(LocaleKeys.productDescription.tr(), itemCreationLines[index].pRODUCTDESCRIPTION ?? ""),
ItemDetailView(LocaleKeys.unitPrice.tr(), itemCreationLines[index].uNITPRICE?.toString() ?? ""),
ItemDetailView(LocaleKeys.manufacturerName.tr(), itemCreationLines[index].uSERMANUFACTURERNAME ?? ""),
ItemDetailView(LocaleKeys.manufacturerPartName.tr(), itemCreationLines[index].uSERMFGPARTNUM ?? ""),
ItemDetailView(LocaleKeys.supplierName.tr(), itemCreationLines[index].sUPPLIERNAME ?? ""),
ItemDetailView(LocaleKeys.supplierContact.tr(), itemCreationLines[index].sUPPLIERCONTACT ?? ""),
ItemDetailView(LocaleKeys.chargeToPatient.tr(), itemCreationLines[index].cHARGETOPATIENT ?? ""),
ItemDetailView(LocaleKeys.justification.tr(), itemCreationLines[index].jUSTIFICATION ?? ""),
ItemDetailView(LocaleKeys.itemCode.tr(), itemCreationLines[index].iTEMCODE ?? ""),
ItemDetailView(LocaleKeys.itemDescription.tr(), itemCreationLines[index].iTEMDESCRIPTION ?? ""),
ItemDetailView(LocaleKeys.groupCode.tr(), itemCreationLines[index].iTEMGROUPCODE ?? ""),
ItemDetailView(LocaleKeys.groupDescription.tr(), itemCreationLines[index].iTEMGROUP ?? ""),
ItemDetailView(LocaleKeys.subgroupCode.tr(), itemCreationLines[index].iTEMSUBGROUPCODE ?? ""),
ItemDetailView(LocaleKeys.subgroupDescription.tr(), itemCreationLines[index].iTEMSUBGROUP ?? ""),
ItemDetailView(LocaleKeys.primaryUOM.tr(), itemCreationLines[index].pRIMARYUOM ?? ""),
ItemDetailView(LocaleKeys.manufacturerName.tr(), itemCreationLines[index].sTANDARDMANUFACTURERNAME ?? ""),
ItemDetailView(LocaleKeys.manufacturerPartName.tr(), itemCreationLines[index].sTANDARDMFGPARTNUM ?? ""),
ItemDetailView(LocaleKeys.templateName.tr(), itemCreationLines[index].tEMPLATENAME ?? ""),
ItemDetailView(LocaleKeys.itemCreationStatus.tr(), itemCreationLines[index].iTEMCREATIONSTATUS ?? ""),
ItemDetailView(LocaleKeys.standardizationApprovalStatus.tr(), itemCreationLines[index].sTANDARDSTATUS ?? ""),
ItemDetailView(LocaleKeys.standardizationApprovalRejectionReason.tr(), itemCreationLines[index].sTANDARDREJECTREASON ?? ""),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.productName.tr(), itemCreationLines[index].pRODUCTNAME ?? ""),
ItemDetailViewCol(LocaleKeys.productDescription.tr(), itemCreationLines[index].pRODUCTDESCRIPTION ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.unitPrice.tr(), itemCreationLines[index].uNITPRICE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.manufacturerName.tr(), itemCreationLines[index].uSERMANUFACTURERNAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.manufacturerPartName.tr(), itemCreationLines[index].uSERMFGPARTNUM ?? ""),
ItemDetailViewCol(LocaleKeys.supplierName.tr(), itemCreationLines[index].sUPPLIERNAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.supplierContact.tr(), itemCreationLines[index].sUPPLIERCONTACT ?? ""),
ItemDetailViewCol(LocaleKeys.chargeToPatient.tr(), itemCreationLines[index].cHARGETOPATIENT ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.justification.tr(), itemCreationLines[index].jUSTIFICATION ?? ""),
ItemDetailViewCol(LocaleKeys.itemCode.tr(), itemCreationLines[index].iTEMCODE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.itemDescription.tr(), itemCreationLines[index].iTEMDESCRIPTION ?? ""),
ItemDetailViewCol(LocaleKeys.groupCode.tr(), itemCreationLines[index].iTEMGROUPCODE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.groupDescription.tr(), itemCreationLines[index].iTEMGROUP ?? ""),
ItemDetailViewCol(LocaleKeys.subgroupCode.tr(), itemCreationLines[index].iTEMSUBGROUPCODE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.subgroupDescription.tr(), itemCreationLines[index].iTEMSUBGROUP ?? ""),
ItemDetailViewCol(LocaleKeys.primaryUOM.tr(), itemCreationLines[index].pRIMARYUOM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.manufacturerName.tr(), itemCreationLines[index].sTANDARDMANUFACTURERNAME ?? ""),
ItemDetailViewCol(LocaleKeys.manufacturerPartName.tr(), itemCreationLines[index].sTANDARDMFGPARTNUM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.templateName.tr(), itemCreationLines[index].tEMPLATENAME ?? ""),
ItemDetailViewCol(LocaleKeys.itemCreationStatus.tr(), itemCreationLines[index].iTEMCREATIONSTATUS ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.standardizationApprovalStatus.tr(), itemCreationLines[index].sTANDARDSTATUS ?? ""),
ItemDetailViewCol(LocaleKeys.standardizationApprovalRejectionReason.tr(), itemCreationLines[index].sTANDARDREJECTREASON ?? ""),
isItLast: true,
),
],
).objectContainerView(title: itemCreationLines[index].iTEMDESCRIPTION!),
separatorBuilder: (cxt, index) => 12.height,

@ -1,4 +1,3 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -6,6 +5,7 @@ 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/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
@ -15,7 +15,7 @@ import 'package:mohem_flutter_app/models/worklist/update_user_type_list.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
class WorklistSettings extends StatefulWidget {
class WorklistSettings extends StatefulWidget {
const WorklistSettings({Key? key}) : super(key: key);
@override
@ -26,7 +26,6 @@ class _WorklistSettingsState extends State<WorklistSettings> {
List<GetUserItemTypesList> getUserItemTypesList = [];
UpdateUserItemTypesList? updateUserItemTypesList;
void initState() {
super.initState();
userItemTypesList();
@ -47,10 +46,9 @@ class _WorklistSettingsState extends State<WorklistSettings> {
void updateUserItem() async {
try {
Utils.showLoading(context);
List<Map<String, dynamic>> itemList=[];
List<Map<String, dynamic>> itemList = [];
for (var element in getUserItemTypesList) {
itemList.add(UpdateUserTypesList(itemID: element.uSERITEMTYPEID, pITEMTYPE: element.iTEMTYPE,pFYAENABLEDFALG: element.fYAENABLEDFALG, pFYIENABLEDFALG: element.fYIENABLEDFLAG).toJson());
itemList.add(UpdateUserTypesList(itemID: element.uSERITEMTYPEID, pITEMTYPE: element.iTEMTYPE, pFYAENABLEDFALG: element.fYAENABLEDFALG, pFYIENABLEDFALG: element.fYIENABLEDFLAG).toJson());
}
updateUserItemTypesList = await WorkListApiClient().updateUserItemTypes(itemList);
Utils.hideLoading(context);
@ -64,115 +62,92 @@ class _WorklistSettingsState extends State<WorklistSettings> {
@override
Widget build(BuildContext context) {
return Scaffold(backgroundColor: Colors.white,
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(
context,
title: LocaleKeys.worklistSettings.tr(),
),
body:ListView(
body: Column(
children: [
Expanded(
child: Container(
margin: const EdgeInsets.only(top: 21, left: 21, right: 21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
ListView(
padding: const EdgeInsets.only(top: 21, left: 21, right: 21),
children: [
LocaleKeys.TurnNotificationsFor.tr().toText22(color: MyColors.blackColor),
16.height,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: LocaleKeys.TurnNotificationsFor.tr().toText22(color: MyColors.blackColor),
).paddingOnly(top: 10, bottom: 50),
LocaleKeys.itemType.tr().toText14(color: MyColors.blackColor),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: LocaleKeys.itemType.tr().toText14(color: MyColors.blackColor) ,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
child: "FYA".tr().toText14(color: MyColors.blackColor) ,
),
Container(
child: "FYI".tr().toText14(color: MyColors.blackColor) ,
).paddingOnly(left: 30, right: 30),
],
)
],
),
Divider(color: MyColors.greyA5Color,),
SingleChildScrollView(
scrollDirection: Axis.vertical,
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: getUserItemTypesList == null ? 0 : getUserItemTypesList.length,
itemBuilder: (BuildContext context,int index) {
return Column(
children:[
customSwitch(getUserItemTypesList[index]),
Divider(
color: MyColors.greyC4Color,
thickness: 0.5,),
]);
}
),
),
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: ["FYA".tr().toText14(color: MyColors.blackColor), 30.width, "FYI".tr().toText14(color: MyColors.blackColor), 30.width],
)
],
),
),
),
DefaultButton(
LocaleKeys.save.tr(), () async {
const Divider(color: MyColors.greyA5Color),
SingleChildScrollView(
scrollDirection: Axis.vertical,
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: getUserItemTypesList == null ? 0 : getUserItemTypesList.length,
itemBuilder: (BuildContext context, int index) {
return Column(children: [
customSwitch(getUserItemTypesList[index]),
Divider(
color: MyColors.greyC4Color,
thickness: 0.5,
),
]);
}),
),
],
).expanded,
DefaultButton(LocaleKeys.save.tr(), () async {
updateUserItem();
}).insideContainer,
],
)
);
));
}
Widget customSwitch(GetUserItemTypesList list){
return Padding(
padding: const EdgeInsets.only(top: 21),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(list.iTEMTYPE.toString(), style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: MyColors.blackColor
),),
const Spacer(),
Row(
children: [
CupertinoSwitch(
trackColor: Colors.grey,
activeColor: MyColors.gradiantEndColor,
value: list?.fYAENABLEDFALG =='Y' ?true : false,
onChanged: (value){
setState(() {
list?.fYAENABLEDFALG = value == true ? 'Y': 'N';
});
}
),
CupertinoSwitch(
trackColor: Colors.grey,
activeColor: MyColors.gradiantEndColor,
value: list?.fYIENABLEDFLAG =='Y' ?true : false,
onChanged: (value){
setState(() {
// list.isFYI = value;
list?.fYIENABLEDFLAG = value ==true ? 'Y': 'N';
});
}
),
],
)
],
),
);
Widget customSwitch(GetUserItemTypesList list) {
return Padding(
padding: const EdgeInsets.only(top: 21),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
list.iTEMTYPE.toString(),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: MyColors.blackColor),
),
const Spacer(),
Row(
children: [
CupertinoSwitch(
trackColor: MyColors.grey57Color,
activeColor: MyColors.textMixColor,
value: list?.fYAENABLEDFALG == 'Y' ? true : false,
onChanged: (value) {
setState(() {
list?.fYAENABLEDFALG = value == true ? 'Y' : 'N';
});
}),
CupertinoSwitch(
trackColor: MyColors.grey57Color,
activeColor: MyColors.textMixColor,
value: list?.fYIENABLEDFLAG == 'Y' ? true : false,
onChanged: (value) {
setState(() {
// list.isFYI = value;
list?.fYIENABLEDFLAG = value == true ? 'Y' : 'N';
});
}),
],
)
],
),
);
}
}

@ -8,6 +8,7 @@ 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/dashboard/get_accrual_balances_list_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:pie_chart/pie_chart.dart';
@ -64,14 +65,14 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
if (widget.isLeaveBalance) {
leaveBalanceAccrual = accrualList[0];
chartModelList = [
PieChartModel("Current Balance", leaveBalanceAccrual?.accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel("Used", leaveBalanceAccrual?.accrualUsedEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
PieChartModel(LocaleKeys.currentBalance.tr(), leaveBalanceAccrual?.accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.usedBalance.tr(), leaveBalanceAccrual?.accrualUsedEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
];
} else {
chartModelList = [
PieChartModel("Adult", accrualList[1].accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel("Child", accrualList[2].accrualNetEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
PieChartModel("infants", accrualList[3].accrualNetEntitlement?.toDouble() ?? 0, MyColors.pinkColor, titleAppend: ""),
PieChartModel(LocaleKeys.adult.tr(), accrualList[1].accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.child.tr(), accrualList[2].accrualNetEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
PieChartModel(LocaleKeys.infants.tr(), accrualList[3].accrualNetEntitlement?.toDouble() ?? 0, MyColors.pinkColor, titleAppend: ""),
];
}
}
@ -88,8 +89,8 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
if (leaveBalanceAccrual == null && widget.isLeaveBalance) {
leaveBalanceAccrual = Provider.of<DashboardProviderModel>(context, listen: false).leaveBalanceAccrual;
chartModelList = [
PieChartModel("Current Balance", leaveBalanceAccrual?.accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel("Used", leaveBalanceAccrual?.accrualUsedEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
PieChartModel(LocaleKeys.currentBalance.tr(), leaveBalanceAccrual?.accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.usedBalance.tr(), leaveBalanceAccrual?.accrualUsedEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
];
}
@ -97,9 +98,9 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
ticketBalanceAccrualList = Provider.of<DashboardProviderModel>(context, listen: false).accrualList ?? [];
if (ticketBalanceAccrualList!.isNotEmpty) {
chartModelList = [
PieChartModel("Adult", ticketBalanceAccrualList![1].accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel("Child", ticketBalanceAccrualList![2].accrualNetEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
PieChartModel("infants", ticketBalanceAccrualList![3].accrualNetEntitlement?.toDouble() ?? 0, MyColors.pinkColor, titleAppend: ""),
PieChartModel(LocaleKeys.adult.tr(), ticketBalanceAccrualList![1].accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.child.tr(), ticketBalanceAccrualList![2].accrualNetEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
PieChartModel(LocaleKeys.infants.tr(), ticketBalanceAccrualList![3].accrualNetEntitlement?.toDouble() ?? 0, MyColors.pinkColor, titleAppend: ""),
];
}
}

@ -26,9 +26,9 @@ class AttachmentOptions extends StatelessWidget {
padding: const EdgeInsets.only(top: 21, bottom: 14),
shrinkWrap: true,
children: [
itemView("open_camera.svg", "Open\nCamera"),
itemView("gallery.svg", "Upload from\nGallery"),
itemView("files.svg", "Upload from\nFiles"),
itemView("open_camera.svg", "Open\nCamera", onCameraTap),
itemView("gallery.svg", "Upload from\nGallery", onGalleryTap),
itemView("files.svg", "Upload from\nFiles", onFilesTap),
],
)
],
@ -36,19 +36,22 @@ class AttachmentOptions extends StatelessWidget {
);
}
Widget itemView(String icon, String title) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SvgPicture.asset("assets/images/$icon"),
title.toText11(isBold: true),
],
).paddingOnly(left: 13, right: 13, top: 16, bottom: 12).expanded.objectContainerBorderView(
disablePadding: true,
radius: 10,
color: MyColors.greyF7Color.withOpacity(.48),
borderColor: MyColors.lightGreyE5Color.withOpacity(.48),
);
Widget itemView(String icon, String title, VoidCallback onTap) {
return InkWell(
onTap: onTap,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SvgPicture.asset("assets/images/$icon"),
title.toText11(isBold: true),
],
).paddingOnly(left: 13, right: 13, top: 16, bottom: 12).expanded.objectContainerBorderView(
disablePadding: true,
radius: 10,
color: MyColors.greyF7Color.withOpacity(.48),
borderColor: MyColors.lightGreyE5Color.withOpacity(.48),
),
);
}
}

@ -0,0 +1,102 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/input_widget.dart';
class ITGCommentsDialog extends StatelessWidget {
final String? title;
final String? message;
final String? okTitle;
final Function(String) onTap;
ITGCommentsDialog({Key? key, this.title, @required this.message, this.okTitle, required this.onTap}) : super(key: key);
String note = "";
@override
Widget build(BuildContext context) {
return Dialog(
backgroundColor: Colors.white,
shape: const RoundedRectangleBorder(),
insetPadding: const EdgeInsets.only(left: 21, right: 21),
child: Padding(
padding: const EdgeInsets.only(left: 20, right: 20, top: 18, bottom: 28),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.only(top: 16.0),
child: Text(
title ?? LocaleKeys.confirm.tr(),
style: const TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: Color(0xff2B353E), height: 35 / 24, letterSpacing: -0.96),
),
),
),
IconButton(
padding: EdgeInsets.zero,
icon: const Icon(Icons.close),
color: const Color(0xff2B353E),
constraints: const BoxConstraints(),
onPressed: () {
Navigator.pop(context);
},
)
],
),
Text(
message ?? "",
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff808080), letterSpacing: -0.48),
),
// if (notificationGetRespond != null) ...[
14.height,
InputWidget(
"Enter a Note",
LocaleKeys.comments.tr(),
TextEditingController(),
isBackgroundEnable: true,
isInputTypeNum: false,
lines: 3,
onChange: (String note) {
this.note = note;
},
),
// ],
28.height,
Row(
children: [
DefaultButton(
LocaleKeys.cancel.tr(),
() => Navigator.pop(context),
colors: const [MyColors.lightGreyEAColor, MyColors.lightGreyEAColor],
textColor: MyColors.darkTextColor,
).expanded,
10.width,
DefaultButton(
LocaleKeys.ok.tr(),
() {
Navigator.pop(context);
onTap(note);
},
colors: const [
Color(0xff28C884),
Color(0xff1BB271),
],
).expanded,
],
),
],
),
),
);
}
}

@ -15,9 +15,31 @@ class ImageOptions {
context,
child: AttachmentOptions(
onCameraTap: () async {
PickedFile? path = await ImagePicker.platform.pickImage(source: ImageSource.camera, imageQuality: 20);
if (Platform.isAndroid) {
cameraImageAndroid(image);
} else {
File _image = File((await ImagePicker.platform.pickImage(source: ImageSource.camera, imageQuality: 20))?.path ?? "");
String fileName = _image.path;
var bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes);
if (base64Encode != null) {
image(base64Encode, _image);
}
}
},
onGalleryTap: () async {
if (Platform.isAndroid) {
galleryImageAndroid(image);
} else {
File _image = File((await ImagePicker.platform.pickImage(source: ImageSource.gallery, imageQuality: 20))?.path ?? "");
String fileName = _image.path;
var bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes);
if (base64Encode != null) {
image(base64Encode, _image);
}
}
},
onGalleryTap: () {},
onFilesTap: () async {
FilePickerResult? result = await FilePicker.platform.pickFiles();
},

@ -7,6 +7,7 @@ import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
class ItemDetailView extends StatelessWidget {
final String title;
final String value;
const ItemDetailView(this.title, this.value, {Key? key}) : super(key: key);
@override
@ -21,3 +22,110 @@ class ItemDetailView extends StatelessWidget {
);
}
}
class ItemDetailViewCol extends StatelessWidget {
final String title;
final String value;
const ItemDetailViewCol(this.title, this.value, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"$title:".toText12(isBold: true, color: const Color(0xff2BB8A6)),
4.width,
(value.isEmpty ? "--" : value).toText12(color: MyColors.normalTextColor),
],
);
}
}
class ItemDetailViewGridItem extends StatelessWidget {
int index;
final String? title;
final String? value;
final bool isNeedToShowEmptyDivider;
ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: index % 2 != 0 ? 12 : 0),
decoration: BoxDecoration(
color: Colors.transparent,
border: Border(
left: BorderSide(
//MyColors.lightGreyEFColor
// <--- left side
color: index % 2 != 0 ? MyColors.lightGreyEFColor : Colors.transparent,
width: 1.5,
),
top: BorderSide(
// <--- left side
color: index > 1 ? MyColors.lightGreyEFColor : Colors.transparent,
width: 1.5,
),
),
),
child: isNeedToShowEmptyDivider
? Container()
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Flexible(child: "$title:".toText12Auto(isBold: true, color: const Color(0xff2BB8A6))),
4.width,
Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor)),
],
),
);
}
}
class ItemDetailGrid extends StatelessWidget {
Widget child1, child2;
bool isItLast;
ItemDetailGrid(this.child1, this.child2, {this.isItLast = false});
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
IntrinsicHeight(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
flex: 1,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: child1,
),
),
Container(
width: 1,
height: double.infinity,
color: MyColors.lightGreyEFColor,
margin: EdgeInsets.symmetric(horizontal: 8),
),
Expanded(
flex: 1,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: child2,
),
),
],
),
),
if (!isItLast) 1.divider,
],
);
}
}

@ -75,6 +75,8 @@ dependencies:
url_launcher: ^6.0.15
share: 2.0.4
flutter_rating_bar: ^4.0.1
auto_size_text: ^3.0.0
pull_to_refresh: ^2.0.0
#Chat
signalr_netcore: ^1.3.3

Loading…
Cancel
Save