Dashboard API's 1.0

merge-requests/1/merge
devmirza121 4 years ago
parent ab25a98a9e
commit baa7182655

@ -75,6 +75,9 @@ class ApiClient {
}
var response = await postJsonForResponse(url, jsonObject, token: token, queryParameters: queryParameters, headers: _headers, retryTimes: retryTimes);
try {
if (!kReleaseMode) {
print("res: " + response.body);
}
var jsonData = jsonDecode(response.body);
if (jsonData["ErrorMessage"] == null) {
return factoryConstructor(jsonData);

@ -0,0 +1,69 @@
import 'dart:async';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/models/basic_member_information_model.dart';
import 'package:mohem_flutter_app/models/check_mobile_app_version_model.dart';
import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/member_login_list_model.dart';
import 'api_client.dart';
class DashbaordApiClient {
static final DashbaordApiClient _instance = DashbaordApiClient._internal();
DashbaordApiClient._internal();
factory DashbaordApiClient() => _instance;
Future<GenericResponseModel?> getAttendanceTracking() async {
String url = "${ApiConsts.erpRest}GET_Attendance_Tracking";
Map<String, dynamic> postParams = {};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData;
}, url, postParams);
}
Future<GenericResponseModel?> getOpenNotifications() async {
String url = "${ApiConsts.erpRest}GET_OPEN_NOTIFICATIONS";
Map<String, dynamic> postParams = {};
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 = {};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
ItgFormsModel responseData = ItgFormsModel.fromJson(json);
return responseData;
}, url, postParams);
}
Future<GenericResponseModel?> getAccrualBalances() async {
String url = "${ApiConsts.erpRest}GET_ACCRUAL_BALANCES";
Map<String, dynamic> postParams = {"P_EFFECTIVE_DATE": "1/30/2022"};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData;
}, url, postParams);
}
Future<GenericResponseModel?> getOpenMissingSwipes() async {
String url = "${ApiConsts.erpRest}GET_OPEN_MISSING_SWIPES";
Map<String, dynamic> postParams = {};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData;
}, url, postParams);
}
}

@ -47,7 +47,14 @@ class LoginApiClient {
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
AppState().setLogged = true;
AppState().postParamsObject?.setTokenID = responseData.tokenID;
AppState().postParamsObject?.mobileNumber = responseData.basicMemberInformation!.pMOBILENUMBER;
AppState().postParamsObject?.userName = AppState().getUserName;
AppState().postParamsObject?.pEmailAddress = responseData.basicMemberInformation!.pEMAILADDRESS;
AppState().postParamsObject?.pSessionId = responseData.pSESSIONID;
AppState().postParamsObject?.pUserName = AppState().getUserName;
AppState().postParamsObject?.pSelectedEmployeeNumber = AppState().getUserName;
return responseData;
}, url, postParams);
}

