|
|
|
|
@ -4,7 +4,6 @@ import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/api/my_requests_api_client.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/string_extensions.dart';
|
|
|
|
|
@ -27,7 +26,7 @@ class _NewRequestState extends State<NewRequest> {
|
|
|
|
|
List<GetConcurrentProgramsModel> getConcurrentProgramsList = [];
|
|
|
|
|
GetConcurrentProgramsModel? selectedConcurrentProgramList;
|
|
|
|
|
|
|
|
|
|
List<GetEITDFFStructureList> getCCPDFFStructureModelList = [];
|
|
|
|
|
List<GetEITDFFStructureList>? getCCPDFFStructureModelList;
|
|
|
|
|
|
|
|
|
|
DateTime selectedDate = DateTime.now();
|
|
|
|
|
|
|
|
|
|
@ -45,17 +44,16 @@ class _NewRequestState extends State<NewRequest> {
|
|
|
|
|
context,
|
|
|
|
|
title: "Concurrent Reports",
|
|
|
|
|
),
|
|
|
|
|
body: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
body: 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(
|
|
|
|
|
ListView(
|
|
|
|
|
padding: const EdgeInsets.all(21),
|
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
|
children: [
|
|
|
|
|
PopupMenuButton(
|
|
|
|
|
child: DynamicTextFieldWidget(
|
|
|
|
|
"Template Name",
|
|
|
|
|
selectedConcurrentProgramList?.uSERCONCURRENTPROGRAMNAME ?? "",
|
|
|
|
|
LocaleKeys.templateName.tr(),
|
|
|
|
|
selectedConcurrentProgramList?.uSERCONCURRENTPROGRAMNAME ?? LocaleKeys.selectTemplate.tr(),
|
|
|
|
|
isEnable: false,
|
|
|
|
|
isPopup: true,
|
|
|
|
|
isInputTypeNum: true,
|
|
|
|
|
@ -69,32 +67,28 @@ class _NewRequestState extends State<NewRequest> {
|
|
|
|
|
getCCPDFFStructure(selectedConcurrentProgramList?.cONCURRENTPROGRAMNAME);
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
(getCCPDFFStructureModelList.isEmpty
|
|
|
|
|
getCCPDFFStructureModelList == null
|
|
|
|
|
? const SizedBox()
|
|
|
|
|
: (getCCPDFFStructureModelList!.isEmpty
|
|
|
|
|
? LocaleKeys.noDataAvailable.tr().toText16().center
|
|
|
|
|
: ListView.separated(
|
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
|
padding: const EdgeInsets.all(21),
|
|
|
|
|
itemBuilder: (cxt, int parentIndex) => parseDynamicFormatType(getCCPDFFStructureModelList[parentIndex], parentIndex),
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
padding: const EdgeInsets.all(0),
|
|
|
|
|
itemBuilder: (cxt, int parentIndex) => parseDynamicFormatType(getCCPDFFStructureModelList![parentIndex], parentIndex),
|
|
|
|
|
separatorBuilder: (cxt, index) => 0.height,
|
|
|
|
|
itemCount: getCCPDFFStructureModelList.length))
|
|
|
|
|
.expanded,
|
|
|
|
|
Container(
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3),
|
|
|
|
|
itemCount: getCCPDFFStructureModelList!.length,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
child: DefaultButton(LocaleKeys.submit.tr(), () async {
|
|
|
|
|
).expanded,
|
|
|
|
|
1.divider,
|
|
|
|
|
DefaultButton(LocaleKeys.submit.tr(), () {
|
|
|
|
|
// todo need to add submit method
|
|
|
|
|
// openNewRequest();
|
|
|
|
|
})
|
|
|
|
|
.insideContainer,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// bottomSheet:
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -132,9 +126,7 @@ class _NewRequestState extends State<NewRequest> {
|
|
|
|
|
isReadOnly: model.rEADONLY == "Y",
|
|
|
|
|
onChange: (text) {
|
|
|
|
|
model.fieldAnswer = text;
|
|
|
|
|
if (model.eSERVICESDV == null) {
|
|
|
|
|
model.eSERVICESDV = ESERVICESDV();
|
|
|
|
|
}
|
|
|
|
|
model.eSERVICESDV ??= ESERVICESDV();
|
|
|
|
|
model.eSERVICESDV!.pIDCOLUMNNAME = text;
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(bottom: 12);
|
|
|
|
|
@ -146,9 +138,7 @@ class _NewRequestState extends State<NewRequest> {
|
|
|
|
|
isInputTypeNum: true,
|
|
|
|
|
onChange: (text) {
|
|
|
|
|
model.fieldAnswer = text;
|
|
|
|
|
if (model.eSERVICESDV == null) {
|
|
|
|
|
model.eSERVICESDV = ESERVICESDV();
|
|
|
|
|
}
|
|
|
|
|
model.eSERVICESDV ??= ESERVICESDV();
|
|
|
|
|
model.eSERVICESDV!.pIDCOLUMNNAME = text;
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(bottom: 12);
|
|
|
|
|
@ -164,7 +154,7 @@ class _NewRequestState extends State<NewRequest> {
|
|
|
|
|
}
|
|
|
|
|
return DynamicTextFieldWidget(
|
|
|
|
|
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
|
|
|
|
displayText,
|
|
|
|
|
displayText.isEmpty ? LocaleKeys.pleaseSelectDate.tr() : displayText,
|
|
|
|
|
suffixIconData: Icons.calendar_today,
|
|
|
|
|
isEnable: false,
|
|
|
|
|
onTap: () async {
|
|
|
|
|
@ -331,7 +321,7 @@ class _NewRequestState extends State<NewRequest> {
|
|
|
|
|
}
|
|
|
|
|
return DynamicTextFieldWidget(
|
|
|
|
|
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
|
|
|
|
displayText,
|
|
|
|
|
displayText.isEmpty ? LocaleKeys.pleaseSelectDate.tr() : displayText,
|
|
|
|
|
suffixIconData: Icons.calendar_today,
|
|
|
|
|
isEnable: false,
|
|
|
|
|
onTap: () async {
|
|
|
|
|
|