Merge branch 'moe-sikander' into 'master'

Moe sikander

See merge request Cloud_Solution/mohemm-flutter-moe!7
merge-requests/8/merge
Sikander Saleem 3 years ago
commit 2f914aa36a

@ -25,6 +25,7 @@
"checkIn": "تحقق في", "checkIn": "تحقق في",
"workList": "قائمة العمل", "workList": "قائمة العمل",
"leaveBalance": "رصيد الاجازات", "leaveBalance": "رصيد الاجازات",
"businessTripBalance": "رصيد رحلة العمل",
"missingSwipes": "تسجيل بصمة حضور", "missingSwipes": "تسجيل بصمة حضور",
"ticketBalance": "رصيد التذكرة", "ticketBalance": "رصيد التذكرة",
"other": "آخر", "other": "آخر",

@ -25,6 +25,7 @@
"checkIn": "Check In", "checkIn": "Check In",
"workList": "Work List", "workList": "Work List",
"leaveBalance": "Leave Balance", "leaveBalance": "Leave Balance",
"businessTripBalance": "Business Trip Balance",
"missingSwipes": "Missing Swipes", "missingSwipes": "Missing Swipes",
"ticketBalance": "Ticket Balance", "ticketBalance": "Ticket Balance",
"other": "Other", "other": "Other",

@ -16,9 +16,9 @@ class MyRequestsApiClient {
factory MyRequestsApiClient() => _instance; factory MyRequestsApiClient() => _instance;
Future<List<GetConcurrentProgramsModel>> getConcurrentPrograms() async { Future<List<GetConcurrentProgramsModel>> getConcurrentPrograms(int id) async {
String url = "${ApiConsts.erpRest}GET_CONCURRENT_PROGRAMS"; String url = "${ApiConsts.erpRest}GET_CONCURRENT_PROGRAMS";
Map<String, dynamic> postParams = {"P_REQUEST_GROUP_ID": 3290}; Map<String, dynamic> postParams = {"P_REQUEST_GROUP_ID": id};
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {

@ -41,6 +41,7 @@ class CodegenLoader extends AssetLoader{
"checkIn": "تحقق في", "checkIn": "تحقق في",
"workList": "قائمة العمل", "workList": "قائمة العمل",
"leaveBalance": "رصيد الاجازات", "leaveBalance": "رصيد الاجازات",
"businessTripBalance": "رصيد رحلة العمل",
"missingSwipes": "تسجيل بصمة حضور", "missingSwipes": "تسجيل بصمة حضور",
"ticketBalance": "رصيد التذكرة", "ticketBalance": "رصيد التذكرة",
"other": "آخر", "other": "آخر",
@ -569,6 +570,7 @@ static const Map<String,dynamic> en_US = {
"checkIn": "Check In", "checkIn": "Check In",
"workList": "Work List", "workList": "Work List",
"leaveBalance": "Leave Balance", "leaveBalance": "Leave Balance",
"businessTripBalance": "Business Trip Balance",
"missingSwipes": "Missing Swipes", "missingSwipes": "Missing Swipes",
"ticketBalance": "Ticket Balance", "ticketBalance": "Ticket Balance",
"other": "Other", "other": "Other",

@ -27,6 +27,7 @@ abstract class LocaleKeys {
static const checkIn = 'checkIn'; static const checkIn = 'checkIn';
static const workList = 'workList'; static const workList = 'workList';
static const leaveBalance = 'leaveBalance'; static const leaveBalance = 'leaveBalance';
static const businessTripBalance = 'businessTripBalance';
static const missingSwipes = 'missingSwipes'; static const missingSwipes = 'missingSwipes';
static const ticketBalance = 'ticketBalance'; static const ticketBalance = 'ticketBalance';
static const services = 'services'; static const services = 'services';

@ -2,6 +2,8 @@ class DrawerMenuItem {
String icon; String icon;
String title; String title;
String routeName; String routeName;
int? requestGroupId;
String? requestGroupName;
DrawerMenuItem(this.icon, this.title, this.routeName); DrawerMenuItem(this.icon, this.title, this.routeName, {this.requestGroupId, this.requestGroupName});
} }

@ -41,12 +41,21 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
bool isMissingSwipeLoading = true; bool isMissingSwipeLoading = true;
int missingSwipeCounter = 0; int missingSwipeCounter = 0;
bool isMyRequestLoading = true;
ListMenu? myRequest;
//Leave and Ticket Balance //Leave and Ticket Balance
bool isLeaveTicketBalanceLoading = true; bool isLeaveTicketBalanceLoading = true;
List<GetAccrualBalancesList>? accrualList; List<GetAccrualBalancesList>? accrualList;
GetAccrualBalancesList? leaveBalanceAccrual; GetAccrualBalancesList? leaveBalanceAccrual;
double get leaveBalance => leaveBalanceAccrual?.accrualNetEntitlement ?? 0; double get leaveBalance => leaveBalanceAccrual?.accrualNetEntitlement ?? 0;
GetAccrualBalancesList? businessTripAccrual;
double get businessTrip => businessTripAccrual?.accrualNetEntitlement ?? 0;
double ticketBalance = 0; double ticketBalance = 0;
//Menu Entries //Menu Entries
@ -87,12 +96,18 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
isWorkListLoading = true; isWorkListLoading = true;
workListCounter = 0; workListCounter = 0;
isMyRequestLoading = true;
myRequest = null;
isMissingSwipeLoading = true; isMissingSwipeLoading = true;
missingSwipeCounter = 0; missingSwipeCounter = 0;
isWorkListLoading = true;
isLeaveTicketBalanceLoading = true; isLeaveTicketBalanceLoading = true;
accrualList = null; accrualList = null;
leaveBalanceAccrual = null; leaveBalanceAccrual = null;
businessTripAccrual = null;
ticketBalance = 0; ticketBalance = 0;
isServicesMenusLoading = true; isServicesMenusLoading = true;
@ -193,7 +208,8 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
try { try {
accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy", "en_US").format(date)); accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy", "en_US").format(date));
isLeaveTicketBalanceLoading = false; isLeaveTicketBalanceLoading = false;
leaveBalanceAccrual = accrualList![0]; leaveBalanceAccrual = accrualList!.singleWhere((element) => element.accuralPlanName == 'Annual Vacation Accrual' || element.accuralPlanName == "خطة استحقاق الاجازة الاعتيادية", orElse: null);
businessTripAccrual = accrualList!.singleWhere((element) => element.accuralPlanName == 'Business Trip Accrual' || element.accuralPlanName == "خطة استحقاق الإنتدابات", orElse: null);
ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + (accrualList![2].accrualNetEntitlement ?? 0.0) + (accrualList![3].accrualNetEntitlement ?? 0.0); ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + (accrualList![2].accrualNetEntitlement ?? 0.0) + (accrualList![3].accrualNetEntitlement ?? 0.0);
notifyListeners(); notifyListeners();
} catch (ex) { } catch (ex) {
@ -211,17 +227,19 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void fetchListMenu() async { void fetchListMenu() async {
try { try {
List<ListMenu> menuList = await DashboardApiClient().getListMenu(); List<ListMenu> menuList = await DashboardApiClient().getListMenu();
List findMyRequest = menuList.where((element) => element.menuType == "E").toList(); for (var menu in menuList) {
if (findMyRequest.isNotEmpty) { if (menu.menuType == "E") {
drawerMenuItemList.add(DrawerMenuItem("assets/images/drawer/my_requests.svg", LocaleKeys.myRequest.tr(), AppRoutes.myRequests)); myRequest = menu;
} } else if (menu.menuType == "M") {
List findMyTeam = menuList.where((element) => element.menuType == "M").toList(); AppState().setempStatusIsManager = true;
if (findMyTeam.isNotEmpty) { drawerMenuItemList.add(DrawerMenuItem("assets/images/drawer/my_team.svg", LocaleKeys.myTeamMembers.tr(), AppRoutes.myTeam));
AppState().setempStatusIsManager = true; }
drawerMenuItemList.add(DrawerMenuItem("assets/images/drawer/my_team.svg", LocaleKeys.myTeamMembers.tr(), AppRoutes.myTeam));
} }
isMyRequestLoading = false;
notifyListeners();
} catch (ex) { } catch (ex) {
logger.wtf(ex); logger.wtf(ex);
notifyListeners();
Utils.handleException(ex, null, null); Utils.handleException(ex, null, null);
} }
} }
@ -250,7 +268,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
} }
} }
void getCategoryOffersListAPI(BuildContext context) async { void getCategoryOffersListAPI(BuildContext context) async {
try { try {
// Utils.showLoading(context); // Utils.showLoading(context);
getOffersList = await OffersAndDiscountsApiClient().getOffersList(0, 10); getOffersList = await OffersAndDiscountsApiClient().getOffersList(0, 10);

@ -81,7 +81,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
void checkSession() async { void checkSession() async {
try { try {
await DashboardApiClient().getOpenMissingSwipes(); await DashboardApiClient().getOpenNotifications();
} catch (ex) { } catch (ex) {
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
} }

@ -20,7 +20,7 @@ class MenusWidget extends StatelessWidget {
return Consumer<DashboardProviderModel>( return Consumer<DashboardProviderModel>(
builder: (cxt, data, child) { builder: (cxt, data, child) {
return GridView( return GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 2 / 2, crossAxisSpacing: 9, mainAxisSpacing: 9), gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 1.75, crossAxisSpacing: 9, mainAxisSpacing: 9),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
shrinkWrap: true, shrinkWrap: true,
primary: false, primary: false,
@ -53,25 +53,52 @@ class MenusWidget extends StatelessWidget {
).onPress(() { ).onPress(() {
Navigator.pushNamed(context, AppRoutes.workList); Navigator.pushNamed(context, AppRoutes.workList);
}), }),
if(env.dashboard.missingSwipe) if (env.dashboard.missingSwipe)
data.isMissingSwipeLoading data.isMissingSwipeLoading
? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context);
})
: Container(
decoration: BoxDecoration(
color: Color(namesColor[1]),
borderRadius: BorderRadius.circular(10),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.missingSwipes.tr().toText12(color: Colors.white),
Row(
children: [
Expanded(
child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
],
)
],
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));
}),
data.isLeaveTicketBalanceLoading
? MenuShimmer().onPress(() { ? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context); data.fetchWorkListCounter(context);
}) })
: Container( : Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(namesColor[1]), color: Color(namesColor[2]),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.missingSwipes.tr().toText12(color: Colors.white), LocaleKeys.leaveBalance.tr().toText12(color: Colors.white),
Row( Row(
children: [ children: [
Expanded( Expanded(
child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.leaveBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
), ),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
], ],
@ -79,7 +106,7 @@ class MenusWidget extends StatelessWidget {
], ],
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6), ).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress(() { ).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS")); Navigator.pushNamed(context, AppRoutes.leaveBalance);
}), }),
data.isLeaveTicketBalanceLoading data.isLeaveTicketBalanceLoading
? MenuShimmer().onPress(() { ? MenuShimmer().onPress(() {
@ -94,11 +121,11 @@ class MenusWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.leaveBalance.tr().toText12(color: Colors.white), LocaleKeys.businessTripBalance.tr().toText12(color: Colors.white),
Row( Row(
children: [ children: [
Expanded( Expanded(
child: data.leaveBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.businessTrip.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
), ),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
], ],
@ -108,10 +135,39 @@ class MenusWidget extends StatelessWidget {
).onPress(() { ).onPress(() {
Navigator.pushNamed(context, AppRoutes.leaveBalance); Navigator.pushNamed(context, AppRoutes.leaveBalance);
}), }),
if(env.dashboard.ticketBalance) if (env.dashboard.ticketBalance)
data.isLeaveTicketBalanceLoading data.isLeaveTicketBalanceLoading
? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context);
})
: Container(
decoration: BoxDecoration(
color: Color(namesColor[3]),
borderRadius: BorderRadius.circular(10),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.ticketBalance.tr().toText12(color: Colors.white),
Row(
children: [
Expanded(
child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
],
)
],
).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"));
},
),
data.isMyRequestLoading
? MenuShimmer().onPress(() { ? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context); data.fetchListMenu();
}) })
: Container( : Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -122,12 +178,13 @@ class MenusWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.ticketBalance.tr().toText12(color: Colors.white), LocaleKeys.myRequest.tr().toText12(color: Colors.white),
Row( Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Expanded( // Expanded(
child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1), // child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
), // ),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
], ],
) )
@ -135,7 +192,7 @@ class MenusWidget extends StatelessWidget {
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6), ).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress( ).onPress(
() { () {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.ticketBalance.tr(), "HMG_TKT_NEW_EIT_SS")); Navigator.pushNamed(context, AppRoutes.myRequests,arguments: data.myRequest!.requestGroupId);
}, },
) )
], ],

