|
|
|
@@ -59,7 +59,6 @@ class ActionScreen extends StatefulWidget { |
|
|
|
} |
|
|
|
|
|
|
|
class _ActionScreenState extends State<ActionScreen> { |
|
|
|
final _scaffoldKey = GlobalKey<ScaffoldState>(); |
|
|
|
var _formKey = GlobalKey<FormState>(); |
|
|
|
var pref = LocalPref(); |
|
|
|
final _executeByController = TextEditingController(); |
|
|
|
@@ -131,17 +130,36 @@ class _ActionScreenState extends State<ActionScreen> { |
|
|
|
var activityCommonData = |
|
|
|
jsonEncode(_requestActivity.toJson()).toString(); |
|
|
|
print(activityCommonData); |
|
|
|
_repository.createActionCommon((data) { |
|
|
|
LoadingDialog.hideLoadingDialog(context); |
|
|
|
Get.back(result: 'ok'); |
|
|
|
Utils.showSnackBarSuccess(message: label_add_success); |
|
|
|
}, (error) { |
|
|
|
LoadingDialog.hideLoadingDialog(context); |
|
|
|
Utils.showSnackBarError(message: AppException.handleError(error)); |
|
|
|
}, |
|
|
|
activityType: widget.activityType, |
|
|
|
activityData: activityCommonData, |
|
|
|
filePaths: filePaths); |
|
|
|
|
|
|
|
if (widget.activityId < 0) { |
|
|
|
//ADD New |
|
|
|
_repository.createActionCommon((data) { |
|
|
|
LoadingDialog.hideLoadingDialog(context); |
|
|
|
Get.back(result: 'ok'); |
|
|
|
Utils.showSnackBarSuccess(message: label_add_success); |
|
|
|
}, (error) { |
|
|
|
LoadingDialog.hideLoadingDialog(context); |
|
|
|
Utils.showSnackBarError(message: AppException.handleError(error)); |
|
|
|
}, |
|
|
|
activityType: widget.activityType, |
|
|
|
activityData: activityCommonData, |
|
|
|
filePaths: filePaths); |
|
|
|
} else { |
|
|
|
//UPDATE |
|
|
|
_repository.updateActionCommon((data) { |
|
|
|
LoadingDialog.hideLoadingDialog(context); |
|
|
|
Get.back(result: 'ok'); |
|
|
|
Utils.showSnackBarSuccess(message: label_update_success); |
|
|
|
}, (error) { |
|
|
|
LoadingDialog.hideLoadingDialog(context); |
|
|
|
Utils.showSnackBarError(message: AppException.handleError(error)); |
|
|
|
}, |
|
|
|
activityType: widget.activityType, |
|
|
|
activityData: activityCommonData, |
|
|
|
activityId: widget.activityId, |
|
|
|
filePaths: filePaths); |
|
|
|
} |
|
|
|
|
|
|
|
//ADD NEW |
|
|
|
//Update |
|
|
|
|
|
|
|
@@ -360,9 +378,22 @@ class _ActionScreenState extends State<ActionScreen> { |
|
|
|
print("SchedulerBinding"); |
|
|
|
if (element.tbObjectParameterDTO.tbControlTypeName == 'dropdown' || |
|
|
|
element.tbObjectParameterDTO.tbControlTypeName == 'radio') { |
|
|
|
var dropdownValueName = ''; |
|
|
|
if (element.tbObjectParameterDTO |
|
|
|
.tbActivityExtendTypeDropDownDTOList.isNotEmpty || |
|
|
|
element.tbObjectParameterDTO |
|
|
|
.tbActivityExtendTypeDropDownDTOList != |
|
|
|
null) { |
|
|
|
element.tbObjectParameterDTO.tbActivityExtendTypeDropDownDTOList |
|
|
|
.forEach((dropdownData) { |
|
|
|
if (dropdownData.id == int.tryParse(element.index)) { |
|
|
|
dropdownValueName = dropdownData.name; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
var commonData = CommonData() |
|
|
|
..id = int.tryParse(element.index) |
|
|
|
..name = ''; |
|
|
|
..name = dropdownValueName; |
|
|
|
Get.find<ChangeDropdownController>( |
|
|
|
tag: element.tbObjectParameterDTO.name) |
|
|
|
.change(commonData); |
|
|
|
@@ -399,10 +430,10 @@ class _ActionScreenState extends State<ActionScreen> { |
|
|
|
color: Colors.red, fontWeight: FontWeight.normal), |
|
|
|
), |
|
|
|
onTap: () { |
|
|
|
// FocusScopeNode currentFocus = FocusScope.of(context); |
|
|
|
// if (!currentFocus.hasPrimaryFocus) { |
|
|
|
// currentFocus.unfocus(); |
|
|
|
// } |
|
|
|
FocusScopeNode currentFocus = FocusScope.of(context); |
|
|
|
if (!currentFocus.hasPrimaryFocus) { |
|
|
|
currentFocus.unfocus(); |
|
|
|
} |
|
|
|
_validateInputs(); |
|
|
|
}, |
|
|
|
), |