2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 10:15:32 +00:00

Improve formatting of error messages

Also run onSuccess function when form completes
This commit is contained in:
Oliver
2021-07-23 09:42:05 +10:00
parent 64aed4b31a
commit 5c2f747b93
2 changed files with 46 additions and 61 deletions

View File

@ -174,13 +174,6 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
void _editPartDialog(BuildContext context) {
// Values which can be edited
var _name;
var _description;
var _ipn;
var _keywords;
var _link;
launchApiForm(
context,
L10().editPart,
@ -196,52 +189,6 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
modelData: part.jsondata,
onSuccess: refresh,
);
return;
showFormDialog(L10().editPart,
key: _editPartKey,
callback: () {
_savePart({
"name": _name,
"description": _description,
"IPN": _ipn,
"keywords": _keywords,
"link": _link
});
},
fields: <Widget>[
StringField(
label: L10().name,
initial: part.name,
onSaved: (value) => _name = value,
),
StringField(
label: L10().description,
initial: part.description,
onSaved: (value) => _description = value,
),
StringField(
label: L10().internalPartNumber,
initial: part.IPN,
allowEmpty: true,
onSaved: (value) => _ipn = value,
),
StringField(
label: L10().keywords,
initial: part.keywords,
allowEmpty: true,
onSaved: (value) => _keywords = value,
),
StringField(
label: L10().link,
initial: part.link,
allowEmpty: true,
onSaved: (value) => _link = value
)
]
);
}
Widget headerTile() {