2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 18:25:26 +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

@ -47,7 +47,6 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
final _removeStockKey = GlobalKey<FormState>();
final _countStockKey = GlobalKey<FormState>();
final _moveStockKey = GlobalKey<FormState>();
final _editStockKey = GlobalKey<FormState>();
_StockItemDisplayState(this.item);
@ -291,9 +290,6 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
void _transferStockDialog(BuildContext context) async {
var locations = await InvenTreeStockLocation().list();
final _selectedController = TextEditingController();
int? location_pk;
_quantityController.text = "${item.quantityString}";
@ -563,22 +559,21 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
);
}
if (item.notes.isNotEmpty) {
tiles.add(
ListTile(
title: Text(L10().notes),
leading: FaIcon(FontAwesomeIcons.stickyNote, color: COLOR_CLICK),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => StockNotesWidget(item))
);
// TODO: Load notes in markdown viewer widget
// TODO: Make this widget editable?
}
)
);
}
// Notes field
tiles.add(
ListTile(
title: Text(L10().notes),
leading: FaIcon(FontAwesomeIcons.stickyNote, color: COLOR_CLICK),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => StockNotesWidget(item))
);
// TODO: Load notes in markdown viewer widget
// TODO: Make this widget editable?
}
)
);
return tiles;
}