Merge branch 'development_haroon' into 'master'

Development haroon

See merge request Cloud_Solution/mohemm-flutter-app!101
sultan-dev
haroon amjad 3 years ago
commit 72a32c8176

@ -3,6 +3,7 @@ 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://erptstapp.srca.org.sa"; // SRCA 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

@ -37,7 +37,7 @@ class Utils {
timeInSecForIosWeb: 1, timeInSecForIosWeb: 1,
backgroundColor: Colors.black54, backgroundColor: Colors.black54,
textColor: Colors.white, textColor: Colors.white,
fontSize: 16.0); fontSize: 13.0);
} }
static dynamic getNotNullValue(List<dynamic> list, int index) { static dynamic getNotNullValue(List<dynamic> list, int index) {
@ -121,8 +121,8 @@ class Utils {
), ),
); );
} else { } else {
// showToast(errorMessage); showToast(errorMessage);
confirmDialog(cxt, errorMessage); // confirmDialog(cxt, errorMessage);
} }
} }
} }

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:logger/logger.dart'; import 'package:logger/logger.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/consts.dart'; import 'package:mohem_flutter_app/classes/consts.dart';
@ -37,6 +38,10 @@ bool isTablet = false;
Future<void> main() async { Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
await EasyLocalization.ensureInitialized(); await EasyLocalization.ensureInitialized();
AppState().setPostParamsInitConfig(); AppState().setPostParamsInitConfig();
HttpOverrides.global = MyHttpOverrides(); HttpOverrides.global = MyHttpOverrides();

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

@ -48,7 +48,7 @@ class MemberInformationListModel {
String? nATIONALITYCODE; String? nATIONALITYCODE;
String? nATIONALITYMEANING; String? nATIONALITYMEANING;
String? nATIONALIDENTIFIER; String? nATIONALIDENTIFIER;
String? nORMALHOURS; dynamic? nORMALHOURS;
int? nOOFROWS; int? nOOFROWS;
int? oRGANIZATIONID; int? oRGANIZATIONID;
String? oRGANIZATIONNAME; String? oRGANIZATIONNAME;

@ -38,23 +38,22 @@ class _ChatHomeState extends State<ChatHome> {
data.clearAll(); data.clearAll();
} }
// void fetchAgain() { void fetchAgain() {
// print("Fetch Triggered"); if (chatHubConnection.state != HubConnectionState.Connected) {
// if (chatHubConnection.state != HubConnectionState.Connected) { data.getUserAutoLoginToken().whenComplete(() async {
// data.getUserAutoLoginToken().whenComplete(() async { await data.buildHubConnection();
// await data.buildHubConnection(); data.getUserRecentChats();
// data.getUserRecentChats(); });
// }); return;
// return; }
// } if (data.searchedChats == null || data.searchedChats!.isEmpty) {
// if (data.searchedChats == null || data.searchedChats!.isEmpty) { data.getUserRecentChats();
// data.getUserRecentChats(); }
// } }
// }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// fetchAgain(); fetchAgain();
return Scaffold( return Scaffold(
backgroundColor: MyColors.white, backgroundColor: MyColors.white,
appBar: AppBarWidget(context, title: LocaleKeys.chat.tr(), showHomeButton: true), appBar: AppBarWidget(context, title: LocaleKeys.chat.tr(), showHomeButton: true),

@ -58,7 +58,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
data = Provider.of<DashboardProviderModel>(context, listen: false); data = Provider.of<DashboardProviderModel>(context, listen: false);
marathonProvider = Provider.of<MarathonProvider>(context, listen: false); marathonProvider = Provider.of<MarathonProvider>(context, listen: false);
cProvider = Provider.of<ChatProviderModel>(context, listen: false); cProvider = Provider.of<ChatProviderModel>(context, listen: false);
_bHubCon();
_onRefresh(); _onRefresh();
}); });
} }
@ -80,6 +79,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
void _onRefresh() async { void _onRefresh() async {
data.initProvider(); data.initProvider();
_bHubCon();
// data.getITGNotification().then((value) { // data.getITGNotification().then((value) {
// print("--------------------detail_1-----------------"); // print("--------------------detail_1-----------------");
// print(value!.result!.data!.notificationMasterId); // print(value!.result!.data!.notificationMasterId);
@ -199,7 +199,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color), LocaleKeys.welcomeBack.tr().toText14(color: MyColors.grey77Color),
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true), (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true),
16.height, 16.height,
Row( Row(

@ -96,7 +96,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
} }
void validateAbsenceTransaction(selectedID) async { void validateAbsenceTransaction(selectedID) async {
//try { try {
Utils.showLoading(context); Utils.showLoading(context);
Map<String, String?> dffDataMap = {}; Map<String, String?> dffDataMap = {};
for (int i = 1; i <= 20; i++) { for (int i = 1; i <= 20; i++) {
@ -145,10 +145,10 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
} }
await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!); await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!);
Utils.hideLoading(context); Utils.hideLoading(context);
// } catch (ex) { } catch (ex) {
// Utils.hideLoading(context); Utils.hideLoading(context);
// Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
// } }
} }
@override @override

