|
|
|
|
@ -110,9 +110,9 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
|
|
|
|
|
String dESCFLEXCONTEXTCODE = "";
|
|
|
|
|
String descFlexConTextTitle = "";
|
|
|
|
|
|
|
|
|
|
Future calGetValueSetValues(GetEITDFFStructureList structureList) async {
|
|
|
|
|
Future calGetValueSetValues(GetEITDFFStructureList structureList, {bool showLoading = true}) async {
|
|
|
|
|
try {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
if (showLoading) Utils.showLoading(context);
|
|
|
|
|
for (int i = 0; i < (structureList.cHILDSEGMENTSVSSplited?.length ?? 0); i++) {
|
|
|
|
|
List<Map<String, dynamic>> values = [];
|
|
|
|
|
String segmentId = structureList.cHILDSEGMENTSVSSplited![i];
|
|
|
|
|
@ -140,18 +140,21 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
|
|
|
|
|
// getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? [];
|
|
|
|
|
//getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList();
|
|
|
|
|
}
|
|
|
|
|
await Future.delayed(const Duration(seconds: 1));
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
if (showLoading) {
|
|
|
|
|
await Future.delayed(const Duration(seconds: 1));
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
if (showLoading) Utils.hideLoading(context);
|
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getDefaultValues(GetEITDFFStructureList structureList) async {
|
|
|
|
|
Future getDefaultValues(GetEITDFFStructureList structureList, {bool showLoading = true}) async {
|
|
|
|
|
try {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
if (showLoading) Utils.showLoading(context);
|
|
|
|
|
for (int i = 0; i < (structureList.cHILDSEGMENTSDVSplited?.length ?? 0); i++) {
|
|
|
|
|
String segmentId = structureList.cHILDSEGMENTSDVSplited![i];
|
|
|
|
|
GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId);
|
|
|
|
|
@ -176,8 +179,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
|
|
|
|
|
GetEITDFFStructureList defaultValueCheck = getEitDffStructureList!.where((GetEITDFFStructureList element) => element.sEGMENTNAME == segmentId).toList().first;
|
|
|
|
|
|
|
|
|
|
if (defaultValueCheck.cHILDSEGMENTSDVSplited!.isNotEmpty && defaultValueCheck.rEADONLY == 'Y') {
|
|
|
|
|
getDefaultValues(defaultValueCheck);
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
await getDefaultValues(defaultValueCheck, showLoading: false);
|
|
|
|
|
|
|
|
|
|
// GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId);
|
|
|
|
|
// List<Map<String, dynamic>> getSetList = getDefaultValuesIonicLogic(parent);
|
|
|
|
|
@ -185,19 +187,23 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
|
|
|
|
|
// int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
|
|
|
|
|
// getEitDffStructureList![index].eSERVICESDV = defaultValue;
|
|
|
|
|
} else if (defaultValueCheck.cHILDSEGMENTSVSSplited!.isNotEmpty && defaultValueCheck.rEADONLY == 'Y') {
|
|
|
|
|
calGetValueSetValues(defaultValueCheck);
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
await calGetValueSetValues(defaultValueCheck, showLoading: false);
|
|
|
|
|
// Utils.hideLoading(context);
|
|
|
|
|
}
|
|
|
|
|
} else if (values.isNotEmpty) {
|
|
|
|
|
ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
|
|
|
|
|
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
|
|
|
|
|
getEitDffStructureList![index].eSERVICESDV = defaultValue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
await Future.delayed(const Duration(seconds: 1));
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
if (showLoading) {
|
|
|
|
|
await Future.delayed(const Duration(seconds: 1));
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
if (showLoading) Utils.hideLoading(context);
|
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -331,7 +337,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
|
|
|
|
|
idColName = val;
|
|
|
|
|
|
|
|
|
|
if (getEitDffStructureList![j].fORMATTYPE == "X") {
|
|
|
|
|
idColName = Utils.formatDateNew(idColName!);
|
|
|
|
|
idColName = Utils.formatDateDefault(idColName!);
|
|
|
|
|
// commenting to test
|
|
|
|
|
// DateTime date = DateFormat('yyyy-MM-dd').parse(idColName!);
|
|
|
|
|
// idColName = DateFormat('yyyy-MM-dd HH:mm:ss').format(date);
|
|
|
|
|
|