Merge branch 'development_haroon' into 'master'

Development haroon

See merge request Cloud_Solution/mohemm-flutter-app!60
merge-requests/54/merge
haroon amjad 3 years ago
commit 9d81a220b2

@ -403,6 +403,24 @@ class WorkListApiClient {
}, url, postParams); }, url, postParams);
} }
Future<ITGRequest?> grantITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async {
String url = "${ApiConsts.cocRest}ITGGrantAccess";
Map<String, dynamic> postParams = {
"RequestType": requestType,
"TaskID": taskId,
"ItemID": itemId,
"EmployeeNumber": employeeNumber,
"Comments": "",
"AdditionalFields": null,
"NewUserEMPId":newUserEMPId
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
ItgFormsModel responseData = ItgFormsModel.fromJson(json);
return responseData.itgRequest;
}, url, postParams);
}
Future<ITGRequest?> informationITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async { Future<ITGRequest?> informationITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async {
String url = "${ApiConsts.cocRest}ITGRequestInformation"; String url = "${ApiConsts.cocRest}ITGRequestInformation";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {

@ -120,6 +120,12 @@ class AppState {
set setItgWorkListIndex(int? _itgWorkListIndex) => itgWorkListIndex = _itgWorkListIndex; set setItgWorkListIndex(int? _itgWorkListIndex) => itgWorkListIndex = _itgWorkListIndex;
String? itgRequestType;
set setItgRequestType(String? _itgRequestType) => itgRequestType = _itgRequestType;
String? get getItgRequestType => itgRequestType;
UserAutoLoginModel? chatDetails; UserAutoLoginModel? chatDetails;
set setchatUserDetails(UserAutoLoginModel details) => chatDetails = details; set setchatUserDetails(UserAutoLoginModel details) => chatDetails = details;

@ -1,7 +1,7 @@
class ApiConsts { class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server //static String baseUrl = "http://10.200.204.20:2801/"; // Local server
//static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
static String baseUrl = "https://hmgwebservices.com"; // Live server //static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";

@ -381,6 +381,30 @@ class DateUtil {
return ""; return "";
} }
static String formatDuration(Duration d) {
var seconds = d.inSeconds;
var days = seconds ~/ Duration.secondsPerDay;
seconds -= days * Duration.secondsPerDay;
var hours = seconds ~/ Duration.secondsPerHour;
seconds -= hours * Duration.secondsPerHour;
var minutes = seconds ~/ Duration.secondsPerMinute;
seconds -= minutes * Duration.secondsPerMinute;
List<String> tokens = [];
if (days != 0) {
tokens.add('$days days');
}
if (tokens.isNotEmpty || hours != 0) {
tokens.add('$hours hours');
}
if (tokens.isNotEmpty || minutes != 0) {
tokens.add('$minutes mins');
}
tokens.add('$seconds secs');
return tokens.join(' ');
}
/// get data formatted like 26/4/2020 /// get data formatted like 26/4/2020
/// [dateTime] convert DateTime to data formatted according to language /// [dateTime] convert DateTime to data formatted according to language
static String getDayMonthYearDateFormattedLang(DateTime dateTime, bool isArabic) { static String getDayMonthYearDateFormattedLang(DateTime dateTime, bool isArabic) {
@ -431,30 +455,30 @@ class DateUtil {
return "/Date(" + DateFormat('mm-dd-yyy').parse(isoDate).millisecondsSinceEpoch.toString() + ")/"; return "/Date(" + DateFormat('mm-dd-yyy').parse(isoDate).millisecondsSinceEpoch.toString() + ")/";
} }
// static String getDay(DayOfWeek dayOfWeek) { // static String getDay(DayOfWeek dayOfWeek) {
// switch (dayOfWeek) { // switch (dayOfWeek) {
// case DayOfWeek.Monday: // case DayOfWeek.Monday:
// return "Monday"; // return "Monday";
// break; // break;
// case DayOfWeek.Tuesday: // case DayOfWeek.Tuesday:
// return "Tuesday"; // return "Tuesday";
// break; // break;
// case DayOfWeek.Wednesday: // case DayOfWeek.Wednesday:
// return "Wednesday"; // return "Wednesday";
// break; // break;
// case DayOfWeek.Thursday: // case DayOfWeek.Thursday:
// return "Thursday"; // return "Thursday";
// break; // break;
// case DayOfWeek.Friday: // case DayOfWeek.Friday:
// return "Friday"; // return "Friday";
// break; // break;
// case DayOfWeek.Saturday: // case DayOfWeek.Saturday:
// return "Saturday"; // return "Saturday";
// break; // break;
// case DayOfWeek.Sunday: // case DayOfWeek.Sunday:
// return "Sunday"; // return "Sunday";
// break; // break;
// } // }
// return ""; // return "";
// } // }
} }

@ -22,8 +22,9 @@ extension EmailValidator on String {
style: TextStyle(fontSize: 10, fontStyle: fontStyle ?? FontStyle.normal, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4), style: TextStyle(fontSize: 10, fontStyle: fontStyle ?? FontStyle.normal, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
); );
Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isBold = false}) => Text( Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isBold = false, int maxLine = 0}) => Text(
this, this,
maxLines: (maxLine > 0) ? maxLine : null,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600), fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600),