@ -160,7 +160,7 @@ class _ContactDetailsState extends State<ContactDetails> {
right: 1, right: 1,
child: const Icon(Icons.add_location_alt_outlined, size: 20).onPress(continueDynamicForms), child: const Icon(Icons.add_location_alt_outlined, size: 20).onPress(continueDynamicForms),
), ),
Utils.getNoDataWidget(context).expanded, Utils.getNoDataWidget(context),
], ],
).objectContainerView() ).objectContainerView()
], ],

@ -106,6 +106,19 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
void getData() async { void getData() async {
// try { // try {
// Utils.showLoading(context); // Utils.showLoading(context);
getEitCollectionNotificationBodyList!.clear();
getAbsenceCollectionNotificationBodyList!.clear();
getPrNotificationBody = null;
getStampMsNotifications.clear();
getStampNsNotifications.clear();
getPoNotificationBody?.pOHeader!.clear();
getItemCreationNtfBody?.itemCreationHeader!.clear();
getPhonesNotificationBodyList!.clear();
getBasicDetNtfBodyList!.clear();
getAbsenceCollectionNotificationBodyList!.clear();
getContactNotificationBodyList = null;
if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") { if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") {
getUserInformation(); getUserInformation();
} }
@ -688,7 +701,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; 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");
@ -725,6 +738,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getEitCollectionNotificationBodyList!.clear();
getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID); getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
@ -742,6 +756,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
memberInformationListModel = null;
memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!); memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
@ -759,6 +774,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getPhonesNotificationBodyList!.clear();
getPhonesNotificationBodyList = await WorkListApiClient().getPhonesNotificationBodyList(workListData!.nOTIFICATIONID); getPhonesNotificationBodyList = await WorkListApiClient().getPhonesNotificationBodyList(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
@ -776,6 +792,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getBasicDetNtfBodyList!.clear();
getBasicDetNtfBodyList = await WorkListApiClient().getBasicDetNtfBodyList(workListData!.nOTIFICATIONID); getBasicDetNtfBodyList = await WorkListApiClient().getBasicDetNtfBodyList(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
@ -793,6 +810,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getAbsenceCollectionNotificationBodyList!.clear();
getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID); getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
@ -916,6 +934,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getNotificationRespondAttributes.clear();
getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!); getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!);
if (getNotificationRespondAttributes.isNotEmpty) { if (getNotificationRespondAttributes.isNotEmpty) {
notificationNoteInput = getNotificationRespondAttributes.first; notificationNoteInput = getNotificationRespondAttributes.first;
@ -936,6 +955,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
notificationButtonsList.clear();
notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!); notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!);
if (notificationButtonsList.isNotEmpty) { if (notificationButtonsList.isNotEmpty) {
isCloseAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "CLOSE"); isCloseAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "CLOSE");

Loading…
Cancel
Save