fix: add price input to manual register

This commit is contained in:
Alzalia 2025-08-05 12:28:34 +02:00
parent 19c4243273
commit 630eacc1e1

View file

@ -166,6 +166,7 @@ class _FullyManualState extends State<_FullyManual> {
String? ean = "";
String? title;
String? author;
num? price;
@override
Widget build(BuildContext context) {
@ -227,6 +228,26 @@ class _FullyManualState extends State<_FullyManual> {
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!);
},
),
],
),
),