@ -0,0 +1,37 @@
//
// Generated file. Do not edit.
//
// ignore_for_file: directives_ordering
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: depend_on_referenced_packages
import 'package:file_picker/_internal/file_picker_web.dart';
import 'package:firebase_core_web/firebase_core_web.dart';
import 'package:firebase_messaging_web/firebase_messaging_web.dart';
import 'package:fluttertoast/fluttertoast_web.dart';
import 'package:geolocator_web/geolocator_web.dart';
import 'package:google_maps_flutter_web/google_maps_flutter_web.dart';
import 'package:image_picker_for_web/image_picker_for_web.dart';
import 'package:shared_preferences_web/shared_preferences_web.dart';
import 'package:url_launcher_web/url_launcher_web.dart';
import 'package:video_player_web/video_player_web.dart';
import 'package:wakelock_web/wakelock_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
// ignore: public_member_api_docs
void registerPlugins(Registrar registrar) {
FilePickerWeb.registerWith(registrar);
FirebaseCoreWeb.registerWith(registrar);
FirebaseMessagingWeb.registerWith(registrar);
FluttertoastWebPlugin.registerWith(registrar);
GeolocatorPlugin.registerWith(registrar);
GoogleMapsPlugin.registerWith(registrar);
ImagePickerPlugin.registerWith(registrar);
SharedPreferencesPlugin.registerWith(registrar);
UrlLauncherPlugin.registerWith(registrar);
VideoPlayerPlugin.registerWith(registrar);
WakelockWeb.registerWith(registrar);
registrar.registerMessageHandler();
}

