mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-14 20:16:25 +00:00
Refactoring
This commit is contained in:
parent
75725c2cb9
commit
e0a3926772
1 changed files with 11 additions and 26 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
import 'package:InvenTree/inventree/part.dart';
|
import 'package:InvenTree/inventree/part.dart';
|
||||||
import 'package:InvenTree/widget/category_display.dart';
|
import 'package:InvenTree/widget/category_display.dart';
|
||||||
import 'package:InvenTree/widget/dialogs.dart';
|
import 'package:InvenTree/widget/dialogs.dart';
|
||||||
|
import 'package:InvenTree/widget/fields.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
@ -85,38 +86,22 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
fields: <Widget>[
|
fields: <Widget>[
|
||||||
TextFormField(
|
StringField(
|
||||||
decoration: InputDecoration(
|
label: "Part Name",
|
||||||
labelText: "Part Name",
|
initial: part.name,
|
||||||
hintText: "Enter part name",
|
|
||||||
),
|
|
||||||
initialValue: part.name,
|
|
||||||
validator: (value) {
|
|
||||||
if (value.isEmpty) return "Name cannot be empty";
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
onSaved: (value) => _name = value,
|
onSaved: (value) => _name = value,
|
||||||
),
|
),
|
||||||
TextFormField(
|
StringField(
|
||||||
decoration: InputDecoration(
|
label: "Part Description",
|
||||||
labelText: "Part Description",
|
initial: part.description,
|
||||||
hintText: "Enter part description",
|
|
||||||
),
|
|
||||||
initialValue: part.description,
|
|
||||||
validator: (value) {
|
|
||||||
if (value.isEmpty) return "Description cannot be empty";
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
onSaved: (value) => _description = value,
|
onSaved: (value) => _description = value,
|
||||||
),
|
),
|
||||||
TextFormField(
|
StringField(
|
||||||
decoration: InputDecoration(
|
label: "Internal Part Number",
|
||||||
labelText: "Internal Part Number",
|
initial: part.IPN,
|
||||||
hintText: "Enter internal part number",
|
|
||||||
),
|
|
||||||
initialValue: part.IPN,
|
|
||||||
onSaved: (value) => _ipn = value,
|
onSaved: (value) => _ipn = value,
|
||||||
)
|
)
|
||||||
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue