|
|
|
|
@ -13,7 +13,6 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/my_requests/get_ccp_output_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/my_requests/get_ccp_transactions_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/my_requests/get_concurrent_programs_model.dart';
|
|
|
|
|
@ -45,127 +44,128 @@ class _MyRequestsState extends State<MyRequests> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
appBar: AppBarWidget(
|
|
|
|
|
context,
|
|
|
|
|
title: "Concurrent Reports",
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
appBar: AppBarWidget(
|
|
|
|
|
context,
|
|
|
|
|
title: "Concurrent Reports",
|
|
|
|
|
),
|
|
|
|
|
body: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: const Color(0xff000000).withOpacity(.05),
|
|
|
|
|
blurRadius: 26,
|
|
|
|
|
offset: const Offset(0, -3),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
body: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: const Color(0xff000000).withOpacity(.05),
|
|
|
|
|
blurRadius: 26,
|
|
|
|
|
offset: const Offset(0, -3),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
12.height,
|
|
|
|
|
Container(
|
|
|
|
|
padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 0),
|
|
|
|
|
margin: const EdgeInsets.only(left: 12, right: 12, top: 0, bottom: 0),
|
|
|
|
|
child: PopupMenuButton(
|
|
|
|
|
child: DynamicTextFieldWidget(
|
|
|
|
|
"Template Name",
|
|
|
|
|
selectedConcurrentProgramList?.uSERCONCURRENTPROGRAMNAME ?? "",
|
|
|
|
|
isEnable: false,
|
|
|
|
|
isPopup: true,
|
|
|
|
|
isInputTypeNum: true,
|
|
|
|
|
isReadOnly: false,
|
|
|
|
|
).paddingOnly(bottom: 12),
|
|
|
|
|
itemBuilder: (_) => <PopupMenuItem<int>>[
|
|
|
|
|
for (int i = 0; i < getConcurrentProgramsList!.length; i++) PopupMenuItem<int>(child: Text(getConcurrentProgramsList![i].uSERCONCURRENTPROGRAMNAME!), value: i),
|
|
|
|
|
],
|
|
|
|
|
onSelected: (int popupIndex) {
|
|
|
|
|
selectedConcurrentProgramList = getConcurrentProgramsList![popupIndex];
|
|
|
|
|
getCCPTransactions(selectedConcurrentProgramList?.cONCURRENTPROGRAMNAME);
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 12),
|
|
|
|
|
margin: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: const Color(0xff000000).withOpacity(.05),
|
|
|
|
|
blurRadius: 26,
|
|
|
|
|
offset: const Offset(0, -3),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
("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),
|
|
|
|
|
child: ("Phase: " + getCCPTransactionsList[index].cCPPHASE!).toText12(color: MyColors.grey57Color, isBold: true),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
padding: const EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: "Program Name: ".toText12(color: MyColors.grey57Color, isBold: true),
|
|
|
|
|
),
|
|
|
|
|
getCCPTransactionsList[index].cONCURRENTPROGRAMNAME!.toText12(color: MyColors.gradiantEndColor),
|
|
|
|
|
Container(
|
|
|
|
|
padding: const EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
getCCPOutput(getCCPTransactionsList[index].rEQUESTID.toString());
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
"Output: ".toText12(color: MyColors.grey57Color),
|
|
|
|
|
8.width,
|
|
|
|
|
"Open PDF".toText12(color: MyColors.grey57Color),
|
|
|
|
|
6.width,
|
|
|
|
|
const Icon(Icons.launch, size: 16.0),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
12.height,
|
|
|
|
|
Container(
|
|
|
|
|
padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 0),
|
|
|
|
|
margin: const EdgeInsets.only(left: 12, right: 12, top: 0, bottom: 0),
|
|
|
|
|
child: PopupMenuButton(
|
|
|
|
|
child: DynamicTextFieldWidget(
|
|
|
|
|
"Template Name",
|
|
|
|
|
selectedConcurrentProgramList?.uSERCONCURRENTPROGRAMNAME ?? "",
|
|
|
|
|
isEnable: false,
|
|
|
|
|
isPopup: true,
|
|
|
|
|
isInputTypeNum: true,
|
|
|
|
|
isReadOnly: false,
|
|
|
|
|
).paddingOnly(bottom: 12),
|
|
|
|
|
itemBuilder: (_) => <PopupMenuItem<int>>[
|
|
|
|
|
for (int i = 0; i < getConcurrentProgramsList!.length; i++) PopupMenuItem<int>(child: Text(getConcurrentProgramsList![i].uSERCONCURRENTPROGRAMNAME!), value: i),
|
|
|
|
|
],
|
|
|
|
|
onSelected: (int popupIndex) {
|
|
|
|
|
selectedConcurrentProgramList = getConcurrentProgramsList![popupIndex];
|
|
|
|
|
getCCPTransactions(selectedConcurrentProgramList?.cONCURRENTPROGRAMNAME);
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 12),
|
|
|
|
|
margin: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: const Color(0xff000000).withOpacity(.05),
|
|
|
|
|
blurRadius: 26,
|
|
|
|
|
offset: const Offset(0, -3),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
("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),
|
|
|
|
|
child: ("Phase: " + getCCPTransactionsList[index].cCPPHASE!).toText12(color: MyColors.grey57Color, isBold: true),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
padding: const EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: "Program Name: ".toText12(color: MyColors.grey57Color, isBold: true),
|
|
|
|
|
),
|
|
|
|
|
getCCPTransactionsList[index].cONCURRENTPROGRAMNAME!.toText12(color: MyColors.gradiantEndColor),
|
|
|
|
|
Container(
|
|
|
|
|
padding: const EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
getCCPOutput(getCCPTransactionsList[index].rEQUESTID.toString());
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
"Output: ".toText12(color: MyColors.grey57Color),
|
|
|
|
|
8.width,
|
|
|
|
|
"Open PDF".toText12(color: MyColors.grey57Color),
|
|
|
|
|
6.width,
|
|
|
|
|
const Icon(Icons.launch, size: 16.0),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (BuildContext context, int index) => 12.height,
|
|
|
|
|
itemCount: getCCPTransactionsList.length ?? 0)),
|
|
|
|
|
80.height
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (BuildContext context, int index) => 12.height,
|
|
|
|
|
itemCount: getCCPTransactionsList.length ?? 0)),
|
|
|
|
|
80.height,
|
|
|
|
|
Container(
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
child: DefaultButton(LocaleKeys.createRequest.tr(), () async {
|
|
|
|
|
openNewRequest();
|
|
|
|
|
}).insideContainer,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: Container(
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
child: DefaultButton(LocaleKeys.createRequest.tr(), () async {
|
|
|
|
|
openNewRequest();
|
|
|
|
|
}).insideContainer,
|
|
|
|
|
));
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void openNewRequest() async {
|
|
|
|
|
|