@ -92,6 +92,12 @@ class MyApp extends StatelessWidget {
MonthYearPickerLocalizations.delegate, MonthYearPickerLocalizations.delegate,
); );
return MaterialApp( return MaterialApp(
builder: (BuildContext context, Widget? child) {
return MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: child!,
);
},
theme: AppTheme.getTheme( theme: AppTheme.getTheme(
EasyLocalization.of(context)?.locale.languageCode == "ar", EasyLocalization.of(context)?.locale.languageCode == "ar",
), ),

@ -431,7 +431,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
expand: false, expand: false,
builder: (_, controller) { builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString); DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString);
return Column( return Column(
children: [ children: [
Container( Container(

@ -1,10 +1,7 @@
import 'dart:convert';
import 'dart:ui'; import 'dart:ui';
import 'package:camera/camera.dart'; import 'package:camera/camera.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:just_audio/just_audio.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/models/chat/call.dart'; import 'package:mohem_flutter_app/models/chat/call.dart';

@ -53,8 +53,8 @@ class _SuccessDialogState extends State<SuccessDialog> with TickerProviderStateM
repeat: false, repeat: false,
reverse: false, reverse: false,
controller: _controller, controller: _controller,
frameRate: FrameRate(60.0),
onLoaded: (LottieComposition v) async { onLoaded: (LottieComposition v) async {
print("calling_lottie " + v.seconds.toString());
await playSuccessSound(); await playSuccessSound();
_controller _controller
..duration = v.duration ..duration = v.duration

@ -258,7 +258,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0), margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
width: 45, width: 45,
height: 45, height: 45,
padding: const EdgeInsets.only(left: 14, right: 14), padding: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xff259EA4), color: Color(0xff259EA4),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@ -298,7 +298,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
], ],
).paddingOnly(left: 21, right: 21, top: 7), ).paddingOnly(left: 21, right: 21, top: 7),
MarathonBanner().paddingAll(20), const MarathonBanner().paddingAll(20),
ServicesWidget(), ServicesWidget(),
// 8.height, // 8.height,
Container( Container(

@ -86,7 +86,7 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen2> {
child: CircularStepProgressBar( child: CircularStepProgressBar(
totalSteps: 16 * 4, totalSteps: 16 * 4,
currentStep: (model.progress * 100).toInt(), currentStep: (model.progress * 100).toInt(),
selectedColor: MyColors.gradiantEndColor, selectedColor: MyColors.gradiantStartColor,
unselectedColor: MyColors.grey70Color, unselectedColor: MyColors.grey70Color,
child: Center( child: Center(
child: Padding( child: Padding(

@ -39,7 +39,7 @@ class ServicesWidget extends StatelessWidget {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().paddingOnly(left: 21, right: 21), data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().paddingOnly(left: 21, right: 21),
SizedBox( SizedBox(
height: 105 + 26, height: 105 + 26,
@ -69,12 +69,12 @@ class ServicesWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SvgPicture.asset(iconT[index]), SvgPicture.asset(AppState().isArabic(context) ? getMenuIconAr(data.homeMenus![parentIndex].menuEntiesList[index].prompt!) : getMenuIconEn(data.homeMenus![parentIndex].menuEntiesList[index].prompt!)),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Expanded( Expanded(
child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText10(isBold: true), child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText11(isBold: true),
), ),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)),
], ],
@ -102,6 +102,92 @@ class ServicesWidget extends StatelessWidget {
); );
} }
String getMenuIconAr(String name) {
String returnImage = "";
switch (name) {
case "الحضور الشهري":
returnImage = "assets/images/services_icons/monthly_attendance.svg";
break;
case "كشف الراتب":
returnImage = "assets/images/services_icons/payslips.svg";
break;
case "تغيير معلومات البنك":
returnImage = "assets/images/services_icons/change_bank_details.svg";
break;
case "طلب بدل السكن مقدما":
returnImage = "assets/images/services_icons/housing_allowance.svg";
break;
case "شهادات تعريف الموظف":
returnImage = "assets/images/services_icons/employee_certificates.svg";
break;
case "البيانات الشخصية":
returnImage = "assets/images/personal-info.svg";
break;
case "الحضور":
returnImage = "assets/images/services_icons/my_attendance.svg";
break;
case "طلبات أخرى":
returnImage = "assets/images/services_icons/other_requests.svg";
break;
case "الإجازات":
returnImage = "assets/images/services_icons/my_leaves.svg";
break;
case "طلب تذكرة":
returnImage = "assets/images/services_icons/ticket_bal.svg";
break;
case "قاعدة الاجازات":
returnImage = "assets/images/services_icons/vacation_rule.svg";
break;
default:
returnImage = "assets/images/monthly_attendance.svg";
break;
}
return returnImage;
}
String getMenuIconEn(String name) {
String returnImage = "";
switch (name) {
case "Monthly Attendance":
returnImage = "assets/images/services_icons/monthly_attendance.svg";
break;
case "Payslip":
returnImage = "assets/images/services_icons/payslips.svg";
break;
case "Change Bank Details":
returnImage = "assets/images/services_icons/change_bank_details.svg";
break;
case "Housing Advance":
returnImage = "assets/images/services_icons/housing_allowance.svg";
break;
case "Employee Certificate":
returnImage = "assets/images/services_icons/employee_certificates.svg";
break;
case "Personal Information":
returnImage = "assets/images/personal-info.svg";
break;
case "My Attendance":
returnImage = "assets/images/services_icons/my_attendance.svg";
break;
case "Other Requests":
returnImage = "assets/images/services_icons/other_requests.svg";
break;
case "My Leave":
returnImage = "assets/images/services_icons/my_leaves.svg";
break;
case "Ticket Request":
returnImage = "assets/images/services_icons/ticket_bal.svg";
break;
case "Vacation Rule":
returnImage = "assets/images/services_icons/vacation_rule.svg";
break;
default:
returnImage = "assets/images/monthly_attendance.svg";
break;
}
return returnImage;
}
void handleOnPress(context, GetMenuEntriesList menuEntry) { void handleOnPress(context, GetMenuEntriesList menuEntry) {
var pro = Provider.of<DashboardProviderModel>(context, listen: false); var pro = Provider.of<DashboardProviderModel>(context, listen: false);
if (menuEntry.requestType == "MONTHLY_ATTENDANCE") { if (menuEntry.requestType == "MONTHLY_ATTENDANCE") {

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

@ -142,7 +142,7 @@ class MarathonBanner extends StatelessWidget {
bottom: 0, bottom: 0,
child: RotatedBox( child: RotatedBox(
quarterTurns: 4, quarterTurns: 4,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkDigitColor), child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor),
).paddingAll(15), ).paddingAll(15),
) )
: Positioned( : Positioned(
@ -150,7 +150,7 @@ class MarathonBanner extends StatelessWidget {
left: 0, left: 0,
child: RotatedBox( child: RotatedBox(
quarterTurns: 2, quarterTurns: 2,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkDigitColor), child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor),
).paddingAll(15), ).paddingAll(15),
), ),
], ],

@ -68,7 +68,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
} }
void validateTransaction() async { void validateTransaction() async {
// try { try {
Utils.showLoading(context); Utils.showLoading(context);
List<Map<String, dynamic>> values = getEitDffStructureList!.map((e) { List<Map<String, dynamic>> values = getEitDffStructureList!.map((e) {
String tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? ""; String tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? "";
@ -114,10 +114,10 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
Utils.showLoading(context); Utils.showLoading(context);
await LeaveBalanceApiClient().cancelHrTransaction(submitEITTransactionList.pTRANSACTIONID!); await LeaveBalanceApiClient().cancelHrTransaction(submitEITTransactionList.pTRANSACTIONID!);
Utils.hideLoading(context); Utils.hideLoading(context);
// } catch (ex) { } catch (ex) {
// Utils.hideLoading(context); Utils.hideLoading(context);
// Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
// } }
} }
String dESCFLEXCONTEXTCODE = ""; String dESCFLEXCONTEXTCODE = "";

@ -439,7 +439,7 @@ class _ViewAttendanceState extends State<ViewAttendance> {
expand: false, expand: false,
builder: (_, controller) { builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString); DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString);
return Column( return Column(
children: [ children: [
Container( Container(

@ -383,7 +383,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
), ),
); );
} else { } else {
DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(1920, 1), lastDate: DateTime.now());
if (picked != null && picked != selectedDate) { if (picked != null && picked != selectedDate) {
time = picked; time = picked;
} }

@ -128,7 +128,8 @@ class _FamilyMembersState extends State<FamilyMembers> {
), ),
DefaultButton(LocaleKeys.addNewFamilyMember.tr(), DefaultButton(LocaleKeys.addNewFamilyMember.tr(),
menuEntries.updateButton == 'Y' menuEntries.updateButton == 'Y'
? () async { ?
() async {
Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"}); Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"});
// ProfileScreen(); // ProfileScreen();
} : null).insideContainer, } : null).insideContainer,

@ -25,8 +25,9 @@ class AddItemDetailsFragment extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
final GetSaleCategoriesList selectedSaleCategory; final GetSaleCategoriesList selectedSaleCategory;
static late ItemReviewModel itemReviewModel; static late ItemReviewModel itemReviewModel;
static late bool isUpdate;
const AddItemDetailsFragment({Key? key, required this.changePageViewIndex, required this.selectedSaleCategory}) : super(key: key); AddItemDetailsFragment({Key? key, required this.changePageViewIndex, required this.selectedSaleCategory}) : super(key: key);
@override @override
State<AddItemDetailsFragment> createState() => _AddItemDetailsFragmentState(); State<AddItemDetailsFragment> createState() => _AddItemDetailsFragmentState();
@ -246,6 +247,7 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
String details = await Utils.getStringFromPrefs(SharedPrefsConsts.editItemForSale); String details = await Utils.getStringFromPrefs(SharedPrefsConsts.editItemForSale);
if(details.isNotEmpty) { if(details.isNotEmpty) {
var body = json.decode(details); var body = json.decode(details);
AddItemDetailsFragment.isUpdate = true;
GetRegionsList selectedRegionAd = GetRegionsList(); GetRegionsList selectedRegionAd = GetRegionsList();
@ -268,6 +270,8 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
AddItemDetailsFragment.itemReviewModel = itemReviewModel; AddItemDetailsFragment.itemReviewModel = itemReviewModel;
SelectCategoryFragment.selectedSaleCategory = selectedSaleCategoryAd; SelectCategoryFragment.selectedSaleCategory = selectedSaleCategoryAd;
} else {
AddItemDetailsFragment.isUpdate = false;
} }
} }

@ -26,11 +26,13 @@ class ItemReviewFragment extends StatefulWidget {
class _ItemReviewFragmentState extends State<ItemReviewFragment> { class _ItemReviewFragmentState extends State<ItemReviewFragment> {
ItemReviewModel? itemReviewModel; ItemReviewModel? itemReviewModel;
late bool isUpdate;
@override @override
void initState() { void initState() {
itemReviewModel = AddItemDetailsFragment.itemReviewModel; itemReviewModel = AddItemDetailsFragment.itemReviewModel;
itemReviewModel!.selectedSaleCategory = SelectCategoryFragment.selectedSaleCategory; itemReviewModel!.selectedSaleCategory = SelectCategoryFragment.selectedSaleCategory;
isUpdate = AddItemDetailsFragment.isUpdate;
super.initState(); super.initState();
} }

@ -76,9 +76,7 @@ class _MyRequestsState extends State<MyRequests> {
}), }),
), ),
12.height, 12.height,
Expanded( getCCPTransactionsList.isNotEmpty ? Expanded(
// todo list don't have data, need to confirm later , because have issues, need fixes
child: ListView.separated( child: ListView.separated(
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
@ -141,7 +139,7 @@ class _MyRequestsState extends State<MyRequests> {
}, },
separatorBuilder: (BuildContext context, int index) => 12.height, separatorBuilder: (BuildContext context, int index) => 12.height,
itemCount: getCCPTransactionsList.length), itemCount: getCCPTransactionsList.length),
), ) : Container(),
], ],
).expanded, ).expanded,
1.divider, 1.divider,