@ -33,21 +33,26 @@ class _MyRequestsState extends State<MyRequests> {
List<GetCCPTransactionsModel> getCCPTransactionsList = []; List<GetCCPTransactionsModel> getCCPTransactionsList = [];
int? groupId;
bool isNewRequest = false; bool isNewRequest = false;
@override @override
void initState() { void initState() {
getConcurrentPrograms();
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (groupId == null) {
groupId = ModalRoute.of(context)!.settings.arguments as int;
getConcurrentPrograms();
}
return Scaffold( return Scaffold(
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBar: AppBarWidget( appBar: AppBarWidget(
context, context,
title: LocaleKeys.concurrentReports, title: LocaleKeys.concurrentReports.tr(),
), ),
body: Column( body: Column(
children: [ children: [
@ -76,70 +81,72 @@ class _MyRequestsState extends State<MyRequests> {
}), }),
), ),
12.height, 12.height,
getCCPTransactionsList.isNotEmpty ? Expanded( getCCPTransactionsList.isNotEmpty
child: ListView.separated( ? Expanded(
physics: const BouncingScrollPhysics(), child: ListView.separated(
shrinkWrap: true, physics: const BouncingScrollPhysics(),
itemBuilder: (BuildContext context, int index) { shrinkWrap: true,
return Container( itemBuilder: (BuildContext context, int index) {
width: double.infinity, return Container(
padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 12), width: double.infinity,
margin: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 0), padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 12),
decoration: BoxDecoration( margin: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 0),
color: Colors.white, decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), color: Colors.white,
boxShadow: [ borderRadius: BorderRadius.circular(10),
BoxShadow( boxShadow: [
color: const Color(0xff000000).withOpacity(.05), BoxShadow(
blurRadius: 26, color: const Color(0xff000000).withOpacity(.05),
offset: const Offset(0, -3), blurRadius: 26,
), offset: const Offset(0, -3),
], ),
), ],
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Row( children: [
crossAxisAlignment: CrossAxisAlignment.start, Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start,
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
("Request ID: " + getCCPTransactionsList[index].rEQUESTID.toString()).toText12(color: MyColors.grey57Color), children: [
DateUtil.formatDateToDate(DateUtil.convertStringToDate(getCCPTransactionsList[index].rEQUESTDATE!), false).toText12(color: MyColors.grey70Color), ("Request ID: " + getCCPTransactionsList[index].rEQUESTID.toString()).toText12(color: MyColors.grey57Color),
], DateUtil.formatDateToDate(DateUtil.convertStringToDate(getCCPTransactionsList[index].rEQUESTDATE!), false).toText12(color: MyColors.grey70Color),
), ],
Container( ),
padding: const EdgeInsets.only(top: 10.0), Container(
child: ("Phase: " + getCCPTransactionsList[index].cCPPHASE!).toText12(color: MyColors.grey57Color, isBold: true), padding: const EdgeInsets.only(top: 10.0),
), child: ("Phase: " + getCCPTransactionsList[index].cCPPHASE!).toText12(color: MyColors.grey57Color, isBold: true),
Container( ),
padding: const EdgeInsets.only(top: 10.0), Container(
child: "Program Name: ".toText12(color: MyColors.grey57Color, isBold: true), padding: const EdgeInsets.only(top: 10.0),
), child: "Program Name: ".toText12(color: MyColors.grey57Color, isBold: true),
getCCPTransactionsList[index].cONCURRENTPROGRAMNAME!.toText12(color: MyColors.gradiantEndColor), ),
Container( getCCPTransactionsList[index].cONCURRENTPROGRAMNAME!.toText12(color: MyColors.gradiantEndColor),
padding: const EdgeInsets.only(top: 10.0), Container(
child: InkWell( padding: const EdgeInsets.only(top: 10.0),
onTap: () { child: InkWell(
getCCPOutput(getCCPTransactionsList[index].rEQUESTID.toString()); onTap: () {
}, getCCPOutput(getCCPTransactionsList[index].rEQUESTID.toString());
child: Row( },
children: [ child: Row(
"Output: ".toText12(color: MyColors.grey57Color), children: [
8.width, "Output: ".toText12(color: MyColors.grey57Color),
"Open PDF".toText12(color: MyColors.grey57Color), 8.width,
6.width, "Open PDF".toText12(color: MyColors.grey57Color),
const Icon(Icons.launch, size: 16.0), 6.width,
], const Icon(Icons.launch, size: 16.0),
), ],
),
),
),
],
), ),
), );
], },
), separatorBuilder: (BuildContext context, int index) => 12.height,
); itemCount: getCCPTransactionsList.length),
}, )
separatorBuilder: (BuildContext context, int index) => 12.height, : Container(),
itemCount: getCCPTransactionsList.length),
) : Container(),
], ],
).expanded, ).expanded,
1.divider, 1.divider,
@ -160,7 +167,7 @@ class _MyRequestsState extends State<MyRequests> {
void getConcurrentPrograms() async { void getConcurrentPrograms() async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
getConcurrentProgramsList = await MyRequestsApiClient().getConcurrentPrograms(); getConcurrentProgramsList = await MyRequestsApiClient().getConcurrentPrograms(groupId!);
Utils.hideLoading(context); Utils.hideLoading(context);
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {

@ -34,20 +34,25 @@ class _NewRequestState extends State<NewRequest> {
List<GetEITDFFStructureList>? getCCPDFFStructureModelList; List<GetEITDFFStructureList>? getCCPDFFStructureModelList;
DateTime selectedDate = DateTime.now(); DateTime selectedDate = DateTime.now();
int? groupId;
@override @override
void initState() { void initState() {
getConcurrentPrograms();
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (groupId == null) {
groupId = ModalRoute.of(context)!.settings.arguments as int;
getConcurrentPrograms();
}
return Scaffold( return Scaffold(
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBar: AppBarWidget( appBar: AppBarWidget(
context, context,
title: LocaleKeys.concurrentReports, title: LocaleKeys.concurrentReports.tr(),
), ),
body: Column( body: Column(
children: [ children: [
@ -135,7 +140,7 @@ class _NewRequestState extends State<NewRequest> {
void getConcurrentPrograms() async { void getConcurrentPrograms() async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
getConcurrentProgramsList = await MyRequestsApiClient().getConcurrentPrograms(); getConcurrentProgramsList = await MyRequestsApiClient().getConcurrentPrograms(groupId!);
Utils.hideLoading(context); Utils.hideLoading(context);
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {
@ -215,13 +220,15 @@ class _NewRequestState extends State<NewRequest> {
pIDCOLUMNNAME: DateFormat('yyyy/MM/dd HH:MM:SS', "en_US").format(date1), pIDCOLUMNNAME: DateFormat('yyyy/MM/dd HH:MM:SS', "en_US").format(date1),
pRETURNMSG: "null", pRETURNMSG: "null",
pRETURNSTATUS: getCCPDFFStructureModelList![index].dEFAULTVALUE, pRETURNSTATUS: getCCPDFFStructureModelList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy/MM/dd HH:MM:SS', "en_US").format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); pVALUECOLUMNNAME:
getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy/MM/dd HH:MM:SS', "en_US").format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
} else { } else {
eservicesdv = ESERVICESDV( eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd', "en_US").format(date1), pIDCOLUMNNAME: DateFormat('yyyy-MM-dd', "en_US").format(date1),
pRETURNMSG: "null", pRETURNMSG: "null",
pRETURNSTATUS: getCCPDFFStructureModelList![index].dEFAULTVALUE, pRETURNSTATUS: getCCPDFFStructureModelList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss', "en_US").format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); pVALUECOLUMNNAME:
getCCPDFFStructureModelList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss', "en_US").format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
} }
getCCPDFFStructureModelList![index].eSERVICESDV = eservicesdv; getCCPDFFStructureModelList![index].eSERVICESDV = eservicesdv;
setState(() {}); setState(() {});

Loading…
Cancel
Save