Compare commits

..

1 Commits

Author SHA1 Message Date
Sultan khan 3d91a1444e wallet ticket fix 5 days ago

@ -620,27 +620,5 @@
"mazaya": "مازيا",
"benefits": "فوائد",
"mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين",
"viewallofferMazaya" : "أعرض كل المزايا",
"buyerName": "اسم المشتري",
"buyerNumber": "رقم المشتري",
"highestBidder": "أعلى مزايد",
"remarks": "ملاحظات",
"faHeader": "تفاصيل رأس الصفحة FA",
"bookTypeCode": "رمز نوع الكتاب",
"categoryCode": "رمز الفئة",
"categoryGroup": "مجموعة الفئات",
"faLINES": "تفاصيل الأصول",
"assetNumber": "رقم الأصول",
"assetDescription": "وصف الأصول",
"barCodeNumber": "رقم الباركود",
"datePlaceInService": "تاريخ وضعه في الخدمة",
"serialNumber": "رقم سري",
"disposedDate": "تاريخ التخلص",
"netBookValue": "القيمة الدفترية الصافية",
"purchasedPrice": "سعر الشراء",
"usefulLife": "العمر الإنتاجي",
"yearsUsed": "سنوات الاستخدام",
"faRequest": "طلب التخلص من FA",
"showMore": "عرض المزيد",
"buyerDetails": "تفاصيل المشتري"
"viewallofferMazaya" : "أعرض كل المزايا"
}

@ -618,27 +618,6 @@
"mazaya": "MAZAYA",
"benefits": "Benefits",
"mazayaDesc": "Discover special Discounts and offers available to Employees",
"viewallofferMazaya" : "View All Offers",
"buyerName": "Buyer Name",
"buyerNumber": "Buyer Number",
"highestBidder": "Highest Bidder",
"remarks": "Remarks",
"faHeader": "FA Header Details",
"bookTypeCode": "Book Type Code",
"categoryCode": "Category Code",
"categoryGroup": "Category Group",
"faLINES": "Asset Details",
"assetNumber": "Asset Number",
"assetDescription": "Asset Description",
"barCodeNumber": "BarCode Number",
"datePlaceInService": "Date place In Service",
"serialNumber": "Serial Number",
"disposedDate": "Disposed Date",
"netBookValue": "Net Book Value",
"purchasedPrice": "Purchased Price",
"usefulLife": "Useful Life",
"yearsUsed": "Years Used",
"faRequest":"FA Disposal Request",
"showMore": "Show More",
"buyerDetails": "Buyer Details"
"viewallofferMazaya" : "View All Offers"
}