@ -176,8 +176,8 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
// // launchUrl(Uri.parse(url!)); // // launchUrl(Uri.parse(url!));
// // } // // }
// ), // ),
getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)), // getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)),
16.height, // 16.height,
getOffersList.discount!.toText14(isBold: true, maxlines: 1), getOffersList.discount!.toText14(isBold: true, maxlines: 1),
8.height, 8.height,
Row( Row(

@ -173,7 +173,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
tag: "ItemImage" + getOffersList.rowID!, tag: "ItemImage" + getOffersList.rowID!,
transitionOnUserGestures: true, transitionOnUserGestures: true,
child: AspectRatio( child: AspectRatio(
aspectRatio: 148 / 127, aspectRatio: 118 / 127,
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
child: Image.network( child: Image.network(
@ -192,10 +192,10 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
// // launchUrl(Uri.parse(url!)); // // launchUrl(Uri.parse(url!));
// // } // // }
// ), // ),
getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)), // getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)),
// 8.height, // 8.height,
getOffersList.discount!.toText14(isBold: true, maxlines: 1), getOffersList.discount!.toText14(isBold: true, maxlines: 1),
10.height, 20.height,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [checkDate(getOffersList.endDate!), SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)], children: [checkDate(getOffersList.endDate!), SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)],
@ -211,7 +211,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
if (enteredKeyword.isEmpty) { if (enteredKeyword.isEmpty) {
results = getOffersList; results = getOffersList;
} else { } else {
if(AppState().isArabic(context)) { if (AppState().isArabic(context)) {
results = getOffersList.where((offer) => offer.titleAR!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList(); results = getOffersList.where((offer) => offer.titleAR!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList();
} else { } else {
results = getOffersList.where((offer) => offer.title!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList(); results = getOffersList.where((offer) => offer.title!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList();

@ -102,21 +102,39 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
ItemDetailView(LocaleKeys.requestNumber.tr(), moItemHistoryList[index].rEQUESTNUMBER ?? ""), ItemDetailGrid(
ItemDetailView(LocaleKeys.uom.tr(), moItemHistoryList[index].uNITOFMEASURE ?? ""), ItemDetailViewCol(LocaleKeys.requestNumber.tr(), moItemHistoryList[index].rEQUESTNUMBER ?? ""),
ItemDetailView(LocaleKeys.quantity.tr(), moItemHistoryList[index].qUANTITY?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.uom.tr(), moItemHistoryList[index].uNITOFMEASURE ?? ""),
ItemDetailView(LocaleKeys.dateRequired.tr(), moItemHistoryList[index].dATEREQUIRED ?? ""), ),
ItemDetailView(LocaleKeys.lineStatus.tr(), moItemHistoryList[index].lINESTATUSDIS ?? ""), ItemDetailGrid(
ItemDetailView(LocaleKeys.statusDate.tr(), moItemHistoryList[index].sTATUSDATE ?? ""), ItemDetailViewCol(LocaleKeys.quantity.tr(), moItemHistoryList[index].qUANTITY?.toString() ?? ""),
ItemDetailView(LocaleKeys.transactionType.tr(), moItemHistoryList[index].tRANSACTIONTYPENAME ?? ""), ItemDetailViewCol(LocaleKeys.dateRequired.tr(), moItemHistoryList[index].dATEREQUIRED ?? ""),
ItemDetailView(LocaleKeys.organization.tr(), moItemHistoryList[index].oRGANIZATIONNAME ?? ""), ),
ItemDetailView(LocaleKeys.operatingCode.tr(), moItemHistoryList[index].oRGANIZATIONCODE ?? ""), ItemDetailGrid(
ItemDetailView(LocaleKeys.operatingUnit.tr(), moItemHistoryList[index].oPERATINGUNITNAME ?? ""), ItemDetailViewCol(LocaleKeys.lineStatus.tr(), moItemHistoryList[index].lINESTATUSDIS ?? ""),
ItemDetailView(LocaleKeys.fromSubInventory.tr(), moItemHistoryList[index].fROMSUBINVENTORYCODE ?? ""), ItemDetailViewCol(LocaleKeys.statusDate.tr(), moItemHistoryList[index].sTATUSDATE ?? ""),
ItemDetailView(LocaleKeys.fromLocator.tr(), moItemHistoryList[index].fROMLOCATOR ?? ""), ),
ItemDetailView(LocaleKeys.toSubInventory.tr(), moItemHistoryList[index].tOSUBINVENTORYCODE ?? ""), ItemDetailGrid(
ItemDetailView(LocaleKeys.toLocator.tr(), moItemHistoryList[index].tOLOCATOR ?? ""), ItemDetailViewCol(LocaleKeys.transactionType.tr(), moItemHistoryList[index].tRANSACTIONTYPENAME ?? ""),
ItemDetailView(LocaleKeys.shipToLocation.tr(), moItemHistoryList[index].sHIPTOLOCATION ?? ""), ItemDetailViewCol(LocaleKeys.organization.tr(), moItemHistoryList[index].oRGANIZATIONNAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.operatingCode.tr(), moItemHistoryList[index].oRGANIZATIONCODE ?? ""),
ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), moItemHistoryList[index].oPERATINGUNITNAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.fromSubInventory.tr(), moItemHistoryList[index].fROMSUBINVENTORYCODE ?? ""),
ItemDetailViewCol(LocaleKeys.fromLocator.tr(), moItemHistoryList[index].fROMLOCATOR ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.toSubInventory.tr(), moItemHistoryList[index].tOSUBINVENTORYCODE ?? ""),
ItemDetailViewCol(LocaleKeys.toLocator.tr(), moItemHistoryList[index].tOLOCATOR ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.shipToLocation.tr(), moItemHistoryList[index].sHIPTOLOCATION ?? ""),
Container(),
isItLast: true,
),
], ],
).objectContainerView(), ).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height, separatorBuilder: (cxt, index) => 12.height,
@ -131,21 +149,39 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
ItemDetailView(LocaleKeys.operatingUnit.tr(), poItemHistoryList[index].oUNAME ?? ""), ItemDetailGrid(
ItemDetailView(LocaleKeys.poNumber.tr(), poItemHistoryList[index].pONUMBER ?? ""), ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), poItemHistoryList[index].oUNAME ?? ""),
ItemDetailView(LocaleKeys.revision.tr(), poItemHistoryList[index].rEVISIONNUM?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.poNumber.tr(), poItemHistoryList[index].pONUMBER ?? ""),
ItemDetailView(LocaleKeys.creationDate.tr(), poItemHistoryList[index].cREATIONDATE ?? ""), ),
ItemDetailView(LocaleKeys.supplier.tr(), poItemHistoryList[index].sUPPLIER ?? ""), ItemDetailGrid(
ItemDetailView(LocaleKeys.buyer.tr(), poItemHistoryList[index].bUYER ?? ""), ItemDetailViewCol(LocaleKeys.revision.tr(), poItemHistoryList[index].rEVISIONNUM?.toString() ?? ""),
ItemDetailView(LocaleKeys.uom.tr(), poItemHistoryList[index].uOM ?? ""), ItemDetailViewCol(LocaleKeys.creationDate.tr(), poItemHistoryList[index].cREATIONDATE ?? ""),
ItemDetailView(LocaleKeys.quantityOrdered.tr(), poItemHistoryList[index].qUANTITYORDERED?.toString() ?? ""), ),
ItemDetailView(LocaleKeys.quantityReceived.tr(), poItemHistoryList[index].qUANTITYRECEIVED?.toString() ?? ""), ItemDetailGrid(
ItemDetailView(LocaleKeys.bonusQuantity.tr(), poItemHistoryList[index].bONUSQUANTITY?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.supplier.tr(), poItemHistoryList[index].sUPPLIER ?? ""),
ItemDetailView(LocaleKeys.purchasePrice.tr(), poItemHistoryList[index].pURCHASEPRICE?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.buyer.tr(), poItemHistoryList[index].bUYER ?? ""),
ItemDetailView(LocaleKeys.discountPer.tr(), poItemHistoryList[index].dISCOUNTPERCENTAGE?.toString() ?? ""), ),
ItemDetailView(LocaleKeys.balanceQuantity.tr(), poItemHistoryList[index].bALANCEQUANTITY?.toString() ?? ""), ItemDetailGrid(
ItemDetailView(LocaleKeys.netPrice.tr(), poItemHistoryList[index].nETPRICE?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.uom.tr(), poItemHistoryList[index].uOM ?? ""),
ItemDetailView(LocaleKeys.closureStatus.tr(), poItemHistoryList[index].cLOSEDCODE ?? ""), ItemDetailViewCol(LocaleKeys.quantityOrdered.tr(), poItemHistoryList[index].qUANTITYORDERED?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quantityReceived.tr(), poItemHistoryList[index].qUANTITYRECEIVED?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.bonusQuantity.tr(), poItemHistoryList[index].bONUSQUANTITY?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.purchasePrice.tr(), poItemHistoryList[index].pURCHASEPRICE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.discountPer.tr(), poItemHistoryList[index].dISCOUNTPERCENTAGE?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.balanceQuantity.tr(), poItemHistoryList[index].bALANCEQUANTITY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.netPrice.tr(), poItemHistoryList[index].nETPRICE?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.closureStatus.tr(), poItemHistoryList[index].cLOSEDCODE ?? ""),
Container(),
isItLast: true,
)
], ],
).objectContainerView(), ).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height, separatorBuilder: (cxt, index) => 12.height,
@ -160,20 +196,35 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
ItemDetailView(LocaleKeys.quotationNumber.tr(), quotationAnalysisList[index].qUOTNUM ?? ""), ItemDetailGrid(
ItemDetailView(LocaleKeys.vendorName.tr(), quotationAnalysisList[index].vENDORNAME ?? ""), ItemDetailViewCol(LocaleKeys.quotationNumber.tr(), quotationAnalysisList[index].qUOTNUM ?? ""),
ItemDetailView(LocaleKeys.itemCode.tr(), quotationAnalysisList[index].iTEMCODE ?? ""), ItemDetailViewCol(LocaleKeys.vendorName.tr(), quotationAnalysisList[index].vENDORNAME ?? ""),
ItemDetailView(LocaleKeys.description.tr(), quotationAnalysisList[index].iTEMDESC ?? ""), ),
ItemDetailView(LocaleKeys.quotationQty.tr(), quotationAnalysisList[index].qUOTQTY?.toString() ?? ""), ItemDetailGrid(
ItemDetailView(LocaleKeys.quotationUOM.tr(), quotationAnalysisList[index].qUOTUOM ?? ""), ItemDetailViewCol(LocaleKeys.itemCode.tr(), quotationAnalysisList[index].iTEMCODE ?? ""),
ItemDetailView(LocaleKeys.quotationNetPrice.tr(), quotationAnalysisList[index].qUOTUNITPRICE?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.description.tr(), quotationAnalysisList[index].iTEMDESC ?? ""),
ItemDetailView(LocaleKeys.quotationLineTotal.tr(), quotationAnalysisList[index].qUOTLINETOTAL?.toString() ?? ""), ),
ItemDetailView(LocaleKeys.quotationBonusQuantity.tr(), quotationAnalysisList[index].qUOTBONUSQTY ?? ""), ItemDetailGrid(
ItemDetailView(LocaleKeys.quotationDeliveryDate.tr(), quotationAnalysisList[index].qUOTDELIVERYDATE ?? ""), ItemDetailViewCol(LocaleKeys.quotationQty.tr(), quotationAnalysisList[index].qUOTQTY?.toString() ?? ""),
ItemDetailView(LocaleKeys.quotationMFGPartNumber.tr(), quotationAnalysisList[index].qUOTMFGPARTNUM ?? ""), ItemDetailViewCol(LocaleKeys.quotationUOM.tr(), quotationAnalysisList[index].qUOTUOM ?? ""),
ItemDetailView(LocaleKeys.rfqNumber.tr(), quotationAnalysisList[index].rFQNUM ?? ""), ),
ItemDetailView(LocaleKeys.rfqQty.tr(), quotationAnalysisList[index].rFQQTY?.toString() ?? ""), ItemDetailGrid(
ItemDetailView(LocaleKeys.rfqUOM.tr(), quotationAnalysisList[index].rFQUOM ?? ""), ItemDetailViewCol(LocaleKeys.quotationNetPrice.tr(), quotationAnalysisList[index].qUOTUNITPRICE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.quotationLineTotal.tr(), quotationAnalysisList[index].qUOTLINETOTAL?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quotationBonusQuantity.tr(), quotationAnalysisList[index].qUOTBONUSQTY ?? ""),
ItemDetailViewCol(LocaleKeys.quotationDeliveryDate.tr(), quotationAnalysisList[index].qUOTDELIVERYDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quotationMFGPartNumber.tr(), quotationAnalysisList[index].qUOTMFGPARTNUM ?? ""),
ItemDetailViewCol(LocaleKeys.rfqNumber.tr(), quotationAnalysisList[index].rFQNUM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.rfqQty.tr(), quotationAnalysisList[index].rFQQTY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.rfqUOM.tr(), quotationAnalysisList[index].rFQUOM ?? ""),
isItLast: true,
)
], ],
).objectContainerView(title: "${quotationAnalysisList[index].iTEMCODE}-${quotationAnalysisList[index].iTEMDESC}"), ).objectContainerView(title: "${quotationAnalysisList[index].iTEMCODE}-${quotationAnalysisList[index].iTEMDESC}"),
separatorBuilder: (cxt, index) => 12.height, separatorBuilder: (cxt, index) => 12.height,