@ -8,6 +8,12 @@ class AppState {
factory AppState() => _instance;
bool isLogged = false;
set setLogged(v) => isLogged = v;
bool? get getIsLogged => isLogged;
String? forgetPasswordTokenID;
set setForgetPasswordTokenID(token) => forgetPasswordTokenID = token;
@ -18,15 +24,17 @@ class AppState {
PostParamsModel? get postParamsObject => _postParams;
Map<String, dynamic> get postParamsJson => _postParams?.toJson() ?? {};
Map<String, dynamic> get postParamsJson => isLogged ? (_postParams?.toJsonAfterLogin() ?? {}) : (_postParams?.toJson() ?? {});
void setPostParamsModel(PostParamsModel _postParams) {
this._postParams = _postParams;
}
String? username;
String? _username;
set setUserName(v) => _username = v;
set setUserName(_username) => username = _username;
String? get getUserName => _username;
MemberLoginListModel? _memberLoginList;

@ -6,8 +6,11 @@ class ApiConsts {
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";
static String erpRest = baseUrlServices + "ERP.svc/REST/";
static String user = baseUrlServices + "api/User/";
static String cocRest = baseUrlServices + "COCWS.svc/REST/";
}
class GlobalConsts {
static String isRememberMe = "remember_me";
static String email = "email";

@ -0,0 +1,39 @@
class GetAccrualBalancesList {
GetAccrualBalancesList({
this.accrualNetEntitlement,
this.accrualUsedEntitlement,
this.accrualYearlyEntitlement,
this.accuralPlanName,
this.endDate,
this.lastAccrualDate,
this.startDate,
});
double? accrualNetEntitlement;
int? accrualUsedEntitlement;
dynamic accrualYearlyEntitlement;
String? accuralPlanName;
String? endDate;
String? lastAccrualDate;
String? startDate;
factory GetAccrualBalancesList.fromJson(Map<String, dynamic> json) => GetAccrualBalancesList(
accrualNetEntitlement: json["ACCRUAL_NET_ENTITLEMENT"] == null ? null : json["ACCRUAL_NET_ENTITLEMENT"].toDouble(),
accrualUsedEntitlement: json["ACCRUAL_USED_ENTITLEMENT"] == null ? null : json["ACCRUAL_USED_ENTITLEMENT"],
accrualYearlyEntitlement: json["ACCRUAL_YEARLY_ENTITLEMENT"],
accuralPlanName: json["ACCURAL_PLAN_NAME"] == null ? null : json["ACCURAL_PLAN_NAME"],
endDate: json["END_DATE"] == null ? null : json["END_DATE"],
lastAccrualDate: json["LAST_ACCRUAL_DATE"] == null ? null : json["LAST_ACCRUAL_DATE"],
startDate: json["START_DATE"] == null ? null : json["START_DATE"],
);
Map<String, dynamic> toJson() => {
"ACCRUAL_NET_ENTITLEMENT": accrualNetEntitlement == null ? null : accrualNetEntitlement,
"ACCRUAL_USED_ENTITLEMENT": accrualUsedEntitlement == null ? null : accrualUsedEntitlement,
"ACCRUAL_YEARLY_ENTITLEMENT": accrualYearlyEntitlement,
"ACCURAL_PLAN_NAME": accuralPlanName == null ? null : accuralPlanName,
"END_DATE": endDate == null ? null : endDate,
"LAST_ACCRUAL_DATE": lastAccrualDate == null ? null : lastAccrualDate,
"START_DATE": startDate == null ? null : startDate,
};
}

@ -0,0 +1,55 @@
class GetAttendanceTrackingList {
GetAttendanceTrackingList({
this.pBreakHours,
this.pLateInHours,
this.pRemainingHours,
this.pReturnMsg,
this.pReturnStatus,
this.pScheduledHours,
this.pShtName,
this.pSpentHours,
this.pSwipesExemptedFlag,
this.pSwipeIn,
this.pSwipeOut,
});
String? pBreakHours;
String? pLateInHours;
String? pRemainingHours;
String? pReturnMsg;
String? pReturnStatus;
String? pScheduledHours;
String? pShtName;
String? pSpentHours;
String? pSwipesExemptedFlag;
dynamic pSwipeIn;
dynamic pSwipeOut;
factory GetAttendanceTrackingList.fromMap(Map<String, dynamic> json) => GetAttendanceTrackingList(
pBreakHours: json["P_BREAK_HOURS"] == null ? null : json["P_BREAK_HOURS"],
pLateInHours: json["P_LATE_IN_HOURS"] == null ? null : json["P_LATE_IN_HOURS"],
pRemainingHours: json["P_REMAINING_HOURS"] == null ? null : json["P_REMAINING_HOURS"],
pReturnMsg: json["P_RETURN_MSG"] == null ? null : json["P_RETURN_MSG"],
pReturnStatus: json["P_RETURN_STATUS"] == null ? null : json["P_RETURN_STATUS"],
pScheduledHours: json["P_SCHEDULED_HOURS"] == null ? null : json["P_SCHEDULED_HOURS"],
pShtName: json["P_SHT_NAME"] == null ? null : json["P_SHT_NAME"],
pSpentHours: json["P_SPENT_HOURS"] == null ? null : json["P_SPENT_HOURS"],
pSwipesExemptedFlag: json["P_SWIPES_EXEMPTED_FLAG"] == null ? null : json["P_SWIPES_EXEMPTED_FLAG"],
pSwipeIn: json["P_SWIPE_IN"],
pSwipeOut: json["P_SWIPE_OUT"],
);
Map<String, dynamic> toMap() => {
"P_BREAK_HOURS": pBreakHours == null ? null : pBreakHours,
"P_LATE_IN_HOURS": pLateInHours == null ? null : pLateInHours,
"P_REMAINING_HOURS": pRemainingHours == null ? null : pRemainingHours,
"P_RETURN_MSG": pReturnMsg == null ? null : pReturnMsg,
"P_RETURN_STATUS": pReturnStatus == null ? null : pReturnStatus,
"P_SCHEDULED_HOURS": pScheduledHours == null ? null : pScheduledHours,
"P_SHT_NAME": pShtName == null ? null : pShtName,
"P_SPENT_HOURS": pSpentHours == null ? null : pSpentHours,
"P_SWIPES_EXEMPTED_FLAG": pSwipesExemptedFlag == null ? null : pSwipesExemptedFlag,
"P_SWIPE_IN": pSwipeIn,
"P_SWIPE_OUT": pSwipeOut,
};
}

@ -0,0 +1,24 @@
class GetOpenMissingSwipesList {
GetOpenMissingSwipesList({
this.pOpenMissingSwipes,
this.pReturnMsg,
this.pReturnStatus,
});
int? pOpenMissingSwipes;
String? pReturnMsg;
String? pReturnStatus;
factory GetOpenMissingSwipesList.fromJson(Map<String, dynamic> json) => GetOpenMissingSwipesList(
pOpenMissingSwipes: json["P_OPEN_MISSING_SWIPES"] == null ? null : json["P_OPEN_MISSING_SWIPES"],
pReturnMsg: json["P_RETURN_MSG"] == null ? null : json["P_RETURN_MSG"],
pReturnStatus: json["P_RETURN_STATUS"] == null ? null : json["P_RETURN_STATUS"],
);
Map<String, dynamic> toJson() => {
"P_OPEN_MISSING_SWIPES": pOpenMissingSwipes == null ? null : pOpenMissingSwipes,
"P_RETURN_MSG": pReturnMsg == null ? null : pReturnMsg,
"P_RETURN_STATUS": pReturnStatus == null ? null : pReturnStatus,
};
}

@ -0,0 +1,23 @@
class GetOpenNotificationsList {
GetOpenNotificationsList({
this.itemType,
this.itemTypeDisplayName,
this.openNtfNumber,
});
String? itemType;
String? itemTypeDisplayName;
int? openNtfNumber;
factory GetOpenNotificationsList.fromMap(Map<String, dynamic> json) => GetOpenNotificationsList(
itemType: json["ITEM_TYPE"] == null ? null : json["ITEM_TYPE"],
itemTypeDisplayName: json["ITEM_TYPE_DISPLAY_NAME"] == null ? null : json["ITEM_TYPE_DISPLAY_NAME"],
openNtfNumber: json["OPEN_NTF_NUMBER"] == null ? null : json["OPEN_NTF_NUMBER"],
);
Map<String, dynamic> toMap() => {
"ITEM_TYPE": itemType == null ? null : itemType,
"ITEM_TYPE_DISPLAY_NAME": itemTypeDisplayName == null ? null : itemTypeDisplayName,
"OPEN_NTF_NUMBER": openNtfNumber == null ? null : openNtfNumber,
};
}

@ -0,0 +1,189 @@
// To parse this JSON data, do
//
// final itgFormsModel = itgFormsModelFromMap(jsonString);
import 'dart:convert';
ItgFormsModel itgFormsModelFromMap(String str) => ItgFormsModel.fromJson(json.decode(str));
String itgFormsModelToMap(ItgFormsModel data) => json.encode(data.toMap());
class ItgFormsModel {
ItgFormsModel({
this.date,
this.languageId,
this.serviceName,
this.time,
this.androidLink,
this.authenticationTokenId,
this.data,
this.dataw,
this.dietType,
this.dietTypeId,
this.errorCode,
this.errorEndUserMessage,
this.errorEndUserMessageN,
this.errorMessage,
this.errorType,
this.foodCategory,
this.iosLink,
this.isAuthenticated,
this.mealOrderStatus,
this.mealType,
this.messageStatus,
this.numberOfResultRecords,
this.patientBlodType,
this.successMsg,
this.successMsgN,
this.vidaUpdatedResponse,
this.itgRequest,
this.itgFormAttachmentsList,
this.message,
this.mohemmItgDepartmentSectionsList,
this.mohemmItgProjectDepartmentsList,
this.mohemmItgResponseItem,
this.mohemmItgSectionTopicsList,
this.mohemmItgTicketDetailsList,
this.mohemmItgTicketTransactionsList,
this.mohemmItgTicketsByEmployeeList,
this.mohemmItgProjectsList,
this.mohemmItgTicketTypesList,
this.referenceNumber,
this.requestType,
this.totalCount,
this.statuseCode,
});
dynamic date;
int? languageId;
int? serviceName;
dynamic time;
dynamic androidLink;
dynamic authenticationTokenId;
dynamic data;
bool? dataw;
int? dietType;
int? dietTypeId;
dynamic errorCode;
dynamic errorEndUserMessage;
dynamic errorEndUserMessageN;
dynamic errorMessage;
int? errorType;
int? foodCategory;
dynamic iosLink;
bool? isAuthenticated;
int? mealOrderStatus;
int? mealType;
int? messageStatus;
int? numberOfResultRecords;
dynamic patientBlodType;
String? successMsg;
dynamic successMsgN;
dynamic vidaUpdatedResponse;
dynamic itgRequest;
dynamic itgFormAttachmentsList;
String? message;
dynamic mohemmItgDepartmentSectionsList;
dynamic mohemmItgProjectDepartmentsList;
dynamic mohemmItgResponseItem;
dynamic mohemmItgSectionTopicsList;
dynamic mohemmItgTicketDetailsList;
dynamic mohemmItgTicketTransactionsList;
dynamic mohemmItgTicketsByEmployeeList;
dynamic mohemmItgProjectsList;
dynamic mohemmItgTicketTypesList;
DateTime? referenceNumber;
dynamic requestType;
int? totalCount;
int? statuseCode;
factory ItgFormsModel.fromJson(Map<String, dynamic> json) => ItgFormsModel(
date: json["Date"],
languageId: json["LanguageID"] == null ? null : json["LanguageID"],
serviceName: json["ServiceName"] == null ? null : json["ServiceName"],
time: json["Time"],
androidLink: json["AndroidLink"],
authenticationTokenId: json["AuthenticationTokenID"],
data: json["Data"],
dataw: json["Dataw"] == null ? null : json["Dataw"],
dietType: json["DietType"] == null ? null : json["DietType"],
dietTypeId: json["DietTypeID"] == null ? null : json["DietTypeID"],
errorCode: json["ErrorCode"],
errorEndUserMessage: json["ErrorEndUserMessage"],
errorEndUserMessageN: json["ErrorEndUserMessageN"],
errorMessage: json["ErrorMessage"],
errorType: json["ErrorType"] == null ? null : json["ErrorType"],
foodCategory: json["FoodCategory"] == null ? null : json["FoodCategory"],
iosLink: json["IOSLink"],
isAuthenticated: json["IsAuthenticated"] == null ? null : json["IsAuthenticated"],
mealOrderStatus: json["MealOrderStatus"] == null ? null : json["MealOrderStatus"],
mealType: json["MealType"] == null ? null : json["MealType"],
messageStatus: json["MessageStatus"] == null ? null : json["MessageStatus"],
numberOfResultRecords: json["NumberOfResultRecords"] == null ? null : json["NumberOfResultRecords"],
patientBlodType: json["PatientBlodType"],
successMsg: json["SuccessMsg"] == null ? null : json["SuccessMsg"],
successMsgN: json["SuccessMsgN"],
vidaUpdatedResponse: json["VidaUpdatedResponse"],
itgRequest: json["ITGRequest"],
itgFormAttachmentsList: json["Itg_FormAttachmentsList"],
message: json["Message"] == null ? null : json["Message"],
mohemmItgDepartmentSectionsList: json["Mohemm_ITG_DepartmentSectionsList"],
mohemmItgProjectDepartmentsList: json["Mohemm_ITG_ProjectDepartmentsList"],
mohemmItgResponseItem: json["Mohemm_ITG_ResponseItem"],
mohemmItgSectionTopicsList: json["Mohemm_ITG_SectionTopicsList"],
mohemmItgTicketDetailsList: json["Mohemm_ITG_TicketDetailsList"],
mohemmItgTicketTransactionsList: json["Mohemm_ITG_TicketTransactionsList"],
mohemmItgTicketsByEmployeeList: json["Mohemm_ITG_TicketsByEmployeeList"],
mohemmItgProjectsList: json["Mohemm_Itg_ProjectsList"],
mohemmItgTicketTypesList: json["Mohemm_Itg_TicketTypesList"],
referenceNumber: json["ReferenceNumber"] == null ? null : DateTime.parse(json["ReferenceNumber"]),
requestType: json["RequestType"],
totalCount: json["TotalCount"] == null ? null : json["TotalCount"],
statuseCode: json["statuseCode"] == null ? null : json["statuseCode"],
);
Map<String, dynamic> toMap() => {
"Date": date,
"LanguageID": languageId == null ? null : languageId,
"ServiceName": serviceName == null ? null : serviceName,
"Time": time,
"AndroidLink": androidLink,
"AuthenticationTokenID": authenticationTokenId,
"Data": data,
"Dataw": dataw == null ? null : dataw,
"DietType": dietType == null ? null : dietType,
"DietTypeID": dietTypeId == null ? null : dietTypeId,
"ErrorCode": errorCode,
"ErrorEndUserMessage": errorEndUserMessage,
"ErrorEndUserMessageN": errorEndUserMessageN,
"ErrorMessage": errorMessage,
"ErrorType": errorType == null ? null : errorType,
"FoodCategory": foodCategory == null ? null : foodCategory,
"IOSLink": iosLink,
"IsAuthenticated": isAuthenticated == null ? null : isAuthenticated,
"MealOrderStatus": mealOrderStatus == null ? null : mealOrderStatus,
"MealType": mealType == null ? null : mealType,
"MessageStatus": messageStatus == null ? null : messageStatus,
"NumberOfResultRecords": numberOfResultRecords == null ? null : numberOfResultRecords,
"PatientBlodType": patientBlodType,
"SuccessMsg": successMsg == null ? null : successMsg,
"SuccessMsgN": successMsgN,
"VidaUpdatedResponse": vidaUpdatedResponse,
"ITGRequest": itgRequest,
"Itg_FormAttachmentsList": itgFormAttachmentsList,
"Message": message == null ? null : message,
"Mohemm_ITG_DepartmentSectionsList": mohemmItgDepartmentSectionsList,
"Mohemm_ITG_ProjectDepartmentsList": mohemmItgProjectDepartmentsList,
"Mohemm_ITG_ResponseItem": mohemmItgResponseItem,
"Mohemm_ITG_SectionTopicsList": mohemmItgSectionTopicsList,
"Mohemm_ITG_TicketDetailsList": mohemmItgTicketDetailsList,
"Mohemm_ITG_TicketTransactionsList": mohemmItgTicketTransactionsList,
"Mohemm_ITG_TicketsByEmployeeList": mohemmItgTicketsByEmployeeList,
"Mohemm_Itg_ProjectsList": mohemmItgProjectsList,
"Mohemm_Itg_TicketTypesList": mohemmItgTicketTypesList,
"ReferenceNumber": referenceNumber == null ? null : referenceNumber!.toIso8601String(),
"RequestType": requestType,
"TotalCount": totalCount == null ? null : totalCount,
"statuseCode": statuseCode == null ? null : statuseCode,
};
}

@ -1,6 +1,10 @@
import 'package:mohem_flutter_app/models/member_login_list_model.dart';
import 'basic_member_information_model.dart';
import 'dashboard/get_accrual_balances_list_model.dart';
import 'dashboard/get_attendance_tracking_list_model.dart';
import 'dashboard/get_open_missing_swipes_list_model.dart';
import 'dashboard/get_open_notifications_list.dart';
import 'member_information_list_model.dart';
import 'privilege_list_model.dart';
@ -57,13 +61,13 @@ class GenericResponseModel {
List<String>? getAbsenceCollectionNotificationBodyList;
List<String>? getAbsenceDffStructureList;
List<String>? getAbsenceTransactionList;
List<String>? getAccrualBalancesList;
List<GetAccrualBalancesList>? getAccrualBalancesList;
List<String>? getActionHistoryList;
List<String>? getAddressDffStructureList;
List<String>? getAddressNotificationBodyList;
List<String>? getApprovesList;
List<String>? getAttachementList;
List<String>? getAttendanceTrackingList;
GetAttendanceTrackingList? getAttendanceTrackingList;
List<String>? getBasicDetColsStructureList;
List<String>? getBasicDetDffStructureList;
List<String>? getBasicDetNtfBodyList;
@ -105,8 +109,8 @@ class GenericResponseModel {
List<String>? getNotificationButtonsList;
List<String>? getNotificationReassignModeList;
List<String>? getObjectValuesList;
List<String>? getOpenMissingSwipesList;
List<String>? getOpenNotificationsList;
GetOpenMissingSwipesList? getOpenMissingSwipesList;
List<GetOpenNotificationsList>? getOpenNotificationsList;
List<String>? getOpenNotificationsNumList;
List<String>? getOpenPeriodDatesList;
List<String>? getOrganizationsSalariesList;
@ -563,13 +567,15 @@ class GenericResponseModel {
getAbsenceCollectionNotificationBodyList = json['GetAbsenceCollectionNotificationBodyList'];
getAbsenceDffStructureList = json['GetAbsenceDffStructureList'];
getAbsenceTransactionList = json['GetAbsenceTransactionList'];
getAccrualBalancesList = json['GetAccrualBalancesList'];
getAccrualBalancesList:
json["GetAccrualBalancesList"] == null ? null : List<GetAccrualBalancesList>.from(json["GetAccrualBalancesList"].map((x) => GetAccrualBalancesList.fromJson(x)));
getActionHistoryList = json['GetActionHistoryList'];
getAddressDffStructureList = json['GetAddressDffStructureList'];
getAddressNotificationBodyList = json['GetAddressNotificationBodyList'];
getApprovesList = json['GetApprovesList'];
getAttachementList = json['GetAttachementList'];
getAttendanceTrackingList = json['GetAttendanceTrackingList'];
getAttendanceTrackingList:
json["GetAttendanceTrackingList"] == null ? null : GetAttendanceTrackingList.fromMap(json["GetAttendanceTrackingList"]);
getBasicDetColsStructureList = json['GetBasicDetColsStructureList'];
getBasicDetDffStructureList = json['GetBasicDetDffStructureList'];
getBasicDetNtfBodyList = json['GetBasicDetNtfBodyList'];
@ -611,8 +617,9 @@ class GenericResponseModel {
getNotificationButtonsList = json['GetNotificationButtonsList'];
getNotificationReassignModeList = json['GetNotificationReassignModeList'];
getObjectValuesList = json['GetObjectValuesList'];
getOpenMissingSwipesList = json['GetOpenMissingSwipesList'];
getOpenNotificationsList = json['GetOpenNotificationsList'];
getOpenMissingSwipesList: json["GetOpenMissingSwipesList"] == null ? null : GetOpenMissingSwipesList.fromJson(json["GetOpenMissingSwipesList"]);
getOpenNotificationsList:
json["GetOpenNotificationsList"] == null ? null : List<GetOpenNotificationsList>.from(json["GetOpenNotificationsList"].map((x) => GetOpenNotificationsList.fromMap(x)));
getOpenNotificationsNumList = json['GetOpenNotificationsNumList'];
getOpenPeriodDatesList = json['GetOpenPeriodDatesList'];
getOrganizationsSalariesList = json['GetOrganizationsSalariesList'];

@ -5,8 +5,27 @@ class PostParamsModel {
String? mobileType;
String? logInTokenID;
String? tokenID;
String? mobileNumber;
String? pEmailAddress;
String? pUserName;
String? pSelectedEmployeeNumber;
int? pSessionId;
String? userName;
PostParamsModel({this.versionID, this.channel, this.languageID, this.mobileType, this.logInTokenID, this.tokenID});
PostParamsModel({
this.versionID,
this.channel,
this.languageID,
this.mobileType,
this.logInTokenID,
this.tokenID,
this.mobileNumber,
this.userName,
this.pEmailAddress,
this.pSessionId,
this.pUserName,
this.pSelectedEmployeeNumber,
});
PostParamsModel.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID'];
@ -28,7 +47,37 @@ class PostParamsModel {
return data;
}
Map<String, dynamic> toJsonAfterLogin() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['MobileType'] = this.mobileType;
data['LogInTokenID'] = this.logInTokenID;
data['TokenID'] = this.tokenID;
data['MobileNumber'] = this.mobileNumber;
data['UserName'] = this.userName;
data['P_EMAIL_ADDRESS'] = this.pEmailAddress;
data['P_SESSION_ID'] = this.pSessionId;
data['P_SELECTED_EMPLOYEE_NUMBER'] = this.pSelectedEmployeeNumber;
data['P_USER_NAME'] = this.pUserName;
return data;
}
set setLogInTokenID(String? token) => logInTokenID = token;
set setTokenID(String? token) => tokenID = token;
set setMobileNumer(String? v) => mobileNumber = v;
set setUserName(String? v) => userName = v;
set setPEmailAddress(String? v) => pEmailAddress = v;
set setPSessionId(int? v) => pSessionId = v;
set setPUserName(String? v) => pUserName = v;
set setPSelectedEmployeeNumber(String? v) => pSelectedEmployeeNumber = v;
}

@ -2,6 +2,7 @@ import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/api/dashboard_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
@ -25,6 +26,7 @@ class _DashboardState extends State<Dashboard> {
@override
void initState() {
super.initState();
DashbaordApiClient().getAttendanceTracking();
}
@override
@ -42,7 +44,8 @@ class _DashboardState extends State<Dashboard> {
List<String> iconT = ["assets/images/monthly_attendance.svg", "assets/images/work_from_home.svg", "assets/images/ticket_request.svg", "assets/images/work_from_home.svg"];
List<String> namesD = ["Nostalgia Perfume Perfume", "Al Nafoura", "AlJadi", "Nostalgia Perfume"];
// DashbaordApiClient().getOpenNotifications();
DashbaordApiClient().getOpenMissingSwipes();
return Scaffold(
body: Column(
children: [

@ -49,7 +49,7 @@ class _LoginScreenState extends State<LoginScreen> {
_checkMobileAppVersion = await LoginApiClient().checkMobileAppVersion();
_memberLoginList = await LoginApiClient().memberLogin(username.text, password.text);
AppState().setMemberLoginListModel = _memberLoginList;
AppState().username = username.text;
AppState().setUserName = username.text;
print(_memberLoginList?.toJson());
Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.verifyLogin);
@ -62,6 +62,8 @@ class _LoginScreenState extends State<LoginScreen> {
@override
Widget build(BuildContext context) {
username.text="15153";
password.text="e123e123e123";
return Scaffold(
body: Column(
children: [

@ -626,7 +626,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
} else {
Utils.showLoading(context);
BasicMemberInformationModel? memberInformationModel = await LoginApiClient()
.mohemmSendActivationCodeByOTPNotificationType(checkBiometricIsAvailable(BiometricType.fingerprint) ? 1 : 0, AppState().memberLoginList?.pMOBILENUMBER, _flag, AppState().username);
.mohemmSendActivationCodeByOTPNotificationType(checkBiometricIsAvailable(BiometricType.fingerprint) ? 1 : 0, AppState().memberLoginList?.pMOBILENUMBER, _flag, AppState().getUserName);
Utils.hideLoading(context);
OtpDialog(
context,
@ -635,7 +635,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
(value) async {
Utils.showLoading(context);
try {
GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(false, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().username);
GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(false, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName);
if (genericResponseModel?.errorMessage != null) {
Utils.showToast(genericResponseModel?.errorMessage ?? "");
// Navigator.pop(context);

Loading…
Cancel
Save