@ -6,8 +6,6 @@ import 'package:flutter/foundation.dart';
import 'package:http/http.dart';
import 'package:http/io_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/exceptions/api_exception.dart';
import 'package:mohem_flutter_app/main.dart';
// ignore_for_file: avoid_annotating_with_dynamic
@ -15,7 +13,7 @@ import 'package:mohem_flutter_app/main.dart';
typedef FactoryConstructor<U> = U Function(dynamic);
class APIError {
dynamic errorCode;
int? errorCode;
int? errorType;
String? errorMessage;
int? errorStatusCode;
@ -104,10 +102,7 @@ class ApiClient {
if (jsonData["ErrorMessage"] == null) {
return factoryConstructor(jsonData);
} else if (jsonData["MessageStatus"] == 2 && jsonData["IsOTPMaxLimitExceed"] == true) {
await Utils.performLogout(AppRoutes.navigatorKey.currentContext, null);
throw const APIException(APIException.UNAUTHORIZED, error: null);
} else {
} else {
APIError? apiError;
apiError = APIError(jsonData['ErrorCode'], jsonData['ErrorEndUserMessage'], jsonData['ErrorType'] ?? 0, jsonData['ErrorStatusCode']);
throw APIException(APIException.BAD_REQUEST, error: apiError);

@ -28,7 +28,6 @@ import 'package:mohem_flutter_app/models/notification_get_respond_attributes_lis
import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart';
import 'package:mohem_flutter_app/models/update_user_item_type_list.dart';
import 'package:mohem_flutter_app/models/worklist/GetRFCEmployeeList.dart';
import 'package:mohem_flutter_app/models/worklist/get_fad_notifications.dart';
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
@ -217,24 +216,9 @@ class WorkListApiClient {
);
}
// Future<MemberInformationListModel> getUserInformation(int pSelectedResopID, String selectedEmployeeNumber) async {
// String url = "${ApiConsts.erpRest}Get_UserInformation";
// Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": pSelectedResopID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1};
// postParams.addAll(AppState().postParamsJson);
// if (selectedEmployeeNumber != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = selectedEmployeeNumber;
// return await ApiClient().postJsonForObject(
// (json) {
// GenericResponseModel responseData = GenericResponseModel.fromJson(json);
// return responseData.memberInformationList![0];
// },
// url,
// postParams,
// );
// }
Future<MemberInformationListModel> getNotificationUserInformation(int pSelectedResopID, String selectedEmployeeNumber, int pNotificationID) async {
String url = "${ApiConsts.erpRest}Get_Notification_UserInformation";
Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": pSelectedResopID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1, "P_NOTIFICATION_ID": pNotificationID};
Future<MemberInformationListModel> getUserInformation(int pSelectedResopID, String selectedEmployeeNumber) async {
String url = "${ApiConsts.erpRest}Get_UserInformation";
Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": pSelectedResopID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1};
postParams.addAll(AppState().postParamsJson);
if (selectedEmployeeNumber != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = selectedEmployeeNumber;
return await ApiClient().postJsonForObject(
@ -847,19 +831,4 @@ class WorkListApiClient {
postParams,
);
}
Future<GetFaDisposalNtfDetails?> getFADNotificationBody(int? notificationId) async {
String url = "${ApiConsts.erpRest}GetFADisposalNtfDetails";
Map<String, dynamic> postParams = {"P_NOTIFICATION_ID": notificationId, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject(
(json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.getFADisposalNtfDetails;
},
url,
postParams,
);
}
}

@ -4,7 +4,7 @@ class ApiConsts {
// static String baseUrl = "http://10.200.204.11"; // Local server
// static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.201.204.101:2024";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://hmgwebservices.com"; // Live server
@ -15,7 +15,7 @@ class ApiConsts {
// static String baseUrl = "http://10.20.200.111:1010/";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://mohemm.hmg.com";
static String baseUrl = "https://mohemm.hmg.com";
// static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server

@ -16,7 +16,6 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
import 'package:mohem_flutter_app/widgets/loading_dialog.dart';
import 'package:nfc_manager/nfc_manager.dart';
@ -387,16 +386,4 @@ class Utils {
return false;
}
}
static Future<void> performLogout(BuildContext? context, ChatProviderModel? chatData) async {
AppState().isAuthenticated = false;
AppState().isLogged = false;
AppState().setPostParamsInitConfig();
if (chatData != null) {
chatData.disposeData();
}
// SharedPreferences prefs = await SharedPreferences.getInstance();
// await prefs.clear();
Navigator.pushNamedAndRemoveUntil(context!, AppRoutes.login, (Route<dynamic> route) => false, arguments: null);
}
}

@ -81,30 +81,28 @@ extension EmailValidator on String {
),
);
Widget toText12({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int? maxLine, TextOverflow? overflow}) => Text(
Widget toText12({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0}) => Text(
this,
textAlign: isCenter ? TextAlign.center : null,
maxLines: maxLine == 0 ? null : maxLine,
maxLines: (maxLine > 0) ? maxLine : null,
style: TextStyle(
fontSize: 12,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: -0.72,
decoration: isUnderLine ? TextDecoration.underline : null,
overflow: TextOverflow.visible
),
);
Widget toText12Auto({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int? maxLine,TextOverflow? overflow}) => AutoSizeText(
Widget toText12Auto({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0}) => AutoSizeText(
this,
textAlign: isCenter ? TextAlign.center : null,
maxLines: maxLine == 0 ? null : maxLine,
maxLines: (maxLine > 0) ? maxLine : null,
minFontSize: 8,
style: TextStyle(
fontSize: 12,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
overflow: overflow,
letterSpacing: -0.72,
decoration: isUnderLine ? TextDecoration.underline : null,
),

@ -633,29 +633,7 @@ class CodegenLoader extends AssetLoader{
"mazaya": "مازيا",
"benefits": "فوائد",
"mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين",
"viewallofferMazaya": "أعرض كل المزايا",
"buyerName": "اسم المشتري",
"buyerNumber": "رقم المشتري",
"highestBidder": "أعلى مزايد",
"remarks": "ملاحظات",
"faHeader": "تفاصيل رأس الصفحة FA",
"bookTypeCode": "رمز نوع الكتاب",
"categoryCode": "رمز الفئة",
"categoryGroup": "مجموعة الفئات",
"faLINES": "تفاصيل الأصول",
"assetNumber": "رقم الأصول",
"assetDescription": "وصف الأصول",
"barCodeNumber": "رقم الباركود",
"datePlaceInService": "تاريخ وضعه في الخدمة",
"serialNumber": "رقم سري",
"disposedDate": "تاريخ التخلص",
"netBookValue": "القيمة الدفترية الصافية",
"purchasedPrice": "سعر الشراء",
"usefulLife": "العمر الإنتاجي",
"yearsUsed": "سنوات الاستخدام",
"faRequest": "طلب التخلص من FA",
"showMore": "عرض المزيد",
"buyerDetails": "تفاصيل المشتري"
"viewallofferMazaya": "أعرض كل المزايا"
};
static const Map<String,dynamic> _en_US = {
"mohemm": "Mohemm",
@ -1276,29 +1254,7 @@ static const Map<String,dynamic> _en_US = {
"mazaya": "MAZAYA",
"benefits": "Benefits",
"mazayaDesc": "Discover special Discounts and offers available to Employees",
"viewallofferMazaya": "View All Offers",
"buyerName": "Buyer Name",
"buyerNumber": "Buyer Number",
"highestBidder": "Highest Bidder",
"remarks": "Remarks",
"faHeader": "FA Header Details",
"bookTypeCode": "Book Type Code",
"categoryCode": "Category Code",
"categoryGroup": "Category Group",
"faLINES": "Asset Details",
"assetNumber": "Asset Number",
"assetDescription": "Asset Description",
"barCodeNumber": "BarCode Number",
"datePlaceInService": "Date place In Service",
"serialNumber": "Serial Number",
"disposedDate": "Disposed Date",
"netBookValue": "Net Book Value",
"purchasedPrice": "Purchased Price",
"usefulLife": "Useful Life",
"yearsUsed": "Years Used",
"faRequest": "FA Disposal Request",
"showMore": "Show More",
"buyerDetails": "Buyer Details"
"viewallofferMazaya": "View All Offers"
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US};
}

@ -606,27 +606,5 @@ abstract class LocaleKeys {
static const benefits = 'benefits';
static const mazayaDesc = 'mazayaDesc';
static const viewallofferMazaya = 'viewallofferMazaya';
static const buyerName = 'buyerName';
static const buyerNumber = 'buyerNumber';
static const highestBidder = 'highestBidder';
static const remarks = 'remarks';
static const faHeader = 'faHeader';
static const bookTypeCode = 'bookTypeCode';
static const categoryCode = 'categoryCode';
static const categoryGroup = 'categoryGroup';
static const faLINES = 'faLINES';
static const assetNumber = 'assetNumber';
static const assetDescription = 'assetDescription';
static const barCodeNumber = 'barCodeNumber';
static const datePlaceInService = 'datePlaceInService';
static const serialNumber = 'serialNumber';
static const disposedDate = 'disposedDate';
static const netBookValue = 'netBookValue';
static const purchasedPrice = 'purchasedPrice';
static const usefulLife = 'usefulLife';
static const yearsUsed = 'yearsUsed';
static const faRequest = 'faRequest';
static const showMore = 'showMore';
static const buyerDetails = 'buyerDetails';
}

@ -108,7 +108,6 @@ import 'package:mohem_flutter_app/models/vacation_rule/vr_item_types_list_model.
import 'package:mohem_flutter_app/models/vacation_rule/wf_look_up_list_model.dart';
import 'package:mohem_flutter_app/models/validate_eit_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/GetRFCEmployeeList.dart';
import 'package:mohem_flutter_app/models/worklist/get_fad_notifications.dart';
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
@ -389,7 +388,6 @@ class GenericResponseModel {
String? validatePhonesTransactionList;
List<VrItemTypesList>? vrItemTypesList;
List<WFLookUpList>? wFLookUpList;
GetFaDisposalNtfDetails? getFADisposalNtfDetails;
String? eLearningGETEMPLOYEEPROFILEList;
String? eLearningLOGINList;
String? eLearningValidateLoginList;
@ -669,7 +667,6 @@ class GenericResponseModel {
this.ePharmacyGetItemOnHandList,
this.isActiveCode,
this.isSMSSent,
this.getFADisposalNtfDetails
});
GenericResponseModel.fromJson(Map<String, dynamic> json) {
@ -941,9 +938,6 @@ class GenericResponseModel {
});
}
getFADisposalNtfDetails = json['GetFADisposalNtfDetails'] != null ? GetFaDisposalNtfDetails.fromJson(json['GetFADisposalNtfDetails']) : null;
if (json['GetEarningsList'] != null) {
getEarningsList = <GetEarningsList>[];
json['GetEarningsList'].forEach((v) {
@ -1561,7 +1555,6 @@ class GenericResponseModel {
if (this.getActionHistoryList != null) {
data['GetActionHistoryList'] = this.getActionHistoryList!.map((v) => v.toJson()).toList();
}
data['GetFADisposalNtfDetails'] =this.getFADisposalNtfDetails;
data['GetAddressDffStructureList'] = this.getAddressDffStructureList;
data['GetAddressNotificationBodyList'] = this.getAddressNotificationBodyList;

@ -1,233 +0,0 @@
import 'dart:convert';
class GetFaDisposalNtfDetails {
List<PFaBuyer>? pFaBuyers;
List<PFaHeader>? pFaHeader;
List<PFaLine>? pFaLines;
String? pInformation;
dynamic pQuestion;
GetFaDisposalNtfDetails({
this.pFaBuyers,
this.pFaHeader,
this.pFaLines,
this.pInformation,
this.pQuestion,
});
factory GetFaDisposalNtfDetails.fromRawJson(String str) => GetFaDisposalNtfDetails.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory GetFaDisposalNtfDetails.fromJson(Map<String, dynamic> json) => GetFaDisposalNtfDetails(
pFaBuyers: json["P_FA_BUYERS"] == null ? [] : List<PFaBuyer>.from(json["P_FA_BUYERS"]!.map((x) => PFaBuyer.fromJson(x))),
pFaHeader: json["P_FA_HEADER"] == null ? [] : List<PFaHeader>.from(json["P_FA_HEADER"]!.map((x) => PFaHeader.fromJson(x))),
pFaLines: json["P_FA_LINES"] == null ? [] : List<PFaLine>.from(json["P_FA_LINES"]!.map((x) => PFaLine.fromJson(x))),
pInformation: json["P_INFORMATION"],
pQuestion: json["P_QUESTION"],
);
Map<String, dynamic> toJson() => {
"P_FA_BUYERS": pFaBuyers == null ? [] : List<dynamic>.from(pFaBuyers!.map((x) => x.toJson())),
"P_FA_HEADER": pFaHeader == null ? [] : List<dynamic>.from(pFaHeader!.map((x) => x.toJson())),
"P_FA_LINES": pFaLines == null ? [] : List<dynamic>.from(pFaLines!.map((x) => x.toJson())),
"P_INFORMATION": pInformation,
"P_QUESTION": pQuestion,
};
}
class PFaBuyer {
int? amount;
String? buyerName;
String? buyerNumber;
int? fromRowNum;
String? highestBidder;
int? noOfRows;
String? receiptNumber;
String? remarks;
int? requestNo;
int? rowNum;
int? toRowNum;
PFaBuyer({
this.amount,
this.buyerName,
this.buyerNumber,
this.fromRowNum,
this.highestBidder,
this.noOfRows,
this.receiptNumber,
this.remarks,
this.requestNo,
this.rowNum,
this.toRowNum,
});
factory PFaBuyer.fromRawJson(String str) => PFaBuyer.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory PFaBuyer.fromJson(Map<String, dynamic> json) => PFaBuyer(
amount: json["AMOUNT"],
buyerName: json["BUYER_NAME"],
buyerNumber: json["BUYER_NUMBER"],
fromRowNum: json["FROM_ROW_NUM"],
highestBidder: json["HIGHEST_BIDDER"],
noOfRows: json["NO_OF_ROWS"],
receiptNumber: json["RECEIPT_NUMBER"],
remarks: json["REMARKS"],
requestNo: json["REQUEST_NO"],
rowNum: json["ROW_NUM"],
toRowNum: json["TO_ROW_NUM"],
);
Map<String, dynamic> toJson() => {
"AMOUNT": amount,
"BUYER_NAME": buyerName,
"BUYER_NUMBER": buyerNumber,
"FROM_ROW_NUM": fromRowNum,
"HIGHEST_BIDDER": highestBidder,
"NO_OF_ROWS": noOfRows,
"RECEIPT_NUMBER": receiptNumber,
"REMARKS": remarks,
"REQUEST_NO": requestNo,
"ROW_NUM": rowNum,
"TO_ROW_NUM": toRowNum,
};
}
class PFaHeader {
String? bookTypeCode;
String? categoryCode;
String? categoryGroup;
String? comments;
int? requestNo;
String? status;
PFaHeader({
this.bookTypeCode,
this.categoryCode,
this.categoryGroup,
this.comments,
this.requestNo,
this.status,
});
factory PFaHeader.fromRawJson(String str) => PFaHeader.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory PFaHeader.fromJson(Map<String, dynamic> json) => PFaHeader(
bookTypeCode: json["BOOK_TYPE_CODE"],
categoryCode: json["CATEGORY_CODE"],
categoryGroup: json["CATEGORY_GROUP"],
comments: json["COMMENTS"],
requestNo: json["REQUEST_NO"],
status: json["STATUS"],
);
Map<String, dynamic> toJson() => {
"BOOK_TYPE_CODE": bookTypeCode,
"CATEGORY_CODE": categoryCode,
"CATEGORY_GROUP": categoryGroup,
"COMMENTS": comments,
"REQUEST_NO": requestNo,
"STATUS": status,
};
}
class PFaLine {
String? action;
String? assetDescription;
int? assetNumber;
String? barcodeNumber;
String? bme;
String? datePlacedInService;
String? department;
String? disposedDate;
int? fromRowNum;
double? netBookValue;
int? noOfRows;
String? poNumber;
double? purchasePrice;
int? quantity;
int? requestNo;
int? rowNum;
String? serialNumber;
int? toRowNum;
int? usefulLife;
String? yearsUsed;
PFaLine({
this.action,
this.assetDescription,
this.assetNumber,
this.barcodeNumber,
this.bme,
this.datePlacedInService,
this.department,
this.disposedDate,
this.fromRowNum,
this.netBookValue,
this.noOfRows,
this.poNumber,
this.purchasePrice,
this.quantity,
this.requestNo,
this.rowNum,
this.serialNumber,
this.toRowNum,
this.usefulLife,
this.yearsUsed,
});
factory PFaLine.fromRawJson(String str) => PFaLine.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory PFaLine.fromJson(Map<String, dynamic> json) => PFaLine(
action: json["ACTION"],
assetDescription: json["ASSET_DESCRIPTION"],
assetNumber: json["ASSET_NUMBER"],
barcodeNumber: json["BARCODE_NUMBER"],
bme: json["BME"],
datePlacedInService: json["DATE_PLACED_IN_SERVICE"],
department: json["DEPARTMENT"],
disposedDate: json["DISPOSED_DATE"],
fromRowNum: json["FROM_ROW_NUM"],
netBookValue: json["NET_BOOK_VALUE"]?.toDouble(),
noOfRows: json["NO_OF_ROWS"],
poNumber: json["PO_NUMBER"],
purchasePrice: json["PURCHASE_PRICE"]?.toDouble(),
quantity: json["QUANTITY"],
requestNo: json["REQUEST_NO"],
rowNum: json["ROW_NUM"],
serialNumber: json["SERIAL_NUMBER"],
toRowNum: json["TO_ROW_NUM"],
usefulLife: json["USEFUL_LIFE"],
yearsUsed: json["YEARS_USED"],
);
Map<String, dynamic> toJson() => {
"ACTION": action,
"ASSET_DESCRIPTION": assetDescription,
"ASSET_NUMBER": assetNumber,
"BARCODE_NUMBER": barcodeNumber,
"BME": bme,
"DATE_PLACED_IN_SERVICE": datePlacedInService,
"DEPARTMENT": department,
"DISPOSED_DATE": disposedDate,
"FROM_ROW_NUM": fromRowNum,
"NET_BOOK_VALUE": netBookValue,
"NO_OF_ROWS": noOfRows,
"PO_NUMBER": poNumber,
"PURCHASE_PRICE": purchasePrice,
"QUANTITY": quantity,
"REQUEST_NO": requestNo,
"ROW_NUM": rowNum,
"SERIAL_NUMBER": serialNumber,
"TO_ROW_NUM": toRowNum,
"USEFUL_LIFE": usefulLife,
"YEARS_USED": yearsUsed,
};
}

@ -56,8 +56,6 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
int currentIndex = 0;
bool isDisplayMazaya = false;
@override
void initState() {
WidgetsBinding.instance.addObserver(this);
@ -155,7 +153,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
data.fetchLeaveTicketBalance(context, DateTime.now());
data.fetchMenuEntries();
data.fetchEventActivity();
data.getCategoryOffersListAPI(context);
// data.getCategoryOffersListAPI(context);
marathonProvider.getMarathonDetailsFromApi();
marathonProvider.getMarathonTutorial();
if (isFromInit) {
@ -314,103 +312,103 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
child: Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
return (model.isAttendanceTrackingLoading
? GetAttendanceTrackingShimmer()
: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
gradient: const LinearGradient(
transform: GradientRotation(.46),
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
),
),
child: Stack(
alignment: Alignment.center,
children: [
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
if (model.isTimeRemainingInSeconds != 0)
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
? GetAttendanceTrackingShimmer()
: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
gradient: const LinearGradient(
transform: GradientRotation(.46),
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
),
),
child: Stack(
alignment: Alignment.center,
children: [
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
if (model.isTimeRemainingInSeconds != 0)
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
9.height,
Directionality(
textDirection: ui.TextDirection.ltr,
child: CountdownTimer(
endTime: model.endTime,
onEnd: null,
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
),
),
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
9.height,
ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(20)),
child: LinearProgressIndicator(
value: model.progress,
minHeight: 8,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor: const Color(0xff196D73),
),
),
],
),
],
).paddingOnly(top: 12, right: 15, left: 12),
),
Row(
children: [
9.height,
Directionality(
textDirection: ui.TextDirection.ltr,
child: CountdownTimer(
endTime: model.endTime,
onEnd: null,
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.checkIn.tr().toText12(color: Colors.white),
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn).toString().toText14(
color: Colors.white,
isBold: true,
),
4.height,
],
).paddingOnly(left: 12, right: 12),
),
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
9.height,
ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(20)),
child: LinearProgressIndicator(
value: model.progress,
minHeight: 8,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor: const Color(0xff196D73),
Container(
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
width: 45,
height: 45,
padding: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
color: const Color(0xff259EA4),
borderRadius: BorderRadius.only(
bottomRight: AppState().isArabic(context) ? const Radius.circular(0) : const Radius.circular(15),
bottomLeft: AppState().isArabic(context) ? const Radius.circular(15) : const Radius.circular(0),
),
),
),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"),
).onPress(() {
showMyBottomSheet(context, callBackFunc: () {}, child: MarkAttendanceWidget(model, isFromDashboard: true));
}),
],
),
],
).paddingOnly(top: 12, right: 15, left: 12),
),
Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.checkIn.tr().toText12(color: Colors.white),
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn).toString().toText14(
color: Colors.white,
isBold: true,
),
4.height,
],
).paddingOnly(left: 12, right: 12),
],
),
Container(
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
width: 45,
height: 45,
padding: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
color: const Color(0xff259EA4),
borderRadius: BorderRadius.only(
bottomRight: AppState().isArabic(context) ? const Radius.circular(0) : const Radius.circular(15),
bottomLeft: AppState().isArabic(context) ? const Radius.circular(15) : const Radius.circular(0),
),
),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"),
).onPress(() {
showMyBottomSheet(context, callBackFunc: () {}, child: MarkAttendanceWidget(model, isFromDashboard: true));
}),
],
),
],
),
],
),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.todayAttendance);
}))
).onPress(() {
Navigator.pushNamed(context, AppRoutes.todayAttendance);
}))
.animatedSwither();
},
),
@ -423,238 +421,116 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
],
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
eventActivityWidget(context),
if (isDisplayMazaya) ...[
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Directionality(
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight),
),
child: Padding(
padding: const EdgeInsets.all(3.0), // This creates the border width
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(17), // Slightly less than outer radius
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 4,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
children: [
Expanded(
flex: 2,
child: RichText(
text:
AppState().isArabic(context)
? TextSpan(
children: [
TextSpan(
text: 'اطلع على مميزات',
style: TextStyle(
fontSize: 16,
letterSpacing: -0.2,
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
fontWeight: FontWeight.w700,
height: 24 / 16,
color: Color(0xFF5D5E5E),
),
),
TextSpan(
text: ' مزايا',
style: TextStyle(
fontSize: 16,
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
fontWeight: FontWeight.w700,
letterSpacing: -0.2,
height: 24 / 16,
color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
),
),
],
)
: TextSpan(
children: [
TextSpan(
text: LocaleKeys.explore.tr() + ' ',
style: const TextStyle(
fontSize: 16,
letterSpacing: -0.2,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 24 / 16,
color: Color(0xFF5D5E5E),
),
),
TextSpan(
text: LocaleKeys.mazaya.tr(),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
letterSpacing: -0.2,
height: 24 / 16,
color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
),
),
TextSpan(
text: ' ' + LocaleKeys.benefits.tr(),
style: const TextStyle(
fontSize: 16,
letterSpacing: -0.2,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 24 / 16,
color: Color(0xFF5D5E5E),
),
),
],
),
),
),
const Expanded(flex: 1, child: SizedBox()),
],
),
const SizedBox(height: 8),
LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)),
],
),
),
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47),
const SizedBox(height: 28),
LocaleKeys.viewallofferMazaya.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
}),
],
),
),
],
).paddingOnly(left: 21, right: 21, top: 14, bottom: 14),
),
),
).paddingOnly(left: 21, right: 21, top: 0, bottom: 21),
),
],
),
],
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
LocaleKeys.offers.tr().toText12(),
Row(
children: [
LocaleKeys.discounts.tr().toText24(isBold: true),
6.width,
Container(
padding: const EdgeInsets.only(left: 8, right: 8),
decoration: BoxDecoration(
color: MyColors.yellowColor,
borderRadius: BorderRadius.circular(10),
),
child: LocaleKeys.newString.tr().toText10(isBold: true)),
],
),
],
),
Directionality(
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight),
),
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
})
],
).paddingOnly(left: 21, right: 21),
Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
return SizedBox(
height: 103 + 33,
child: ListView.separated(
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext cxt, int index) {
return model.isOffersLoading
? const OffersShimmerWidget()
: InkWell(
onTap: () {
navigateToDetails(data.getOffersList[index]);
},
child: SizedBox(
width: 73,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 73,
height: 73,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.all(
Radius.circular(100),
),
border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
),
child: ClipRRect(
borderRadius: const BorderRadius.all(
Radius.circular(50),
),
child: Hero(
tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!,
transitionOnUserGestures: true,
child: Image.network(
data.getOffersList[index].logo ?? "",
fit: BoxFit.contain,
),
child: Padding(
padding: const EdgeInsets.all(3.0), // This creates the border width
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(17), // Slightly less than outer radius
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 4,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
children: [
Expanded(
flex: 2,
child: RichText(
text:
AppState().isArabic(context)
? TextSpan(
children: [
TextSpan(
text: 'اطلع على مميزات',
style: TextStyle(fontSize: 16, letterSpacing: -0.2, fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins', fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
),
TextSpan(
text: ' مزايا',
style: TextStyle(
fontSize: 16,
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
fontWeight: FontWeight.w700,
letterSpacing: -0.2,
height: 24 / 16,
color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
),
),
],
)
: TextSpan(
children: [
TextSpan(
text: LocaleKeys.explore.tr() + ' ',
style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontFamily: 'Poppins', fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
),
TextSpan(
text: LocaleKeys.mazaya.tr(),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
letterSpacing: -0.2,
height: 24 / 16,
color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
),
),
TextSpan(
text: ' ' + LocaleKeys.benefits.tr(),
style: const TextStyle(fontSize: 16, letterSpacing: -0.2,
fontFamily: 'Poppins',fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
),
],
),
),
),
),
4.height,
Expanded(
child: AppState().isArabic(context)
? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1)
: data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1),
),
],
),
const Expanded(flex: 1, child: SizedBox()),
],
),
const SizedBox(height: 8),
LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)),
],
),
);
},
separatorBuilder: (BuildContext cxt, int index) => 8.width,
itemCount: 9),
);
},
),
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47),
const SizedBox(height: 28),
LocaleKeys.viewallofferMazaya.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
}),
],
),
),
],
).paddingOnly(left: 21, right: 21, top: 14, bottom: 14),
),
),
).paddingOnly(left: 21, right: 21, top: 0, bottom: 21),
),
],
),
Container(
width: double.infinity,
padding: const EdgeInsets.only(top: 31),
@ -726,10 +602,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
height: Platform.isAndroid ? 70 : 100,
child: BottomNavigationBar(
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: SvgPicture.asset("assets/icons/home.svg", color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4),
label: LocaleKeys.home.tr(),
),
BottomNavigationBarItem(icon: SvgPicture.asset("assets/icons/home.svg", color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), label: LocaleKeys.home.tr()),
BottomNavigationBarItem(
icon: SvgPicture.asset("assets/icons/create_req.svg", color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4),
label: LocaleKeys.mowadhafhiRequest.tr(),
@ -771,28 +644,28 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
SvgPicture.asset(
"assets/icons/chat/chat.svg",
color:
!checkIfPrivilegedForChat()
? MyColors.lightGreyE3Color
: currentIndex == 4
? MyColors.grey3AColor
: cProvider.disbaleChatForThisUser
? MyColors.lightGreyE3Color
: MyColors.grey98Color,
!checkIfPrivilegedForChat()
? MyColors.lightGreyE3Color
: currentIndex == 4
? MyColors.grey3AColor
: cProvider.disbaleChatForThisUser
? MyColors.lightGreyE3Color
: MyColors.grey98Color,
).paddingAll(4),
Consumer<ChatProviderModel>(
builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
return !checkIfPrivilegedForChat()
? const SizedBox()
: Positioned(
right: 0,
top: 0,
child: Container(
padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.chatUConvCounter.toString().toText10(color: Colors.white),
),
);
right: 0,
top: 0,
child: Container(
padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.chatUConvCounter.toString().toText10(color: Colors.white),
),
);
},
),
],
@ -863,4 +736,4 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
}
return false;
}
}
}