@ -14,6 +14,7 @@ import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/allowed_actions_model.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/allowed_actions_model.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/itg_request_model.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/itg_request_model.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/request_detail_model.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/request_detail_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/work_list/itg_fragments/approval_level_fragment.dart'; import 'package:mohem_flutter_app/ui/work_list/itg_fragments/approval_level_fragment.dart';
import 'package:mohem_flutter_app/ui/work_list/itg_fragments/request_detail_fragment.dart'; import 'package:mohem_flutter_app/ui/work_list/itg_fragments/request_detail_fragment.dart';
import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart'; import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart';
@ -21,6 +22,7 @@ import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/dialogs/itg_comments_dialog.dart'; import 'package:mohem_flutter_app/widgets/dialogs/itg_comments_dialog.dart';
import 'package:provider/provider.dart';
class ItgDetailScreen extends StatefulWidget { class ItgDetailScreen extends StatefulWidget {
ItgDetailScreen({Key? key}) : super(key: key); ItgDetailScreen({Key? key}) : super(key: key);
@ -42,8 +44,11 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
List<AllowedActions> allowedActionList = []; List<AllowedActions> allowedActionList = [];
late DashboardProviderModel providerData;
@override @override
void initState() { void initState() {
providerData = Provider.of<DashboardProviderModel>(context, listen: false);
super.initState(); super.initState();
} }
@ -78,6 +83,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
void getDataFromState() { void getDataFromState() {
if (requestDetails == null) { if (requestDetails == null) {
requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel;
providerData.itgFormsModel!.totalCount = providerData.itgFormsModel!.totalCount! - 1;
getItgData(); getItgData();
} }
} }
@ -274,16 +280,19 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
returnActionImage = "assets/images/request_info.svg"; returnActionImage = "assets/images/request_info.svg";
break; break;
case "ReportGenerated": case "ReportGenerated":
returnActionImage = "assets/images/request_info.svg"; returnActionImage = "assets/images/worklist/report_generated.svg";
break; break;
case "DataCorrected": case "DataCorrected":
returnActionImage = "assets/images/request_info.svg"; returnActionImage = "assets/images/worklist/report_generated.svg";
break; break;
case "Doable": case "Doable":
returnActionImage = "assets/images/request_info.svg"; returnActionImage = "assets/images/worklist/doable.svg";
break; break;
case "NotDoable": case "NotDoable":
returnActionImage = "assets/images/request_info.svg"; returnActionImage = "assets/images/worklist/not_doable.svg";
break;
case "Answer":
returnActionImage = "assets/images/worklist/answer_hr.svg";
break; break;
default: default:
returnActionImage = "assets/images/request_info.svg"; returnActionImage = "assets/images/request_info.svg";
@ -358,12 +367,11 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
case "Answer": case "Answer":
performAction("Answer"); performAction("Answer");
break; break;
case "ReportGenerated":
case "RFC": performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "");
// do something else
break; break;
case "UPDATE_ACTION": case "DataCorrected":
// do something else performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "");
break; break;
} }
setState(() { setState(() {
@ -523,6 +531,29 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
} }
} }
void performDataCorrectionORReportGeneratedAction(String requestType, int taskId, int itemId, String employeeNumber) async {
try {
Utils.showLoading(context);
ITGRequest? itgRequest = await WorkListApiClient().grantITGRequest(requestType, taskId, itemId, employeeNumber, "", "");
Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
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();
}
}
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
void reloadITG() { void reloadITG() {
AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!); AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!);
if (AppState().requestAllList!.isEmpty) { if (AppState().requestAllList!.isEmpty) {

@ -140,7 +140,7 @@ class SelectedItemSheet extends StatelessWidget {
Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async { Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async {
Utils.showLoading(context); Utils.showLoading(context);
try { try {
await WorkListApiClient().submitComment(comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode, approverIndex: actionHistoryList!.sEQUENCE); await WorkListApiClient().submitComment(comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode, approverIndex: actionHistoryList != null ? actionHistoryList!.sEQUENCE : null);
Utils.hideLoading(context); Utils.hideLoading(context);
// Navigator.pop(context); // Navigator.pop(context);
// Navigator.pop(context); // Navigator.pop(context);
@ -212,7 +212,7 @@ class SelectedItemSheet extends StatelessWidget {
: CircularAvatar( : CircularAvatar(
height: 40, height: 40,
width: 40, width: 40,
).toShimmer() )
: (actionHistoryList != null && actionHistoryList!.eMPLOYEEIMAGE != null) : (actionHistoryList != null && actionHistoryList!.eMPLOYEEIMAGE != null)
? CircularAvatar( ? CircularAvatar(
height: 40, height: 40,
@ -223,7 +223,7 @@ class SelectedItemSheet extends StatelessWidget {
: CircularAvatar( : CircularAvatar(
height: 40, height: 40,
width: 40, width: 40,
).toShimmer(), ),
16.width, 16.width,
Expanded( Expanded(
child: (name ?? "").toText12(), child: (name ?? "").toText12(),

@ -226,7 +226,6 @@ class _WorkListScreenState extends State<WorkListScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor),
SizedBox( SizedBox(
height: 40, height: 40,
child: ListView.separated( child: ListView.separated(
@ -347,6 +346,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
return InkWell( return InkWell(
onTap: () async { onTap: () async {
AppState().setItgWorkListIndex = index; AppState().setItgWorkListIndex = index;
AppState().setItgRequestType = requestDetails.requestType;
var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.itgDetail); var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.itgDetail);
if (shouldReloadData != null) { if (shouldReloadData != null) {
if (shouldReloadData.toString() == "delegate_reload") { if (shouldReloadData.toString() == "delegate_reload") {

@ -404,6 +404,15 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
case "UPDATE_ACTION": case "UPDATE_ACTION":
returnActionImage = "assets/images/worklist/update_action.svg"; returnActionImage = "assets/images/worklist/update_action.svg";
break; break;
case "APPROVE_AND_FORWARD":
returnActionImage = "assets/images/worklist/approve_and_forward.svg";
break;
case "FORWARD":
returnActionImage = "assets/images/worklist/forward.svg";
break;
default:
returnActionImage = "assets/images/request_info.svg";
break;
} }
return returnActionImage; return returnActionImage;
@ -467,6 +476,17 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)), isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)),
); );
break; break;
case "CONTINUE_ACTION":
showMyBottomSheet(
context,
callBackFunc: reloadWorkList,
child: UpdateContinueSheet(
workListData: workListData,
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList,
dynamicParams: DynamicListViewParams(workListData!.sUBJECT!, workListData!.fUNCTIONNAME!,
isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)),
);
break;
case "APPROVE_AND_FORWARD": case "APPROVE_AND_FORWARD":
showMyBottomSheet(context, showMyBottomSheet(context,
callBackFunc: reloadWorkList, callBackFunc: reloadWorkList,

@ -27,7 +27,7 @@ class ActionsFragment extends StatelessWidget {
itemCount: actionHistoryList.length, itemCount: actionHistoryList.length,
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return showItem(context, actionHistoryList[index]); return showItem(context, actionHistoryList[index], index);
}, },
separatorBuilder: (BuildContext context, int index) { separatorBuilder: (BuildContext context, int index) {
return 12.height; return 12.height;
@ -36,7 +36,7 @@ class ActionsFragment extends StatelessWidget {
); );
} }
Widget showItem(BuildContext context, GetActionHistoryList actionHistory) { Widget showItem(BuildContext context, GetActionHistoryList actionHistory, int index) {
return Container( return Container(
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -89,7 +89,9 @@ class ActionsFragment extends StatelessWidget {
if (actionHistory.nOTIFICATIONDATE!.isNotEmpty) if (actionHistory.nOTIFICATIONDATE!.isNotEmpty)
DateUtil.formatDateToDate(DateUtil.convertSimpleStringDateToDateddMMyyyy(actionHistory.nOTIFICATIONDATE!), false).toText12(color: MyColors.lightTextColor), DateUtil.formatDateToDate(DateUtil.convertSimpleStringDateToDateddMMyyyy(actionHistory.nOTIFICATIONDATE!), false).toText12(color: MyColors.lightTextColor),
], ],
) ),
10.height,
getActionDuration(index).toText11(maxLine: 1, color: const Color(0xff1FA269))
], ],
), ),
) )
@ -127,8 +129,22 @@ class ActionsFragment extends StatelessWidget {
); );
} }
String getActionDuration(int index) {
if (actionHistoryList[index].aCTIONCODE == "SUBMIT") {
return "";
} else if(actionHistoryList[index].aCTIONCODE == "PENDING") {
DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(actionHistoryList[++index].nOTIFICATIONDATE!);
Duration duration = DateTime.now().difference(dateTimeFrom);
return "Action duration: " + DateUtil.formatDuration(duration);
} else {
DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(actionHistoryList[index].nOTIFICATIONDATE!);
DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(actionHistoryList[++index].nOTIFICATIONDATE!);
Duration duration = dateTimeTo.difference(dateTimeFrom);
return "Action duration: " + DateUtil.formatDuration(duration);
}
}
Color getStatusColor(String code) { Color getStatusColor(String code) {
print("code:$code");
if (code == "SUBMIT") { if (code == "SUBMIT") {
return const Color(0xff2E303A); return const Color(0xff2E303A);
} else if (code == "REJECTED") { } else if (code == "REJECTED") {
@ -139,7 +155,7 @@ class ActionsFragment extends StatelessWidget {
return MyColors.orange; return MyColors.orange;
} else if (code == "APPROVED" || code == "APPROVE" || code == "ANSWER_INFO") { } else if (code == "APPROVED" || code == "APPROVE" || code == "ANSWER_INFO") {
return const Color(0xff1FA269); return const Color(0xff1FA269);
} else if (code == "REQUEST_INFO"|| code == "FORWARD") { } else if (code == "REQUEST_INFO" || code == "FORWARD") {
return const Color(0xff2E303A); return const Color(0xff2E303A);
} else if (code != "SUBMIT" && code != "REJECT" && code != "PENDING") { } else if (code != "SUBMIT" && code != "REJECT" && code != "PENDING") {
return MyColors.orange; return MyColors.orange;

@ -7,7 +7,7 @@ import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
AppBar AppBarWidget(BuildContext context, AppBar AppBarWidget(BuildContext context,
{required String title, bool showHomeButton = true, bool showNotificationButton = false, bool showMemberButton = false, String? image, bool, List<Widget>? actions}) { {required String title, bool showHomeButton = true, bool showNotificationButton = false, bool showMemberButton = false, String? image, List<Widget>? actions}) {
return AppBar( return AppBar(
leadingWidth: 0, leadingWidth: 0,
// leading: GestureDetector( // leading: GestureDetector(
@ -59,8 +59,6 @@ AppBar AppBarWidget(BuildContext context,
}, },
icon: const Icon(Icons.people, color: MyColors.textMixColor), icon: const Icon(Icons.people, color: MyColors.textMixColor),
), ),
...actions??[] ...actions??[]
], ],
); );

@ -134,6 +134,7 @@ flutter:
- assets/audio/ - assets/audio/
- assets/images/ - assets/images/
- assets/images/worklist/ - assets/images/worklist/
- assets/images/services_icons/
- assets/images/login/ - assets/images/login/
- assets/icons/chat/ - assets/icons/chat/
- assets/images/logos/ - assets/images/logos/

Loading…
Cancel
Save