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

Enable multi-line text editing for API forms

- User can edit part notes
- User can edit stock item notes
This commit is contained in:
Oliver
2021-07-28 16:19:42 +10:00
parent b8379e05db
commit d6a2a41ab2
10 changed files with 129 additions and 82 deletions

View File

@ -37,7 +37,6 @@ class PartDetailWidget extends StatefulWidget {
class _PartDisplayState extends RefreshableState<PartDetailWidget> {
final _editImageKey = GlobalKey<FormState>();
final _editPartKey = GlobalKey<FormState>();
@override
String getAppBarTitle(BuildContext context) => L10().partDetails;
@ -104,23 +103,6 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
}
}
void _savePart(Map<String, String> values) async {
final bool result = await part.update(values: values);
if (result) {
showSnackIcon(L10().partEdited, success: true);
}
/*
showSnackIcon(
result ? "Part edited" : "Part editing failed",
success: result
);
*/
refresh();
}
/**
* Upload image for this Part.
* Show a SnackBar with upload result.
@ -411,22 +393,20 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
);
}
// Notes field?
if (part.notes.isNotEmpty) {
tiles.add(
ListTile(
title: Text(L10().notes),
leading: FaIcon(FontAwesomeIcons.stickyNote, color: COLOR_CLICK),
trailing: Text(""),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => PartNotesWidget(part))
);
},
)
);
}
// Notes field
tiles.add(
ListTile(
title: Text(L10().notes),
leading: FaIcon(FontAwesomeIcons.stickyNote, color: COLOR_CLICK),
trailing: Text(""),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => PartNotesWidget(part))
);
},
)
);
return tiles;