@ -120,7 +120,7 @@ class _AppDrawerState extends State<AppDrawer> {
menuItem("assets/images/drawer/employee_id.svg", LocaleKeys.employeeDigitalID.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: EmployeeDigitialIdDialog())),
if (AppState().businessCardPrivilege)
menuItem("assets/images/drawer/view_business_card.svg", LocaleKeys.viewBusinessCard.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: BusinessCardDialog(), isBusniessCard: true)),
menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: (){Utils.performLogout(context, chatData);}),
menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: performLogout),
// menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: () {Navigator.pushNamed(context, AppRoutes.survey,);
],
).expanded,
@ -171,13 +171,13 @@ class _AppDrawerState extends State<AppDrawer> {
setState(() {});
}
// void performLogout() async {
// // AppState().isAuthenticated = false;
// // AppState().isLogged = false;
// // AppState().setPostParamsInitConfig();
// // chatData.disposeData();
// // // SharedPreferences prefs = await SharedPreferences.getInstance();
// // // await prefs.clear();
// // Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route<dynamic> route) => false, arguments: null);
// }
void performLogout() async {
AppState().isAuthenticated = false;
AppState().isLogged = false;
AppState().setPostParamsInitConfig();
chatData.disposeData();
// SharedPreferences prefs = await SharedPreferences.getInstance();
// await prefs.clear();
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route<dynamic> route) => false, arguments: null);
}
}

