mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +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:
parent
b8379e05db
commit
d6a2a41ab2
10 changed files with 129 additions and 82 deletions
|
|
@ -22,8 +22,6 @@ import 'package:inventree/widget/snacks.dart';
|
|||
*/
|
||||
class APIFormField {
|
||||
|
||||
final _controller = TextEditingController();
|
||||
|
||||
// Constructor
|
||||
APIFormField(this.name, this.data);
|
||||
|
||||
|
|
@ -47,6 +45,8 @@ class APIFormField {
|
|||
// Is this field read only?
|
||||
bool get readOnly => (data['read_only'] ?? false) as bool;
|
||||
|
||||
bool get multiline => (data['multiline'] ?? false) as bool;
|
||||
|
||||
// Get the "value" as a string (look for "default" if not available)
|
||||
dynamic get value => (data['value'] ?? data['default']);
|
||||
|
||||
|
|
@ -341,6 +341,8 @@ class APIFormField {
|
|||
helperStyle: _helperStyle(),
|
||||
hintText: placeholderText,
|
||||
),
|
||||
maxLines: multiline ? null : 1,
|
||||
expands: false,
|
||||
initialValue: value ?? '',
|
||||
onSaved: (val) {
|
||||
data["value"] = val;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue