Merge branch 'development_haroon' into 'master'

Development haroon

See merge request Cloud_Solution/mohemm-flutter-app!39
merge-requests/38/merge
haroon amjad 3 years ago
commit 7b473524a3

@ -0,0 +1 @@
{"v":"5.8.1","fr":30,"ip":0,"op":60,"w":300,"h":300,"nm":"loading_6","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":60,"s":[360]}],"ix":10},"p":{"a":0,"k":[150.00000000000003,150.00000000000003,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[30.000000000000004,30.000000000000004,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[300,300],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.12941176470588237,0.7411764705882353,0.7764705882352941,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[0]},{"t":60,"s":[99]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[1]},{"t":50,"s":[100]}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":60,"s":[3]}],"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":300,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":30,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[150.00000000000003,150.00000000000003,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[30.000000000000004,30.000000000000004,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[300,300],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.7450980392156863,0.9254901960784314,0.9372549019607843,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":300,"st":0,"bm":0}],"markers":[]}

@ -97,7 +97,7 @@ class ProfileApiClient {
Future<GenericResponseModel> getDffStructure(String pFunctionName, String uRL, String requestType) async {
String url = ApiConsts.erpRest + uRL;
Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_REQUEST_TYPE": pFunctionName, "P_COUNTRY_CODE": "SA"};
Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_REQUEST_TYPE": pFunctionName, "P_FUNCTION_NAME": pFunctionName, "P_COUNTRY_CODE": "SA"};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);

@ -287,7 +287,9 @@ class Utils {
String formattedDate;
if (date.isNotEmpty) {
formattedDate = date.split('T')[0];
if(!formattedDate.contains("00:00:00")) {
formattedDate = formattedDate + ' 00:00:00';
}
} else {
formattedDate = date;
}

@ -168,7 +168,7 @@ class ItemCreationLines {
int? tOROWNUM;
int? tRANSACTIONHEADERID;
int? tRANSACTIONLINEID;
int? uNITPRICE;
num? uNITPRICE;
String? uSERMANUFACTURERNAME;
String? uSERMFGPARTNUM;

@ -7,11 +7,11 @@ class GetPoItemHistoryList {
int? dISCOUNTPERCENTAGE;
int? fROMROWNUM;
int? iTEMID;
int? nETPRICE;
num? nETPRICE;
int? nOOFROWS;
String? oUNAME;
String? pONUMBER;
int? pURCHASEPRICE;
num? pURCHASEPRICE;
int? qUANTITYORDERED;
int? qUANTITYRECEIVED;
int? rEVISIONNUM;

@ -160,11 +160,11 @@ class POLines {
int? pOHEADERID;
String? pROMISEDDATE;
String? pRNUM;
int? qUANTITY;
num? qUANTITY;
String? rEQUESTOR;
int? rOWNUM;
int? tOROWNUM;
int? uNITPRICE;
num? uNITPRICE;
String? uOM;
POLines(

@ -8,8 +8,8 @@ class GetQuotationAnalysisList {
int? qUOTLINETOTAL;
String? qUOTMFGPARTNUM;
String? qUOTNUM;
int? qUOTQTY;
int? qUOTUNITPRICE;
num? qUOTQTY;
num? qUOTUNITPRICE;
String? qUOTUOM;
String? rFQNUM;
int? rFQQTY;

@ -0,0 +1,21 @@
class ITGWorkListTableModel {
String? label;
String? isTable;
String? textvalue;
ITGWorkListTableModel({this.label, this.isTable, this.textvalue});
ITGWorkListTableModel.fromJson(Map<String, dynamic> json) {
label = json['label'];
isTable = json['isTable'];
textvalue = json['textvalue'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = new Map<String, dynamic>();
data['label'] = this.label;
data['isTable'] = this.isTable;
data['textvalue'] = this.textvalue;
return data;
}
}

@ -19,6 +19,7 @@ import 'package:mohem_flutter_app/models/dashboard/mohemm_itg_pending_task_respo
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart';
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
/// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool
// ignore: prefer_mixin
@ -151,7 +152,18 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
logger.wtf(ex);
if (showLoading) Utils.hideLoading(context);
notifyListeners();
Utils.handleException(ex, context, null);
Utils.handleException(ex, context, (err) {
Utils.hideLoading(context);
showDialog(
context: context,
builder: (cxt) => ConfirmDialog(
message: err,
onTap: () {
Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route<dynamic> route) => false);
},
),
);
});
}
}

@ -430,6 +430,7 @@ class _AddVacationRuleScreenState extends State<AddVacationRuleScreen> {
onTap: () {
showMyBottomSheet(
context,
callBackFunc: (){},
child: SearchEmployeeBottomSheet(
title: LocaleKeys.searchForEmployee.tr(),
apiMode: LocaleKeys.delegate.tr(),

@ -160,6 +160,7 @@ class _ChatHomeScreenState extends State<ChatHomeScreen> {
// .getChatMemberFromSearch("aamir.muhammad", 36239);
showMyBottomSheet(
context,
callBackFunc: (){},
child: SearchEmployeeBottomSheet(
title: LocaleKeys.searchForEmployee.tr(),
apiMode: LocaleKeys.delegate.tr(),

@ -1,10 +1,10 @@
import 'dart:async';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/api/dashboard_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
@ -13,17 +13,13 @@ 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/itg_response_model.dart';
import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/dialogs/success_dialog.dart';
import 'package:mohem_flutter_app/ui/landing/itg/video_page.dart';
import 'package:mohem_flutter_app/ui/landing/widget/app_drawer.dart';
import 'package:mohem_flutter_app/ui/landing/widget/menus_widget.dart';
import 'package:mohem_flutter_app/ui/landing/widget/services_widget.dart';
import 'package:mohem_flutter_app/ui/marathon/widgets/marathon_banner.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/dialogs/dialogs.dart';
import 'package:mohem_flutter_app/widgets/mark_attendance_widget.dart';
import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
import 'package:mohem_flutter_app/widgets/shimmer/offers_shimmer_widget.dart';
@ -268,10 +264,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
bottomLeft: AppState().isArabic(context) ? Radius.circular(15) : Radius.circular(0),
),
),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/play.svg" : "assets/images/stop.svg"),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/attendance.svg" : "assets/images/attendance.svg"),
).onPress(() {
showMyBottomSheet(
context,
callBackFunc: (){},
child: MarkAttendanceWidget(model, isFromDashboard: true),
);
}),

@ -221,6 +221,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
onTap: () {
showMyBottomSheet(
context,
callBackFunc: (){},
child: SearchEmployeeBottomSheet(
title: LocaleKeys.searchForEmployee.tr(),
apiMode: LocaleKeys.delegate.tr(),

@ -260,7 +260,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
for (int i = 0; i < parentsList.length; i++) {
for (int j = 0; j < (getEitDffStructureList?.length ?? 0); j++) {
if (getEitDffStructureList![j].sEGMENTNAME == parentsList[i].opt1) {
if (getEitDffStructureList![j].sEGMENTNAME == parentsList[i].name) {
if (getEitDffStructureList![j].dISPLAYFLAG != "N") {
if (getEitDffStructureList![j].vALIDATIONTYPE == "N") {
String? idColName;

@ -283,10 +283,17 @@ class _DynamicInputScreenState extends State<DynamicInputScreenAddress> {
tempVar = e.getEmployeeAddressList!.sEGMENTVALUEDSP ?? "";
}
return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: tempVar.toString()).toJson();
return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 0, vARCHAR2VALUE: tempVar.toString()).toJson();
}).toList();
submitPhoneNumbers = await ProfileApiClient().submitAddressTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values, dynamicParams!.correctOrNew, countryCode, effectiveDate);
submitPhoneNumbers = await ProfileApiClient().submitAddressTransaction(
dESCFLEXCONTEXTCODE,
dynamicParams!.dynamicId,
values,
dynamicParams!.correctOrNew,
countryCode,
effectiveDate.isEmpty ? DateFormat('dd-MMM-yyy').format(DateTime.now().add(Duration(days: 35))) : effectiveDate,
);
print(values);
Utils.hideLoading(context);

@ -112,7 +112,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
void startImageSheet() {
showMyBottomSheet(context,
showMyBottomSheet(context, callBackFunc: (){},
child: Column(
children: [
Container(

@ -125,7 +125,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
},
children: [
RequestDetailFragment(fields: itgRequest?.fieldGoups?[1].fields ?? []),
ApprovalLevelfragment(wFHistory: itgRequest?.wFHistory ?? []),
ApprovalLevelfragment(wFHistory: itgRequest?.wFHistory ?? [], voidCallback: reloadITG,),
RequestDetailFragment(fields: itgRequest?.fieldGoups?[0].fields ?? []),
],
).expanded,
@ -263,12 +263,12 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
print(action.toJson());
switch (action.action) {
case "Delegate":
showMyBottomSheet(context,
showMyBottomSheet(context, callBackFunc: reloadITG,
child: DelegateSheet(title: LocaleKeys.delegate.tr(), apiMode: action.action!, notificationID: null, actionHistoryList: null, wFHistory: itgRequest?.wFHistory ?? []));
break;
case "RequestInformation":
showMyBottomSheet(context,
showMyBottomSheet(context, callBackFunc: reloadITG,
child: DelegateSheet(title: LocaleKeys.request_info.tr(), apiMode: action.action!, notificationID: null, actionHistoryList: null, wFHistory: itgRequest?.wFHistory ?? []));
break;
@ -342,10 +342,12 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
}
void performAction(String actionMode) {
print(actionMode);
showDialog(
context: context,
builder: (cxt) => ITGCommentsDialog(
message: LocaleKeys.writeComment.tr(),
actionMode: actionMode,
onTap: (note) {
if (actionMode == "APPROVED") {
performApproveAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note);
@ -404,4 +406,19 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
Utils.handleException(ex, context, null);
}
}
void reloadITG() {
AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!);
if (AppState().requestAllList!.isEmpty) {
Navigator.pop(context, "delegate_reload");
} else {
if (AppState().requestAllList!.length <= AppState().itgWorkListIndex!) {
Navigator.pop(context, "delegate_reload");
} else {
requestDetails = null;
getDataFromState();
}
}
}
}

@ -12,8 +12,9 @@ import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
class ApprovalLevelfragment extends StatelessWidget {
List<WFHistory> wFHistory;
VoidCallback voidCallback;
ApprovalLevelfragment({Key? key, this.wFHistory = const <WFHistory>[]}) : super(key: key);
ApprovalLevelfragment({Key? key, this.wFHistory = const <WFHistory>[], required this.voidCallback}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -98,6 +99,7 @@ class ApprovalLevelfragment extends StatelessWidget {
LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() {
showMyBottomSheet(
context,
callBackFunc: voidCallback,
child: SelectedItgItemSheet(
LocaleKeys.comments.tr(),
wfHistory: history,
@ -109,6 +111,7 @@ class ApprovalLevelfragment extends StatelessWidget {
LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() {
showMyBottomSheet(
context,
callBackFunc: voidCallback,
child: SelectedItgItemSheet(
LocaleKeys.comments.tr(),
wfHistory: history,
@ -126,18 +129,21 @@ class ApprovalLevelfragment extends StatelessWidget {
}
Color getStatusColor(String code) {
if (code == "Submit") {
if (code.toLowerCase() == "submit") {
return MyColors.grey3AColor;
} else if (code == "Pending") {
} else if (code.toLowerCase() == "pending") {
return MyColors.yellowColor;
} else if (code == "Not Doable" || code == "Rejected") {
} else if (code.toLowerCase() == "not doable" || code.toLowerCase() == "rejected") {
return MyColors.redColor;
} else if (code == "APPROVED") {
} else if (code.toLowerCase() == "approved" ||
code.toLowerCase() == "auto-approve" ||
code.toLowerCase() == "auto-approved" ||
code.toLowerCase() == "doable") {
return MyColors.greenColor;
} else if (code == "Requested Information") {
} else if (code.toLowerCase() == "requested information" || code.toLowerCase() == "assign" || code.toLowerCase() == "reassign") {
return MyColors.orange;
} else {
return MyColors.yellowColor;
return MyColors.whiteColor;
}
}
}

@ -51,6 +51,7 @@ class RequestDetailFragment extends StatelessWidget {
? true
: false
: false,
type: fields[index].type,
);
}
return ItemDetailViewGridItem(
@ -62,6 +63,7 @@ class RequestDetailFragment extends StatelessWidget {
? true
: false
: false,
type: fields[index].type,
);
},
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(

@ -194,6 +194,7 @@ class _DelegateSheetState extends State<DelegateSheet> {
).onPress(() {
showMyBottomSheet(
context,
callBackFunc: (){},
child: SearchOptionsSheet(
selectedType,
onSelection: (String value) {
@ -392,6 +393,7 @@ class _DelegateSheetState extends State<DelegateSheet> {
return InkWell(
onTap: () {
showMyBottomSheet(context,
callBackFunc: (){},
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
@ -437,6 +439,7 @@ class _DelegateSheetState extends State<DelegateSheet> {
return InkWell(
onTap: () {
showMyBottomSheet(context,
callBackFunc: (){},
child: SelectedItgItemSheet(
"Comment",
apiMode: widget.apiMode,
@ -461,6 +464,7 @@ class _DelegateSheetState extends State<DelegateSheet> {
return InkWell(
onTap: () {
showMyBottomSheet(context,
callBackFunc: (){},
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
@ -506,6 +510,7 @@ class _DelegateSheetState extends State<DelegateSheet> {
return InkWell(
onTap: () {
showMyBottomSheet(context,
callBackFunc: (){},
child: SelectedItemSheet(
LocaleKeys.comments.tr(),
apiMode: widget.apiMode,

@ -71,7 +71,7 @@ class SelectedItemSheet extends StatelessWidget {
child: DefaultButton(
LocaleKeys.cancel.tr(),
() {
Navigator.pop(context);
Navigator.pop(context, "cancel");
},
textColor: Colors.black,
colors: [
@ -120,8 +120,8 @@ class SelectedItemSheet extends StatelessWidget {
try {
await WorkListApiClient().submitComment(comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode);
Utils.hideLoading(context);
Navigator.pop(context);
Navigator.pop(context);
// Navigator.pop(context);
// Navigator.pop(context);
Navigator.pop(context, "delegate_reload");
} catch (ex) {
Utils.hideLoading(context);
@ -142,7 +142,7 @@ class SelectedItemSheet extends StatelessWidget {
padding: EdgeInsets.only(top: 16, bottom: 16, left: 21, right: 21),
child: Row(
children: [
actionHistoryList != null
(actionHistoryList != null && actionHistoryList!.eMPLOYEEIMAGE != null)
? CircularAvatar(
height: 30,
width: 30,

@ -429,6 +429,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
void openBottomSheet(BuildContext context) {
showMyBottomSheet(
context,
callBackFunc: (){},
child: WorkListAdvanceSearch((selectedViewID, selectedItemTypeID, searchByInput, searchByDate) async {
itgRequestTypeIndex = null;
pNotificationType = selectedViewID;

@ -1,6 +1,7 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:lottie/lottie.dart';
import 'package:mohem_flutter_app/api/worklist/worklist_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
@ -82,6 +83,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
bool isApproveAvailable = false;
bool isRejectAvailable = false;
bool isAttachmentLoaded = false;
bool isActionHistoryLoaded = false;
@override
void initState() {
super.initState();
@ -241,8 +245,20 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
itemCreationLines: getItemCreationNtfBody?.itemCreationLines ?? [],
prLinesList: getPrNotificationBody?.pRLines ?? [],
),
actionHistoryList.isEmpty ? Utils.getNoDataWidget(context) : ActionsFragment(workListData!.nOTIFICATIONID, actionHistoryList),
getAttachmentList.isEmpty ? Utils.getNoDataWidget(context) : AttachmentsFragment(getAttachmentList),
isActionHistoryLoaded
? actionHistoryList.isEmpty
? Utils.getNoDataWidget(context)
: ActionsFragment(
workListData!.nOTIFICATIONID,
actionHistoryList,
voidCallback: reloadWorkList,
)
: showLoadingAnimation(),
isAttachmentLoaded
? getAttachmentList.isEmpty
? Utils.getNoDataWidget(context)
: AttachmentsFragment(getAttachmentList)
: showLoadingAnimation(),
],
).expanded,
if (isApproveAvailable || isRejectAvailable || isCloseAvailable)
@ -371,20 +387,24 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
switch (notificationButton.bUTTONACTION) {
case "DELEGATE":
showMyBottomSheet(context,
callBackFunc: reloadWorkList,
child: DelegateSheet(title: LocaleKeys.delegate.tr(), apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "REQUEST_INFO":
// do something else
showMyBottomSheet(context,
callBackFunc: reloadWorkList,
child: DelegateSheet(title: LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "TRANSFER_INFO":
// do something else
showMyBottomSheet(context,
child: DelegateSheet(title: notificationButton.bUTTONLABEL!, apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
callBackFunc: reloadWorkList,
child:
DelegateSheet(title: notificationButton.bUTTONLABEL!, apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "ANSWER_INFO":
performAction(notificationButton.bUTTONACTION!,title: notificationButton.bUTTONLABEL);
performAction(notificationButton.bUTTONACTION!, title: notificationButton.bUTTONLABEL);
break;
case "RFC":
// do something else
@ -396,10 +416,13 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
// do something else
case "APPROVE_AND_FORWARD":
showMyBottomSheet(context,
callBackFunc: reloadWorkList,
child: DelegateSheet(title: "Approve and Forward", apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "FORWARD":
showMyBottomSheet(context, child: DelegateSheet(title: "Forward", apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
showMyBottomSheet(context,
callBackFunc: reloadWorkList,
child: DelegateSheet(title: "Forward", apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "REJECT":
performNetworkCall(context, email: "", userId: "");
@ -492,14 +515,15 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
);
}
void performAction(String actionMode,{String? title}) {
void performAction(String actionMode, {String? title}) {
TextEditingController textEditingController = TextEditingController();
showDialog(
context: context,
builder: (cxt) => AcceptRejectInputDialog(
message: title !=null ? null:LocaleKeys.requestedItems.tr(),
message: title != null ? null : LocaleKeys.requestedItems.tr(),
title: title,
notificationGetRespond: notificationNoteInput,
actionMode: actionMode,
onTap: (note) {
Map<String, dynamic> payload = {
"P_ACTION_MODE": actionMode,
@ -550,6 +574,20 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
}
}
void reloadWorkList() {
AppState().workList!.removeAt(AppState().workListIndex!);
if (AppState().workList!.isEmpty) {
Navigator.pop(context, "delegate_reload");
} else {
if (AppState().workList!.length <= AppState().workListIndex!) {
Navigator.pop(context, "delegate_reload");
} else {
workListData = null;
getDataFromState();
}
}
}
void getEitNotificationBody() async {
try {
if (apiCallCount == 0) Utils.showLoading(context);
@ -791,7 +829,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
// apiCallCount--;
// if (apiCallCount == 0) {
// Utils.hideLoading(context);
setState(() {});
setState(() {
isActionHistoryLoaded = true;
});
// }
} catch (ex) {
// apiCallCount--;
@ -808,7 +848,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
// apiCallCount--;
// if (apiCallCount == 0) {
// Utils.hideLoading(context);
setState(() {});
setState(() {
isAttachmentLoaded = true;
});
// }
} catch (ex) {
// apiCallCount--;
@ -816,4 +858,13 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
Utils.handleException(ex, context, null);
}
}
Widget showLoadingAnimation() {
return Lottie.asset(
'assets/lottie/loading.json',
repeat: true,
reverse: false,
fit: BoxFit.contain,
);
}
}

@ -7,7 +7,6 @@ import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/get_action_history_list_model.dart';
import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart';
import 'package:mohem_flutter_app/ui/work_list/sheets/selected_item_sheet.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
@ -15,8 +14,9 @@ import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
class ActionsFragment extends StatelessWidget {
int? notificationID;
List<GetActionHistoryList> actionHistoryList;
VoidCallback voidCallback;
ActionsFragment(this.notificationID, this.actionHistoryList, {Key? key}) : super(key: key);
ActionsFragment(this.notificationID, this.actionHistoryList, {Key? key, required this.voidCallback}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -99,13 +99,17 @@ class ActionsFragment extends StatelessWidget {
Row(
children: [
LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() {
showMyBottomSheet(context,
child: DelegateSheet(title: LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: notificationID, actionHistoryList: actionHistoryList));
showMyBottomSheet(
context,
callBackFunc: voidCallback,
child: SelectedItemSheet(LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: notificationID, actionHistoryList: actionHistory),
);
}).expanded,
Container(width: 1, height: 30, color: MyColors.lightGreyEFColor),
LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() {
showMyBottomSheet(
context,
callBackFunc: voidCallback,
child: SelectedItemSheet(
LocaleKeys.comments.tr(),
apiMode: "DELEGATE",
@ -133,9 +137,9 @@ class ActionsFragment extends StatelessWidget {
return MyColors.redColor;
} else if (code == "PENDING") {
return MyColors.orange;
} else if (code == "APPROVED" || code == "APPROVE") {
} else if (code == "APPROVED" || code == "APPROVE" || code == "ANSWER_INFO") {
return const Color(0xff1FA269);
} else if (code == "REQUEST_INFO") {
} else if (code == "REQUEST_INFO"|| code == "FORWARD") {
return const Color(0xff2E303A);
} else if (code != "SUBMIT" && code != "REJECT" && code != "PENDING") {
return MyColors.orange;

@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
void showMyBottomSheet(BuildContext context, {required Widget child}) {
showModalBottomSheet<void>(
void showMyBottomSheet(BuildContext context, {required Widget child, required VoidCallback callBackFunc}) {
showModalBottomSheet<String>(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
@ -37,7 +37,13 @@ void showMyBottomSheet(BuildContext context, {required Widget child}) {
),
);
},
);
).then((value) {
// print("BACK FROM DELEGATE!!!!");
// print("value: $value");
if (value == "delegate_reload") {
callBackFunc();
}
});
}
class BottomSheetItem extends StatelessWidget {

@ -25,7 +25,7 @@ class CircularAvatar extends StatelessWidget {
image: NetworkImage(url ?? "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png"),
),
),
child: isImageBase64 ? imageFromBase64String(url!) : null,
child: (isImageBase64 && url != null) ? imageFromBase64String(url!) : Container(),
);
}

@ -13,11 +13,13 @@ class AcceptRejectInputDialog extends StatelessWidget {
final String? title;
final String? message;
final String? okTitle;
final String? actionMode;
final NotificationGetRespondAttributesList? notificationGetRespond;
final Function(String) onTap;
// final TextEditingController textEditingController;
AcceptRejectInputDialog({Key? key, this.title, @required this.message, this.okTitle, required this.onTap, this.notificationGetRespond}) : super(key: key);
AcceptRejectInputDialog({Key? key, this.title, @required this.message, this.okTitle, required this.onTap, this.notificationGetRespond, this.actionMode}) : super(key: key);
String note = "";
@ -85,12 +87,17 @@ class AcceptRejectInputDialog extends StatelessWidget {
).expanded,
10.width,
DefaultButton(
LocaleKeys.ok.tr(),
actionMode == "REJECTED" ? LocaleKeys.reject.tr() : LocaleKeys.ok.tr(),
() {
Navigator.pop(context);
onTap(note);
},
colors: const [
colors: actionMode == "REJECTED"
? const [
Color(0xffE47A7E),
Color(0xffE47A7E),
]
: const [
Color(0xff28C884),
Color(0xff1BB271),
],

@ -2,6 +2,7 @@ import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
@ -12,9 +13,10 @@ class ITGCommentsDialog extends StatelessWidget {
final String? title;
final String? message;
final String? okTitle;
final String? actionMode;
final Function(String) onTap;
ITGCommentsDialog({Key? key, this.title, @required this.message, this.okTitle, required this.onTap}) : super(key: key);
ITGCommentsDialog({Key? key, this.title, @required this.message, this.okTitle, required this.onTap, this.actionMode}) : super(key: key);
String note = "";
@ -82,12 +84,21 @@ class ITGCommentsDialog extends StatelessWidget {
).expanded,
10.width,
DefaultButton(
LocaleKeys.ok.tr(),
actionMode == "REJECTED" ? LocaleKeys.reject.tr() : LocaleKeys.approve.tr(),
() {
if (actionMode == "REJECTED" && note.isEmpty) {
Utils.showToast(LocaleKeys.pleaseEnterComments.tr());
} else {
Navigator.pop(context);
onTap(note);
}
},
colors: const [
colors: actionMode == "REJECTED"
? const [
Color(0xffE47A7E),
Color(0xffE47A7E),
]
: const [
Color(0xff28C884),
Color(0xff1BB271),
],

@ -13,6 +13,7 @@ class ImageOptions {
static void showImageOptionsNew(BuildContext context, bool showFilesOption, Function(String, File) image) {
showMyBottomSheet(
context,
callBackFunc: (){},
child: AttachmentOptions(
showFilesOption: showFilesOption,
onCameraTap: () async {

@ -1,8 +1,11 @@
import 'dart:convert';
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/models/itg_forms_models/itg_worklist_table_model.dart';
class ItemDetailView extends StatelessWidget {
final String title;
@ -46,9 +49,10 @@ class ItemDetailViewGridItem extends StatelessWidget {
int index;
final String? title;
final String? value;
final String? type;
final bool isNeedToShowEmptyDivider;
ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false}) : super(key: key);
ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false, this.type = ""}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -78,7 +82,7 @@ class ItemDetailViewGridItem extends StatelessWidget {
children: [
Flexible(child: "$title:".toText12Auto(isBold: true, color: const Color(0xff2BB8A6))),
4.width,
Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor)),
type!.toLowerCase() == "table" ? getStringFromJSON(value!) : Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor)),
],
),
);
@ -129,3 +133,14 @@ class ItemDetailGrid extends StatelessWidget {
);
}
}
Widget getStringFromJSON(String jsonString) {
var body = json.decode(jsonString);
ITGWorkListTableModel itgWorkListTableModel = ITGWorkListTableModel();
if (body.length != 0) {
itgWorkListTableModel = ITGWorkListTableModel.fromJson(body[0][0]);
return Flexible(child: (itgWorkListTableModel.textvalue).toString().toText12Auto(color: MyColors.normalTextColor));
} else {
return Flexible(child: ("-").toString().toText12Auto(color: MyColors.normalTextColor));
}
}

Loading…
Cancel
Save