@ -1,13 +1,17 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:mohem_flutter_app/api/eit_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/sso_auth_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/ui/screens/ticket/ticket_detailed_screen.dart';
import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
import 'package:provider/provider.dart';
@ -117,8 +121,31 @@ class MenusWidget extends StatelessWidget {
),
],
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.ticketBalance.tr(), "HMG_TKT_NEW_EIT_SS"));
).onPress(() async {
//
// // Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => TicketDetailedScreen(url: url, jwtToken: ssoToken.data!.accessToken)));
//
// Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.ticketBalance.tr(), "HMG_TKT_NEW_EIT_SS"));
var pro = Provider.of<DashboardProviderModel>(context, listen: false);
// if (menuEntry.menuName == "HMG_TICKET_REQUESTS") {
Utils.showLoading(context);
//Ticket Work
if (pro.ticketBookingResponse != null && pro.ticketBookingResponse!.success) {
SSOAuthModel? ssoToken = await pro.fetchSSOAuthRedirection(clientID: pro.ticketBookingResponse!.clientId);
if (ssoToken != null) {
dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!);
await pro.fetchTicketAccuralBalance(context, DateTime.now());
pro.ticketHistoryTransactionList = await EITApiClient().getEITTransactions("HMG_TICKET_ITENARY_HR_EIT_SS", isCompleteList: true);
Utils.hideLoading(context);
// Here Need Work
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => TicketDetailedScreen(url: url, jwtToken: ssoToken.data!.accessToken)));
}
//}
} else {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.ticketBalance.tr(), "HMG_TKT_NEW_EIT_SS"));
}
}),
],
);

