fix: add price input to manual register
This commit is contained in:
parent
19c4243273
commit
630eacc1e1
1 changed files with 21 additions and 0 deletions
|
|
@ -166,6 +166,7 @@ class _FullyManualState extends State<_FullyManual> {
|
||||||
String? ean = "";
|
String? ean = "";
|
||||||
String? title;
|
String? title;
|
||||||
String? author;
|
String? author;
|
||||||
|
num? price;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -227,6 +228,26 @@ class _FullyManualState extends State<_FullyManual> {
|
||||||
author = newValue;
|
author = newValue;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
SizedBox(height: 10),
|
||||||
|
TextFormField(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: "Prix",
|
||||||
|
border: OutlineInputBorder(),
|
||||||
|
suffixText: "€",
|
||||||
|
),
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
validator: (value) {
|
||||||
|
if (value == null || value.isEmpty) {
|
||||||
|
return "Indiquez un prix";
|
||||||
|
} else if (num.tryParse(value) == null) {
|
||||||
|
return "Le prix doit être un nombre";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
onSaved: (newValue) {
|
||||||
|
price = num.parse(newValue!);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Reference in a new issue