# Conflicts:
#	lib/ui/misc/request_submit_screen.dart
merge-requests/83/head
Fatimah Alshammari 3 years ago
commit f43b4905c5

@ -66,6 +66,41 @@ class ItemsForSaleApiClient {
}, url, postParams); }, url, postParams);
} }
Future<dynamic> updateItemsForSale(int itemSaleID) async {
List<GetItemsForSaleList> getItemsForSaleList = [];
String url = "${ApiConsts.cocRest}Mohemm_ITG_UpdateItemForSale";
// request.fields['itemSaleID'] = itemSaleID.toString();
// request.fields['Channel'] = "31";
// request.fields['isActive'] = "false";
// request.fields['LogInToken'] = loginTokenID!;
// request.fields['Token'] = tokenID!;
// request.fields['MobileNo'] = empMobNum!;
// request.fields['EmployeeNumber'] = empNum!;
// request.fields['employeeNumber'] = empNum;
Map<String, dynamic> postParams = {
"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER,
"employeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER,
"MobileNo": AppState().memberInformationList?.eMPLOYEEMOBILENUMBER,
"itemSaleID": itemSaleID.toString(),
"Channel": "31",
"isActive": "false",
"Token": AppState().postParamsObject?.tokenID
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((response) {
var body = json.decode(response['Mohemm_ITG_ResponseItem']);
// body['result']['data'].forEach((v) {
// getItemsForSaleList.add(new GetItemsForSaleList.fromJson(v));
// });
return getItemsForSaleList;
}, url, postParams);
}
Future<List<EmployeePostedAds>> getEmployeePostedAds() async { Future<List<EmployeePostedAds>> getEmployeePostedAds() async {
List<EmployeePostedAds> employeePostedAdsList = []; List<EmployeePostedAds> employeePostedAdsList = [];

@ -70,7 +70,7 @@ class MyAttendanceApiClient {
}, url, postParams); }, url, postParams);
} }
Future<ESERVICESDV> getDefaultValue(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List<Map<String, dynamic>> list, String? empID) async { Future<ESERVICESDV> getDefaultValue(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List<Map<String, dynamic>> list, {String? empID}) async {
String url = "${ApiConsts.erpRest}GET_DEFAULT_VALUE"; String url = "${ApiConsts.erpRest}GET_DEFAULT_VALUE";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999, "P_SELECTED_RESP_ID": -999,
@ -82,7 +82,7 @@ class MyAttendanceApiClient {
"GetValueSetValuesTBL": list, "GetValueSetValuesTBL": list,
}; };
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
if (empID!.isNotEmpty) { if (empID != null && empID!.isNotEmpty) {
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID; postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
} }
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {

@ -2,8 +2,8 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart';
class ApiConsts { class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server //static String baseUrl = "http://10.200.204.20:2801/"; // Local server
//static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";
@ -26,7 +26,7 @@ class ApiConsts {
static String chatUserImages = chatServerBaseUrl + "empservice/api/employee/"; static String chatUserImages = chatServerBaseUrl + "empservice/api/employee/";
//Brain Marathon Constants //Brain Marathon Constants
static String marathonBaseUrl = "https://18.188.181.12/service/"; static String marathonBaseUrl = "https://marathoon.com/service/";
static String marathonParticipantLoginUrl = marathonBaseUrl + "api/auth/participantlogin"; static String marathonParticipantLoginUrl = marathonBaseUrl + "api/auth/participantlogin";
static String marathonProjectGetUrl = marathonBaseUrl + "api/Project/Project_Get"; static String marathonProjectGetUrl = marathonBaseUrl + "api/Project/Project_Get";
static String marathonUpcomingUrl = marathonBaseUrl + "api/marathon/upcoming/"; static String marathonUpcomingUrl = marathonBaseUrl + "api/marathon/upcoming/";

@ -40,7 +40,7 @@ class DateUtil {
} }
static DateTime convertSimpleStringDateToDate(String date) { static DateTime convertSimpleStringDateToDate(String date) {
return DateFormat("MM/dd/yyyy hh:mm:ss a").parse(date); return DateFormat("MM/dd/yyyy hh:mm:ss").parse(date);
} }
static DateTime convertSimpleStringDateToDateddMMyyyy(String date) { static DateTime convertSimpleStringDateToDateddMMyyyy(String date) {

@ -9,6 +9,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/date_uitl.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/exceptions/api_exception.dart'; import 'package:mohem_flutter_app/exceptions/api_exception.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart';
@ -20,6 +21,7 @@ import 'package:mohem_flutter_app/widgets/loading_dialog.dart';
import 'package:nfc_manager/nfc_manager.dart'; import 'package:nfc_manager/nfc_manager.dart';
import 'package:nfc_manager/platform_tags.dart'; import 'package:nfc_manager/platform_tags.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
// ignore_for_file: avoid_annotating_with_dynamic // ignore_for_file: avoid_annotating_with_dynamic
class Utils { class Utils {
@ -289,7 +291,7 @@ class Utils {
String formattedDate; String formattedDate;
if (date.isNotEmpty) { if (date.isNotEmpty) {
formattedDate = date.split('T')[0]; formattedDate = date.split('T')[0];
if(!formattedDate.contains("00:00:00")) { if (!formattedDate.contains("00:00:00")) {
formattedDate = formattedDate + ' 00:00:00'; formattedDate = formattedDate + ' 00:00:00';
} }
} else { } else {
@ -298,6 +300,10 @@ class Utils {
return formattedDate; return formattedDate;
} }
static String formatDateDefault(String date) {
return DateFormat('yyyy-MM-dd').format(DateFormat('dd-MMM-yyyy').parseLoose(date));
}
static Future<DateTime> selectDate(BuildContext context, DateTime selectedDate) async { static Future<DateTime> selectDate(BuildContext context, DateTime selectedDate) async {
if (!Platform.isIOS) { if (!Platform.isIOS) {
await showCupertinoModalPopup( await showCupertinoModalPopup(
@ -326,8 +332,7 @@ class Utils {
return selectedDate; return selectedDate;
} }
static void readNFc({required Function(String) onRead}) { static void readNFc({required Function(String) onRead}) {
NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async { NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async {
print(tag.data); print(tag.data);
var f; var f;

@ -51,10 +51,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
} }
Future<void> buildHubConnection() async { Future<void> buildHubConnection() async {
hubConnection = await getHubConnection(); chatHubConnection = await getHubConnection();
await hubConnection.start()!.then((value) { await chatHubConnection.start();
print('-----------------------Hub Started For Chat------------------');
});
} }
Future<HubConnection> getHubConnection() async { Future<HubConnection> getHubConnection() async {
@ -75,18 +73,18 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
} }
void registerEvents() { void registerEvents() {
hubConnection.on("OnUpdateUserStatusAsync", changeStatus); chatHubConnection.on("OnUpdateUserStatusAsync", changeStatus);
hubConnection.on("OnDeliveredChatUserAsync", onMsgReceived); chatHubConnection.on("OnDeliveredChatUserAsync", onMsgReceived);
// hubConnection.on("OnSeenChatUserAsync", onChatSeen); // hubConnection.on("OnSeenChatUserAsync", onChatSeen);
//hubConnection.on("OnUserTypingAsync", onUserTyping); //hubConnection.on("OnUserTypingAsync", onUserTyping);
hubConnection.on("OnUserCountAsync", userCountAsync); chatHubConnection.on("OnUserCountAsync", userCountAsync);
// hubConnection.on("OnUpdateUserChatHistoryWindowsAsync", updateChatHistoryWindow); // hubConnection.on("OnUpdateUserChatHistoryWindowsAsync", updateChatHistoryWindow);
hubConnection.on("OnGetUserChatHistoryNotDeliveredAsync", chatNotDelivered); chatHubConnection.on("OnGetUserChatHistoryNotDeliveredAsync", chatNotDelivered);
hubConnection.on("OnUpdateUserChatHistoryStatusAsync", updateUserChatStatus); chatHubConnection.on("OnUpdateUserChatHistoryStatusAsync", updateUserChatStatus);
} }
void getUserRecentChats() async { void getUserRecentChats() async {
if (hubConnection.state != HubConnectionState.Connected) { if (chatHubConnection.state != HubConnectionState.Connected) {
getUserAutoLoginToken().whenComplete(() async { getUserAutoLoginToken().whenComplete(() async {
await buildHubConnection(); await buildHubConnection();
getUserRecentChats(); getUserRecentChats();
@ -127,7 +125,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
} }
Future invokeUserChatHistoryNotDeliveredAsync({required int userId}) async { Future invokeUserChatHistoryNotDeliveredAsync({required int userId}) async {
await hubConnection.invoke("GetUserChatHistoryNotDeliveredAsync", args: [userId]); await chatHubConnection.invoke("GetUserChatHistoryNotDeliveredAsync", args: [userId]);
return ""; return "";
} }
@ -194,7 +192,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void updateUserChatHistoryStatusAsync(List data) { void updateUserChatHistoryStatusAsync(List data) {
try { try {
hubConnection.invoke("UpdateUserChatHistoryStatusAsync", args: [data]); chatHubConnection.invoke("UpdateUserChatHistoryStatusAsync", args: [data]);
} catch (e) { } catch (e) {
throw e; throw e;
} }
@ -202,7 +200,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void updateUserChatHistoryOnMsg(List data) { void updateUserChatHistoryOnMsg(List data) {
try { try {
hubConnection.invoke("UpdateUserChatHistoryStatusAsync", args: [data]); chatHubConnection.invoke("UpdateUserChatHistoryStatusAsync", args: [data]);
} catch (e) { } catch (e) {
throw e; throw e;
} }
@ -486,7 +484,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
String chatData = String chatData =
'{"contant":"$msg","contantNo":"$contentNo","chatEventId":$chatEventId,"fileTypeId": $fileTypeId,"currentUserId":${AppState().chatDetails!.response!.id},"chatSource":1,"userChatHistoryLineRequestList":[{"isSeen":false,"isDelivered":false,"targetUserId":$targetUserId,"targetUserStatus":1}],"chatReplyId":$chatReplyId,"conversationId":"$chatCID"}'; '{"contant":"$msg","contantNo":"$contentNo","chatEventId":$chatEventId,"fileTypeId": $fileTypeId,"currentUserId":${AppState().chatDetails!.response!.id},"chatSource":1,"userChatHistoryLineRequestList":[{"isSeen":false,"isDelivered":false,"targetUserId":$targetUserId,"targetUserStatus":1}],"chatReplyId":$chatReplyId,"conversationId":"$chatCID"}';
await hubConnection.invoke("AddChatUserAsync", args: <Object>[json.decode(chatData)]); await chatHubConnection.invoke("AddChatUserAsync", args: <Object>[json.decode(chatData)]);
} }
void sendChatMessage(int targetUserId, String targetUserName, BuildContext context) async { void sendChatMessage(int targetUserId, String targetUserName, BuildContext context) async {

@ -8,8 +8,10 @@ import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/provider/chat_provider_model.dart'; import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
import 'package:mohem_flutter_app/ui/chat/chat_home_screen.dart'; import 'package:mohem_flutter_app/ui/chat/chat_home_screen.dart';
import 'package:mohem_flutter_app/ui/chat/favorite_users_screen.dart'; import 'package:mohem_flutter_app/ui/chat/favorite_users_screen.dart';
import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:signalr_netcore/signalr_client.dart';
class ChatHome extends StatefulWidget { class ChatHome extends StatefulWidget {
const ChatHome({Key? key}) : super(key: key); const ChatHome({Key? key}) : super(key: key);
@ -28,6 +30,13 @@ class _ChatHomeState extends State<ChatHome> {
super.initState(); super.initState();
data = Provider.of<ChatProviderModel>(context, listen: false); data = Provider.of<ChatProviderModel>(context, listen: false);
data.registerEvents(); data.registerEvents();
if (chatHubConnection.state != HubConnectionState.Connected) {
data.getUserAutoLoginToken().whenComplete(() async {
await data.buildHubConnection();
data.getUserRecentChats();
});
return;
}
if (data.searchedChats == null || data.searchedChats!.isEmpty) { if (data.searchedChats == null || data.searchedChats!.isEmpty) {
data.getUserRecentChats(); data.getUserRecentChats();
} }

@ -31,7 +31,7 @@ import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:signalr_netcore/signalr_client.dart'; import 'package:signalr_netcore/signalr_client.dart';
late HubConnection hubConnection; late HubConnection chatHubConnection;
class DashboardScreen extends StatefulWidget { class DashboardScreen extends StatefulWidget {
DashboardScreen({Key? key}) : super(key: key); DashboardScreen({Key? key}) : super(key: key);
@ -67,7 +67,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
hubConnection.stop(); chatHubConnection.stop();
} }
void _bHubCon() { void _bHubCon() {

@ -69,28 +69,28 @@ class _AppDrawerState extends State<AppDrawer> {
).expanded ).expanded
], ],
).paddingOnly(left: 14, right: 14, top: 21, bottom: 21), ).paddingOnly(left: 14, right: 14, top: 21, bottom: 21),
Row( // Row(
children: [ // children: [
Row( // Row(
children: [ // children: [
LocaleKeys.english.tr().toText14(color: AppState().isArabic(context) ? null : MyColors.textMixColor).onPress(() { // LocaleKeys.english.tr().toText14(color: AppState().isArabic(context) ? null : MyColors.textMixColor).onPress(() {
context.setLocale(const Locale("en", "US")); // context.setLocale(const Locale("en", "US"));
postLanguageChange(context); // postLanguageChange(context);
}), // }),
Container( // Container(
width: 1, // width: 1,
color: MyColors.darkWhiteColor, // color: MyColors.darkWhiteColor,
height: 16, // height: 16,
margin: const EdgeInsets.only(left: 10, right: 10), // margin: const EdgeInsets.only(left: 10, right: 10),
), // ),
LocaleKeys.arabic.tr().toText14(color: !AppState().isArabic(context) ? null : MyColors.textMixColor).onPress(() { // LocaleKeys.arabic.tr().toText14(color: !AppState().isArabic(context) ? null : MyColors.textMixColor).onPress(() {
context.setLocale(const Locale("ar", "SA")); // context.setLocale(const Locale("ar", "SA"));
postLanguageChange(context); // postLanguageChange(context);
}), // }),
], // ],
), // ),
], // ],
).paddingOnly(left: 14, right: 14, bottom: 14), // ).paddingOnly(left: 14, right: 14, bottom: 14),
const Divider( const Divider(
height: 1, height: 1,
thickness: 1, thickness: 1,

@ -143,8 +143,8 @@ class _LoginScreenState extends State<LoginScreen> {
isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool; isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool;
if (!kReleaseMode) { if (!kReleaseMode) {
// username.text = "15444"; // Maha User // username.text = "15444"; // Maha User
username.text = "15153"; // Tamer User // username.text = "15153"; // Tamer User
password.text = "Abcd@1234"; // password.text = "Abcd@1234";
// username.text = "206535"; // Hashim User // username.text = "206535"; // Hashim User
// password.text = "Namira786"; // password.text = "Namira786";

@ -23,6 +23,7 @@ import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/button/simple_button.dart'; import 'package:mohem_flutter_app/widgets/button/simple_button.dart';
import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart'; import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
import 'package:mohem_flutter_app/widgets/image_picker.dart';
import 'package:mohem_flutter_app/widgets/input_widget.dart'; import 'package:mohem_flutter_app/widgets/input_widget.dart';
class RequestSubmitScreenParams { class RequestSubmitScreenParams {
@ -49,9 +50,13 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
List<GetApprovesList> approverList = []; List<GetApprovesList> approverList = [];
List<File> attachmentFiles = []; List<File> attachmentFiles = [];
dynamic dynamicParams; dynamic dynamicParams;
String selectedEmp =""; String selectedEmp ="";
List<String> attachments = [];
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -75,16 +80,16 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
Utils.showLoading(context); Utils.showLoading(context);
List<Map<String, dynamic>> list = []; List<Map<String, dynamic>> list = [];
if (attachmentFiles.isNotEmpty) { if (attachmentFiles.isNotEmpty) {
attachmentFiles.asMap().forEach((index, value) async { attachments.asMap().forEach((index, value) async {
String type = value.path.split('.').last; String type = attachmentFiles[index].path.split('.').last;
String name = value.path.split('/').last; String name = attachmentFiles[index].path.split('/').last;
List<int> fileContent = await value.readAsBytes(); // List<int> fileContent = await value.readAsBytes();
String encodedFile = base64Encode(fileContent); // String encodedFile = base64Encode(fileContent);
list.add(AttachmentModel( list.add(AttachmentModel(
attachmentID: index, attachmentID: index,
pFILECONTENTTYPE: type, pFILECONTENTTYPE: type,
pFILENAME: name, pFILENAME: name,
pFILEDATA: encodedFile, pFILEDATA: value,
pTRANSACTIONID: params!.transactionId, pTRANSACTIONID: params!.transactionId,
).toJson()); ).toJson());
}); });
@ -276,12 +281,18 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
title.toText16().expanded, title.toText16().expanded,
6.width, 6.width,
SimpleButton(LocaleKeys.add.tr(), () async { SimpleButton(LocaleKeys.add.tr(), () async {
FilePickerResult? result = await FilePicker.platform.pickFiles(allowMultiple: true); ImageOptions.showImageOptionsNew(context, false, (String image, File file) {
if (result != null) { setState(() {
attachmentFiles = attachmentFiles + result.paths.map((path) => File(path!)).toList(); attachmentFiles.add(file);
attachmentFiles = attachmentFiles.toSet().toList(); attachments.add(image);
setState(() {}); Navigator.of(context).pop();
} });
});
// if (result != null) {
// attachmentFiles = attachmentFiles + result.paths.map((path) => File(path!)).toList();
// attachmentFiles = attachmentFiles.toSet().toList();
// setState(() {});
// }
}, fontSize: 14), }, fontSize: 14),
], ],
), ),

@ -50,6 +50,18 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
descFlexConTextTitle = genericResponseModel!.pDESCFLEXCONTEXTNAME ?? ""; descFlexConTextTitle = genericResponseModel!.pDESCFLEXCONTEXTNAME ?? "";
getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? [];
//getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList();
if (dynamicParams!.collectionNotificationList != null && dynamicParams!.collectionNotificationList!.isNotEmpty) {
getEitDffStructureList!.forEach((element) {
dynamicParams!.collectionNotificationList!.forEach((element2) {
if (element.sEGMENTNAME == element2.segmentName) {
element.fieldAnswer = element2.varchar2Value;
element.eSERVICESDV ??= ESERVICESDV();
element.eSERVICESDV!.pIDCOLUMNNAME = element2.varchar2Value;
}
});
});
}
Utils.hideLoading(context); Utils.hideLoading(context);
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {
@ -116,15 +128,22 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
for (int i = 0; i < (structureList.cHILDSEGMENTSVSSplited?.length ?? 0); i++) { for (int i = 0; i < (structureList.cHILDSEGMENTSVSSplited?.length ?? 0); i++) {
List<Map<String, dynamic>> values = [];
String segmentId = structureList.cHILDSEGMENTSVSSplited![i]; String segmentId = structureList.cHILDSEGMENTSVSSplited![i];
if (dESCFLEXCONTEXTCODE.isEmpty) dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!; if (dESCFLEXCONTEXTCODE.isEmpty) dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!;
List<GetEITDFFStructureList> filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVSSplited!.contains(segmentId)).toList() ?? []; List<GetEITDFFStructureList> filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVSSplited!.contains(segmentId)).toList() ?? [];
List<Map<String, dynamic>> values = filteredList
if (filteredList.isEmpty && structureList.cHILDSEGMENTSVSSplited!.isNotEmpty) {
segmentId = structureList.cHILDSEGMENTSVSSplited![0];
filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVSSplited!.contains(segmentId)).toList() ?? [];
}
values = filteredList
.map((e) => GetSetValuesRequestModel( .map((e) => GetSetValuesRequestModel(
sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME) sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME)
.toJson()) .toJson())
.toList(); .toList();
List<ESERVICESVS> eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values, List<ESERVICESVS> eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values,
empID: dynamicParams!.selectedEmp ?? '', parentValue: structureList.eSERVICESDV!.pVALUECOLUMNNAME); empID: dynamicParams!.selectedEmp ?? '', parentValue: structureList.eSERVICESDV!.pVALUECOLUMNNAME);
List<GetEITDFFStructureList> abc = genericResponseModel?.getEITDFFStructureList ?? []; List<GetEITDFFStructureList> abc = genericResponseModel?.getEITDFFStructureList ?? [];
@ -164,9 +183,28 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
List<Map<String, dynamic>> getSetList = getDefaultValuesIonicLogic(parent); List<Map<String, dynamic>> getSetList = getDefaultValuesIonicLogic(parent);
if (getSetList.isNotEmpty) { if (getSetList.isNotEmpty) {
ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, getSetList, dynamicParams!.selectedEmp); ESERVICESDV defaultValue =
await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, getSetList, empID: dynamicParams!.selectedEmp);
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId); int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
getEitDffStructureList![index].eSERVICESDV = defaultValue; getEitDffStructureList![index].eSERVICESDV = defaultValue;
GetEITDFFStructureList defaultValueCheck = getEitDffStructureList!.where((GetEITDFFStructureList element) => element.sEGMENTNAME == segmentId).toList().first;
if (defaultValueCheck.cHILDSEGMENTSDVSplited!.isNotEmpty && defaultValueCheck.rEADONLY == 'Y') {
getDefaultValues(defaultValueCheck);
Utils.hideLoading(context);
// GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId);
// List<Map<String, dynamic>> getSetList = getDefaultValuesIonicLogic(parent);
// ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, defaultValueCheck.dESCFLEXCONTEXTCODE!, defaultValueCheck.dESCFLEXNAME!, getSetList);
// int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
// getEitDffStructureList![index].eSERVICESDV = defaultValue;
} else if (defaultValueCheck.cHILDSEGMENTSVSSplited!.isNotEmpty && defaultValueCheck.rEADONLY == 'Y') {
calGetValueSetValues(defaultValueCheck);
Utils.hideLoading(context);
}
} else if (values.isNotEmpty) {
ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
} }
} }
await Future.delayed(const Duration(seconds: 1)); await Future.delayed(const Duration(seconds: 1));
@ -307,7 +345,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
idColName = val; idColName = val;
if (getEitDffStructureList![j].fORMATTYPE == "X") { if (getEitDffStructureList![j].fORMATTYPE == "X") {
idColName = Utils.formatDateNew(idColName!); idColName = Utils.formatDateDefault(idColName!);
// commenting to test // commenting to test
// DateTime date = DateFormat('yyyy-MM-dd').parse(idColName!); // DateTime date = DateFormat('yyyy-MM-dd').parse(idColName!);
// idColName = DateFormat('yyyy-MM-dd HH:mm:ss').format(date); // idColName = DateFormat('yyyy-MM-dd HH:mm:ss').format(date);
@ -326,7 +364,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
if (getEitDffStructureList![j].rEADONLY != "Y") { if (getEitDffStructureList![j].rEADONLY != "Y") {
var data = getEitDffStructureList![j].eSERVICESDV; var data = getEitDffStructureList![j].eSERVICESDV;
// let x = document.getElementById(getEitDffStructureList![j].aPPLICATIONCOLUMNNAME) as HTMLSelectElement; //let x = document.getElementById(getEitDffStructureList![j].aPPLICATIONCOLUMNNAME) as HTMLSelectElement;
String? text = data?.pIDCOLUMNNAME; //x.options[x.selectedIndex] ? x.options[x.selectedIndex].text : ""; String? text = data?.pIDCOLUMNNAME; //x.options[x.selectedIndex] ? x.options[x.selectedIndex].text : "";
String? val = data?.pVALUECOLUMNNAME; //x.options[x.selectedIndex] ? x.options[x.selectedIndex].value : null; String? val = data?.pVALUECOLUMNNAME; //x.options[x.selectedIndex] ? x.options[x.selectedIndex].value : null;
if ((val ?? "").isEmpty && parentsList[i].isRequired == "REQUIRED") { if ((val ?? "").isEmpty && parentsList[i].isRequired == "REQUIRED") {

@ -99,7 +99,7 @@ class _SubordinateLeaveState extends State<SubordinateLeave> {
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
var diffDays = DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATEEND!) var diffDays = DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATEEND!)
.difference(DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATESTART!)) .difference(DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATESTART!))
.inDays; .inDays + 1;
return Row( return Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

@ -43,7 +43,7 @@ class PersonalInfo extends StatelessWidget {
LocaleKeys.Payroll.tr().toText13(color: MyColors.lightGrayColor), LocaleKeys.Payroll.tr().toText13(color: MyColors.lightGrayColor),
(memberInformationList.pAYROLLNAME ?? "").toText16(), (memberInformationList.pAYROLLNAME ?? "").toText16(),
], ],
).objectContainerView(center: false).paddingAll(21), ).objectContainerView().paddingAll(21),
), ),
); );
} }

@ -95,7 +95,7 @@ class _AnnouncementsState extends State<Announcements> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(AppState().isArabic(context) ? _foundAnnouncements[index].titleAR! : getAnnouncementsObject[index].titleEN!).toText13(), (AppState().isArabic(context) ? _foundAnnouncements[index].titleAR! : _foundAnnouncements[index].titleEN!).toText13(),
8.height, 8.height,
_foundAnnouncements[index].created!.toText10(color: MyColors.grey98Color) _foundAnnouncements[index].created!.toText10(color: MyColors.grey98Color)
], ],

@ -35,6 +35,7 @@ class ItgDetailScreen extends StatefulWidget {
class _ItgDetailScreenState extends State<ItgDetailScreen> { class _ItgDetailScreenState extends State<ItgDetailScreen> {
int tabIndex = 0; int tabIndex = 0;
int animationIndex = 0;
PageController controller = PageController(); PageController controller = PageController();
bool showFabOptions = false; bool showFabOptions = false;
@ -82,6 +83,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
void getDataFromState() { void getDataFromState() {
if (requestDetails == null) { if (requestDetails == null) {
animationIndex = animationIndex + 1;
requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel;
providerData.itgFormsModel!.totalCount = providerData.itgFormsModel!.totalCount! - 1; providerData.itgFormsModel!.totalCount = providerData.itgFormsModel!.totalCount! - 1;
getItgData(); getItgData();
@ -95,151 +97,170 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
return Scaffold( return Scaffold(
appBar: AppBarWidget(context, title: LocaleKeys.details.tr()), appBar: AppBarWidget(context, title: LocaleKeys.details.tr()),
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: Stack( body: AnimatedSwitcher(
children: [ duration: const Duration(milliseconds: 500),
Column( switchInCurve: Curves.easeInToLinear,
children: [ transitionBuilder: (Widget child, Animation<double> animation) {
Container( Animation<Offset> custom = Tween<Offset>(
padding: const EdgeInsets.only(left: 21, right: 21, top: 16, bottom: 16), begin: const Offset(1.0, 0.0),
decoration: const BoxDecoration( end: Offset.zero,
borderRadius: BorderRadius.only( ).animate(animation);
bottomLeft: Radius.circular(25), return ClipRect(
bottomRight: Radius.circular(25), child: SlideTransition(
position: custom,
child: child,
// textDirection: TextDirection.ltr,
),
);
},
child: Stack(
key: ValueKey(animationIndex),
children: [
Column(
children: [
Container(
padding: const EdgeInsets.only(left: 21, right: 21, top: 16, bottom: 16),
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(25),
bottomRight: Radius.circular(25),
),
gradient: LinearGradient(
transform: GradientRotation(.83),
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [
MyColors.gradiantEndColor,
MyColors.gradiantStartColor,
],
),
), ),
gradient: LinearGradient( child: Row(
transform: GradientRotation(.83), children: [
begin: Alignment.topRight, myTab(LocaleKeys.requestDetails.tr(), 0),
end: Alignment.bottomLeft, myTab(LocaleKeys.approvalLevel.tr(), 1),
colors: [ myTab(LocaleKeys.requesterDetails.tr(), 2),
MyColors.gradiantEndColor,
MyColors.gradiantStartColor,
], ],
), ),
), ),
child: Row( PageView(
controller: controller,
onPageChanged: (pageIndex) {
setState(() {
tabIndex = pageIndex;
});
},
children: [ children: [
myTab(LocaleKeys.requestDetails.tr(), 0), RequestDetailFragment(fields: itgRequest?.fieldGoups?[1].fields ?? []),
myTab(LocaleKeys.approvalLevel.tr(), 1), ApprovalLevelfragment(
myTab(LocaleKeys.requesterDetails.tr(), 2), wFHistory: itgRequest?.wFHistory ?? [],
voidCallback: reloadITG,
),
RequestDetailFragment(fields: itgRequest?.fieldGoups?[0].fields ?? []),
], ],
), ).expanded,
), if (isApproveAvailable || isRejectAvailable || isCloseAvailable)
PageView( Container(
controller: controller, padding: const EdgeInsets.only(top: 14, bottom: 14, left: 21, right: 21),
onPageChanged: (pageIndex) { decoration: const BoxDecoration(
setState(() { color: Colors.white,
tabIndex = pageIndex; border: Border(
}); top: BorderSide(
}, color: MyColors.lightGreyEFColor,
children: [ width: 1.0,
RequestDetailFragment(fields: itgRequest?.fieldGoups?[1].fields ?? []), ),
ApprovalLevelfragment(
wFHistory: itgRequest?.wFHistory ?? [],
voidCallback: reloadITG,
),
RequestDetailFragment(fields: itgRequest?.fieldGoups?[0].fields ?? []),
],
).expanded,
if (isApproveAvailable || isRejectAvailable || isCloseAvailable)
Container(
padding: const EdgeInsets.only(top: 14, bottom: 14, left: 21, right: 21),
decoration: const BoxDecoration(
color: Colors.white,
border: Border(
top: BorderSide(
color: MyColors.lightGreyEFColor,
width: 1.0,
), ),
), ),
), child: Row(
child: Row( children: [
if (isRejectAvailable)
DefaultButton(
LocaleKeys.reject.tr(),
() => performAction("REJECTED"),
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),
],
).expanded,
if (isCloseAvailable)
DefaultButton(
LocaleKeys.ok.tr(),
() => performAction("CLOSE"),
colors: const [
Color(0xff32D892),
Color(0xff1AB170),
],
).expanded,
8.width,
Container(
height: 43,
width: 43,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: MyColors.lightGreyE6Color,
),
child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor),
).onPress(() {
setState(() {
showFabOptions = true;
});
})
],
),
)
],
),
IgnorePointer(
ignoring: !showFabOptions,
child: AnimatedOpacity(
opacity: showFabOptions ? 1 : 0,
duration: const Duration(milliseconds: 250),
child: Container(
padding: const EdgeInsets.only(left: 21, right: 21, bottom: 75 - 12),
width: double.infinity,
height: double.infinity,
color: Colors.white.withOpacity(.67),
alignment: Alignment.bottomRight,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
if (isRejectAvailable) myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() {
DefaultButton( if (AppState().requestAllList!.length - 1 > AppState().itgWorkListIndex!) {
LocaleKeys.reject.tr(), animationIndex = animationIndex + 1;
() => performAction("REJECTED"), AppState().itgWorkListIndex = AppState().itgWorkListIndex! + 1;
colors: const [ requestDetails = null;
Color(0xffE47A7E), itgRequest = null;
Color(0xffDE6D71), tabIndex = 0;
], showFabOptions = false;
).expanded, getDataFromState();
if (isApproveAvailable && isRejectAvailable) 8.width, } else if (AppState().requestAllList!.length - 1 == AppState().itgWorkListIndex!) {
if (isApproveAvailable) Navigator.pop(context);
DefaultButton( }
LocaleKeys.approve.tr(), }),
() => performAction("APPROVED"), 12.height,
colors: const [ ...viewApiButtonsList(allowedActionList),
Color(0xff28C884),
Color(0xff1BB271),
],
).expanded,
if (isCloseAvailable)
DefaultButton(
LocaleKeys.ok.tr(),
() => performAction("CLOSE"),
colors: const [
Color(0xff32D892),
Color(0xff1AB170),
],
).expanded,
8.width,
Container(
height: 43,
width: 43,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: MyColors.lightGreyE6Color,
),
child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor),
).onPress(() {
setState(() {
showFabOptions = true;
});
})
], ],
), ),
)
],
),
IgnorePointer(
ignoring: !showFabOptions,
child: AnimatedOpacity(
opacity: showFabOptions ? 1 : 0,
duration: const Duration(milliseconds: 250),
child: Container(
padding: const EdgeInsets.only(left: 21, right: 21, bottom: 75 - 12),
width: double.infinity,
height: double.infinity,
color: Colors.white.withOpacity(.67),
alignment: Alignment.bottomRight,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() {
if (AppState().requestAllList!.length - 1 > AppState().itgWorkListIndex!) {
AppState().itgWorkListIndex = AppState().itgWorkListIndex! + 1;
requestDetails = null;
itgRequest = null;
tabIndex = 0;
showFabOptions = false;
getDataFromState();
} else if (AppState().requestAllList!.length - 1 == AppState().itgWorkListIndex!) {
Navigator.pop(context);
}
}),
12.height,
...viewApiButtonsList(allowedActionList),
],
), ),
), ).onPress(() {
).onPress(() { setState(() {
setState(() { showFabOptions = false;
showFabOptions = false; });
}); }),
}), ),
), ],
], ),
), ),
floatingActionButton: (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable) floatingActionButton: (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable)
? Container( ? Container(
@ -514,6 +535,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
// Navigator.pop(context, "delegate_reload"); // Navigator.pop(context, "delegate_reload");
animationIndex=animationIndex+1;
AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!); AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!);
if (AppState().requestAllList!.isEmpty) { if (AppState().requestAllList!.isEmpty) {
Navigator.pop(context, "delegate_reload"); Navigator.pop(context, "delegate_reload");
@ -534,9 +556,11 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
void performDataCorrectionORReportGeneratedAction(String requestType, int taskId, int itemId, String employeeNumber) async { void performDataCorrectionORReportGeneratedAction(String requestType, int taskId, int itemId, String employeeNumber) async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
animationIndex = animationIndex + 1;
ITGRequest? itgRequest = await WorkListApiClient().grantITGRequest(requestType, taskId, itemId, employeeNumber, "", ""); ITGRequest? itgRequest = await WorkListApiClient().grantITGRequest(requestType, taskId, itemId, employeeNumber, "", "");
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!); AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!);
if (AppState().requestAllList!.isEmpty) { if (AppState().requestAllList!.isEmpty) {
Navigator.pop(context, "delegate_reload"); Navigator.pop(context, "delegate_reload");
@ -555,6 +579,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
} }
void reloadITG() { void reloadITG() {
animationIndex = animationIndex + 1;
AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!); AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!);
if (AppState().requestAllList!.isEmpty) { if (AppState().requestAllList!.isEmpty) {
Navigator.pop(context, "delegate_reload"); Navigator.pop(context, "delegate_reload");

@ -528,7 +528,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
10.height, 10.height,
Row( Row(
children: [ children: [
DateUtil.formatDateToDate(DateUtil.convertSimpleStringDateToDate(workData.bEGINDATE!), false).toText10(color: MyColors.lightTextColor).expanded, DateUtil.formatDateToDate(DateUtil.convertSimpleStringDateToDateddMMyyyy(workData.bEGINDATE!), false).toText10(color: MyColors.lightTextColor).expanded,
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: 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)),
], ],
), ),

@ -55,6 +55,7 @@ class WorkListDetailScreen extends StatefulWidget {
class _WorkListDetailScreenState extends State<WorkListDetailScreen> { class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
int tabIndex = 0; int tabIndex = 0;
int animationIndex = 0;
PageController controller = PageController(); PageController controller = PageController();
bool showFabOptions = false; bool showFabOptions = false;
@ -146,7 +147,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getPRNotification(); getPRNotification();
} }
controller.jumpToPage(0); if (controller.hasClients) {
controller.jumpToPage(0);
}
// List dataToFetch = await Future.wait([ // List dataToFetch = await Future.wait([
// //
@ -187,7 +190,6 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
getDataFromState(); getDataFromState();
return Scaffold( return Scaffold(
appBar: AppBarWidget(context, title: LocaleKeys.details.tr()), appBar: AppBarWidget(context, title: LocaleKeys.details.tr()),
backgroundColor: Colors.white, backgroundColor: Colors.white,
@ -208,7 +210,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
); );
}, },
child: Stack( child: Stack(
key: ValueKey(AppState().workListIndex ?? 0), key: ValueKey(animationIndex),
children: [ children: [
Column( Column(
children: [ children: [
@ -231,9 +233,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
), ),
child: Row( child: Row(
children: [ children: [
myTab(LocaleKeys.info.tr(), 0), (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") ? myTab(LocaleKeys.details.tr(), 0) : myTab(LocaleKeys.request.tr(), 0),
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") ? myTab(LocaleKeys.details.tr(), 1) : myTab(LocaleKeys.request.tr(), 1), myTab(LocaleKeys.actions.tr(), 1),
myTab(LocaleKeys.actions.tr(), 2), myTab(LocaleKeys.info.tr(), 2),
myTab(LocaleKeys.attachments.tr(), 3), myTab(LocaleKeys.attachments.tr(), 3),
], ],
), ),
@ -241,25 +243,12 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if ((workListData?.sUBJECT ?? "").isNotEmpty) workListData!.sUBJECT!.toText14().paddingOnly(top: 20, right: 21, left: 21), if ((workListData?.sUBJECT ?? "").isNotEmpty) workListData!.sUBJECT!.toText14().paddingOnly(top: 20, right: 21, left: 21),
PageView( PageView(
controller: controller, controller: controller,
onPageChanged: (int pageIndex) { onPageChanged: (pageIndex) {
setState(() { setState(() {
tabIndex = pageIndex; tabIndex = pageIndex;
}); });
}, },
children: [ children: [
InfoFragment(
poHeaderList: getPoNotificationBody?.pOHeader ?? [],
workListData: workListData,
itemCreationHeader: getItemCreationNtfBody?.itemCreationHeader ?? [],
getStampMsNotifications: getStampMsNotifications,
getStampNsNotifications: getStampNsNotifications,
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList,
getPhonesNotificationBodyList: getPhonesNotificationBodyList,
getBasicDetNtfBodyList: getBasicDetNtfBodyList,
getAbsenceCollectionNotificationBodyList: getAbsenceCollectionNotificationBodyList,
getContactNotificationBodyList: getContactNotificationBodyList,
getPrNotificationBodyList: getPrNotificationBody,
),
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP")
? DetailFragment(workListData, memberInformationListModel) ? DetailFragment(workListData, memberInformationListModel)
: RequestFragment( : RequestFragment(
@ -277,6 +266,19 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
voidCallback: reloadWorkList, voidCallback: reloadWorkList,
) )
: showLoadingAnimation(), : showLoadingAnimation(),
InfoFragment(
poHeaderList: getPoNotificationBody?.pOHeader ?? [],
workListData: workListData,
itemCreationHeader: getItemCreationNtfBody?.itemCreationHeader ?? [],
getStampMsNotifications: getStampMsNotifications,
getStampNsNotifications: getStampNsNotifications,
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList,
getPhonesNotificationBodyList: getPhonesNotificationBodyList,
getBasicDetNtfBodyList: getBasicDetNtfBodyList,
getAbsenceCollectionNotificationBodyList: getAbsenceCollectionNotificationBodyList,
getContactNotificationBodyList: getContactNotificationBodyList,
getPrNotificationBodyList: getPrNotificationBody,
),
isAttachmentLoaded isAttachmentLoaded
? getAttachmentList.isEmpty ? getAttachmentList.isEmpty
? Utils.getNoDataWidget(context) ? Utils.getNoDataWidget(context)
@ -350,6 +352,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
children: [ children: [
myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() { myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() {
if (AppState().workList!.length - 1 > AppState().workListIndex!) { if (AppState().workList!.length - 1 > AppState().workListIndex!) {
animationIndex = animationIndex + 1;
AppState().setWorkListIndex = AppState().workListIndex! + 1; AppState().setWorkListIndex = AppState().workListIndex! + 1;
workListData = null; workListData = null;
showFabOptions = false; showFabOptions = false;
@ -564,7 +567,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async { Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext cxt) => ConfirmDialog( builder: (cxt) => ConfirmDialog(
message: LocaleKeys.wantToReject.tr(), message: LocaleKeys.wantToReject.tr(),
okTitle: LocaleKeys.reject.tr(), okTitle: LocaleKeys.reject.tr(),
onTap: () async { onTap: () async {
@ -647,12 +650,12 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
print(actionMode); print(actionMode);
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext cxt) => AcceptRejectInputDialog( builder: (cxt) => AcceptRejectInputDialog(
message: title != null ? null : LocaleKeys.requestedItems.tr(), message: title != null ? null : LocaleKeys.requestedItems.tr(),
title: title, title: title,
notificationGetRespond: notificationNoteInput, notificationGetRespond: notificationNoteInput,
actionMode: actionMode, actionMode: actionMode,
onTap: (String note) { onTap: (note) {
Map<String, dynamic> payload = { Map<String, dynamic> payload = {
"P_ACTION_MODE": actionMode, "P_ACTION_MODE": actionMode,
"P_APPROVER_INDEX": null, "P_APPROVER_INDEX": null,
@ -685,6 +688,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload); GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload);
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
animationIndex=animationIndex+1;
AppState().workList!.removeAt(AppState().workListIndex!); AppState().workList!.removeAt(AppState().workListIndex!);
if (AppState().workList!.isEmpty) { if (AppState().workList!.isEmpty) {
Navigator.pop(context, "delegate_reload"); Navigator.pop(context, "delegate_reload");
@ -703,6 +707,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
} }
void reloadWorkList() { void reloadWorkList() {
animationIndex = animationIndex + 1;
AppState().workList!.removeAt(AppState().workListIndex!); AppState().workList!.removeAt(AppState().workListIndex!);
if (AppState().workList!.isEmpty) { if (AppState().workList!.isEmpty) {
Navigator.pop(context, "delegate_reload"); Navigator.pop(context, "delegate_reload");
@ -933,9 +938,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
apiCallCount++; apiCallCount++;
notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!); notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!);
if (notificationButtonsList.isNotEmpty) { if (notificationButtonsList.isNotEmpty) {
isCloseAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "CLOSE"); isCloseAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "CLOSE");
isApproveAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "APPROVED"); isApproveAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "APPROVED");
isRejectAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "REJECTED"); isRejectAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "REJECTED");
} }
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {

@ -46,6 +46,7 @@ class _DetailFragmentState extends State<DetailFragment> {
], ],
).objectContainerView(), ).objectContainerView(),
12.height, 12.height,
widget.memberInformationListModel != null ?
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -69,7 +70,7 @@ class _DetailFragmentState extends State<DetailFragment> {
isItLast: true, isItLast: true,
), ),
], ],
).objectContainerView(), ).objectContainerView() : Container(),
], ],
).paddingAll(21), ).paddingAll(21),
); );

@ -21,7 +21,7 @@ AppBar AppBarWidget(BuildContext context,
children: [ children: [
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: Feedback.wrapForTap(() => Navigator.maybePop(context, true), context), onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context),
child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
), ),
4.width, 4.width,

Loading…
Cancel
Save