@ -39,7 +39,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(context, title: LocaleKeys.offerAndDiscounts.tr(), showHomeButton: true, showLogo: false, logoPath: "assets/icons/mazaya_brand.svg"),
appBar: AppBarWidget(context, title: LocaleKeys.offerAndDiscounts.tr(), showHomeButton: true, showLogo: true, logoPath: "assets/icons/mazaya_brand.svg"),
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -175,7 +175,7 @@ class SelectedItemSheet extends StatelessWidget {
if (favoriteReplacements != null) empID = favoriteReplacements!.userName;
if (replacementList != null) empID = replacementList!.userName;
try {
memberInformationListModel = await WorkListApiClient().getNotificationUserInformation(-999, empID!, notificationID!);
memberInformationListModel = await WorkListApiClient().getUserInformation(-999, empID!);
if (actionHistoryList != null) empID = actionHistoryList!.eMPLOYEEIMAGE = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp;
if (favoriteReplacements != null) empID = favoriteReplacements!.employeeImage = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp;
if (replacementList != null) empID = replacementList!.employeeImage = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp;

@ -125,17 +125,6 @@ class _WorkListScreenState extends State<WorkListScreen> {
key: 'PAY_REQ',
disable: false,
),
WorkListItemTypeModelData(
value: 0,
name: 'FA Disposal Request ',
fullName: LocaleKeys.faRequest.tr(),
active: false,
color: [Color(0xff42d7bf), Color(0xff42d7bf)],
icon: "assets/images/miss_swipe.svg",
key: 'HMG_FA_D',
disable: false,
),
];
int? workListItemIndex;

@ -25,7 +25,6 @@ import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:mohem_flutter_app/models/notification_get_respond_attributes_list_model.dart';
import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart';
import 'package:mohem_flutter_app/models/worklist/GetRFCEmployeeList.dart';
import 'package:mohem_flutter_app/models/worklist/get_fad_notifications.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
@ -93,7 +92,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
GetPrNotificationBodyList? getPrNotificationBody;
GetItemCreationNtfBodyList? getItemCreationNtfBody;
GetPaymentNotificationBodyList? getPaymentNotificationBodyList;
GetFaDisposalNtfDetails? getFADNotificationBody;
bool isCloseAvailable = false;
bool isApproveAvailable = false;
bool isRejectAvailable = false;
@ -178,9 +177,6 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (workListData!.iTEMTYPE == "PAY_REQ") {
getPaymentNotification();
}
if (workListData!.iTEMTYPE == "HMG_FA_D") {
getFADNotification();
}
if (controller.hasClients) {
controller.jumpToPage(0);
@ -276,7 +272,6 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getPrNotificationBodyList: getPrNotificationBody,
getTerminationNotificationBodyList: getTerminationNotificationBodyList,
getPaymentNotificationBodyList: getPaymentNotificationBodyList,
getFADNotificationBodyList: getFADNotificationBody
),
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP" || workListData!.iTEMTYPE == "PAY_REQ")
? DetailFragment(workListData, memberInformationListModel)
@ -818,7 +813,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
memberInformationListModel = null;
memberInformationListModel = await WorkListApiClient().getNotificationUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!, workListData!.nOTIFICATIONID!);
memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -1041,23 +1036,6 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
}
}
Future<void> getFADNotification() async {
try {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getFADNotificationBody = await WorkListApiClient().getFADNotificationBody(workListData!.nOTIFICATIONID);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
setState(() {});
}
} catch (ex) {
apiCallCount--;
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
void notificationGetRespondAttributes() async {
try {
if (apiCallCount == 0) Utils.showLoading(context);

@ -12,7 +12,6 @@ import 'package:mohem_flutter_app/models/get_po_notification_body_list_model.dar
import 'package:mohem_flutter_app/models/get_pr_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_stamp_ms_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/get_fad_notifications.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
@ -40,7 +39,7 @@ class InfoFragment extends StatelessWidget {
List<GetAddressNotificationBodyList>? getAddressNotificationBodyList = [];
List<TerminationNotificationBody>? getTerminationNotificationBodyList = [];
GetPaymentNotificationBodyList? getPaymentNotificationBodyList;
GetFaDisposalNtfDetails? getFADNotificationBodyList;
InfoFragment(
{this.workListData,
this.poHeaderList = const <POHeader>[],
@ -55,9 +54,7 @@ class InfoFragment extends StatelessWidget {
this.getPrNotificationBodyList,
this.getAddressNotificationBodyList,
this.getTerminationNotificationBodyList,
this.getPaymentNotificationBodyList,
this.getFADNotificationBodyList
});
this.getPaymentNotificationBodyList});
double itemHeight = 0;
double itemWidth = 0;
@ -132,10 +129,7 @@ class InfoFragment extends StatelessWidget {
getTerminationNotificationBodyList!),
if (getPaymentNotificationBodyList != null)
getPaymentNotificationBodyListWidget(getPaymentNotificationBodyList ??
GetPaymentNotificationBodyList()),
if (getFADNotificationBodyList != null)
getFANotificationBodyListWidget(getFADNotificationBodyList ??
GetFaDisposalNtfDetails())
GetPaymentNotificationBodyList())
.objectContainerView(),
];
return Container(
@ -928,125 +922,5 @@ class InfoFragment extends StatelessWidget {
],
);
}
Widget getFANotificationBodyListWidget(
GetFaDisposalNtfDetails? data) {
return Column(
children: [
12.height,
if (data!.pFaHeader!.isNotEmpty)
Column(
children: [
LocaleKeys.faHeader.tr().toText14(color: MyColors.textMixColor),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.requestNo.tr(),
data.pFaHeader![0].requestNo.toString() ?? ""),
ItemDetailViewCol(
LocaleKeys.stats.tr(), data.pFaHeader![0].status ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.bookTypeCode.tr(), data.pFaHeader![0].bookTypeCode ?? ""),
ItemDetailViewCol(LocaleKeys.categoryCode.tr(),
data.pFaHeader![0].categoryCode ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.categoryGroup.tr(),
data.pFaHeader![0].categoryGroup ?? ""),
ItemDetailViewCol(
LocaleKeys.comments.tr(), data.pFaHeader![0].comments ?? ""),
),
],
).objectContainerView(),
if (data!.pFaLines!.isNotEmpty)
Column(
children: [
LocaleKeys.faLINES.tr().toText14(color: MyColors.textMixColor),
ItemDetailGrid(
ItemDetailViewCol( LocaleKeys.requestNo.tr(),
data.pFaLines![0].requestNo.toString() ?? ""),
ItemDetailViewCol(
LocaleKeys.quantity.tr(), data.pFaLines![0].quantity.toString() ?? "" ),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.assetNumber.tr(), data.pFaLines![0].assetNumber.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.assetDescription.tr(),
data.pFaLines![0].assetDescription ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.barCodeNumber.tr(),
data.pFaLines![0] .barcodeNumber.toString() ?? ""),
ItemDetailViewCol(
LocaleKeys.datePlaceInService.tr(), DateUtil.formatDateToDate(
DateUtil.convertStringToDate( data.pFaLines![0].datePlacedInService ?? ""), false)),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.departmentName.tr(),
data.pFaLines![0].department ?? ""),
ItemDetailViewCol(LocaleKeys.serialNumber.tr(),
data.pFaLines![0].serialNumber ?? "") ,
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.disposedDate.tr(), DateUtil.formatDateToDate(
DateUtil.convertStringToDate( data.pFaLines![0].disposedDate ?? ""), false)),
ItemDetailViewCol(LocaleKeys.netBookValue.tr(),
data.pFaLines![0].netBookValue.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.poNumber.tr(), data.pFaLines![0].poNumber.toString() ?? "" ),
ItemDetailViewCol(LocaleKeys.purchasedPrice.tr(),
data.pFaLines![0].purchasePrice.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.usefulLife.tr(), data.pFaLines![0].usefulLife.toString() ?? "" ),
ItemDetailViewCol(LocaleKeys.yearsUsed.tr(),
data.pFaLines![0].yearsUsed.toString() ?? ""),
),
],
).objectContainerView(),
if (data!.pFaBuyers!.isNotEmpty)
Column(
children: [
LocaleKeys.buyer.tr().toText14(color: MyColors.textMixColor),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.requestNo.tr(), data.pFaBuyers![0].requestNo.toString() ?? ""),
ItemDetailViewCol( LocaleKeys.amount.tr(),
data.pFaBuyers![0].amount.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.buyerNumber.tr(),
data.pFaBuyers![0].buyerName!),
ItemDetailViewCol(
LocaleKeys.buyerNumber.tr(), data.pFaBuyers![0].buyerNumber ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol( LocaleKeys.highestBidder.tr(),
data.pFaBuyers![0].highestBidder ?? ""),
ItemDetailViewCol(
LocaleKeys.remarks.tr(), data.pFaBuyers![0].remarks ?? ""),
),
],
).objectContainerView(),
]);
}
}

@ -1,8 +1,5 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
void showMyBottomSheet(BuildContext context, {required Widget child, required VoidCallback callBackFunc, String? type}) {
showModalBottomSheet<String>(
@ -52,82 +49,6 @@ void showMyBottomSheet(BuildContext context, {required Widget child, required Vo
});
}
Widget openWorkListBottomSheet(BuildContext context, String? val, String? title){
return SafeArea(
child: Container(
padding: const EdgeInsets.all(16),
height: MediaQuery.of(context).size.height * 0.3 , // half-screen height
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// ---- Top Row with Title & Close Button ----
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title ?? "Details",
style: const TextStyle(
color: Color(0xff2BB8A6),
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
IconButton(
icon: const Icon(Icons.close, color: Colors.black54, size: 20),
onPressed: () {
Navigator.pop(context);
},
),
],
),
const Divider(height: 1, color: Colors.grey),
const SizedBox(height: 12),
// ---- Scrollable Content ----
Expanded(
child: SingleChildScrollView(
child: Text(
(val?.isEmpty ?? true)
? "--"
: val.toString(),
style: TextStyle(
color: MyColors.normalTextColor,
fontSize: 14,
height: 1.4,
),
),
),
),
SizedBox(
width: double.infinity,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xff2BB8A6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
padding: const EdgeInsets.symmetric(vertical: 12),
),
onPressed: () {
Navigator.pop(context);
},
child: Text(
LocaleKeys.close.tr(),
style: const TextStyle(
color: Colors.white,
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
);
}
class BottomSheetItem extends StatelessWidget {
final Function onTap;
final IconData icon;

@ -1,14 +1,11 @@
import 'dart:convert';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/itg_worklist_table_model.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
class ItemDetailView extends StatelessWidget {
final String title;
@ -43,7 +40,7 @@ class ItemDetailViewCol extends StatelessWidget {
children: [
"$title:".toText12(isBold: true, color: const Color(0xff2BB8A6), maxLine: 2),
4.width,
Flexible(child: (value.isEmpty ? "--" : value).toText12(color: MyColors.normalTextColor, maxLine: null)),
(value.isEmpty ? "--" : value).toText12(color: MyColors.normalTextColor, maxLine: 5),
],
);
}
@ -87,51 +84,18 @@ class ItemDetailViewGridItem extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
title != null ? Flexible(child: "$title:".toText12(isBold: true, color: const Color(0xff2BB8A6))) : Container(),
title != null ? Flexible(child: "$title:".toText12Auto(isBold: true, color: const Color(0xff2BB8A6))) : Container(),
4.width,
type != null
? type!.toLowerCase() == "table"
? getStringFromJSON(value!)
// : Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: 5))
: (value!.isEmpty ? "--" : value).toString().toText12(color: MyColors.normalTextColor, maxLine: 2)
: Container(),
if (value!.length > 100)
GestureDetector(
onTap: () {
showModalBottomSheet(
context: context,
enableDrag: true,
isDismissible: true,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
),
backgroundColor: Colors.white,
builder: (context) {
return openWorkListBottomSheet(context, value, title);
},
);
},
child: Padding(
padding: const EdgeInsets.only(top: 4),
child: Text(
LocaleKeys.showMore.tr(),
textAlign: TextAlign.right,
style: const TextStyle(
color: Color(0xff2BB8A6),
fontSize: 12,
fontWeight: FontWeight.w600,
),
),
),
),
type != null
? type!.toLowerCase() == "table"
? getStringFromJSON(value!)
// : Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: 5))
: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: maxLine)
: Container(),
],
).paddingOnly(top: showSpaceAfterLine ? 16 : 0, left: 2, right: 2),
).paddingOnly(top: showSpaceAfterLine ? 16 : 0),
);
}
}
class ItemDetailGrid extends StatelessWidget {
@ -189,4 +153,3 @@ Widget getStringFromJSON(String jsonString) {
return Flexible(child: ("-").toString().toText12Auto(color: MyColors.normalTextColor));
}
}

Loading…
Cancel
Save