fix: overflow + owner managment error

This commit is contained in:
Alzalia 2025-08-05 15:50:37 +02:00
parent 86094b5d76
commit f8f1849d9d
4 changed files with 309 additions and 281 deletions

View file

@ -30,69 +30,71 @@ class _ConfirmationPopupState extends State<ConfirmationPopup> {
title: Text("Prix"),
content: Form(
key: _formKey,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
RichText(
text: TextSpan(
style: theme.textTheme.bodyMedium,
children: [
TextSpan(
text: "Titre : ",
style: TextStyle(fontWeight: FontWeight.bold),
),
TextSpan(text: widget.book.title),
],
),
),
RichText(
text: TextSpan(
style: theme.textTheme.bodyMedium,
children: [
TextSpan(
text: "Auteur·ice : ",
style: TextStyle(fontWeight: FontWeight.bold),
),
TextSpan(text: widget.book.author),
],
),
),
RichText(
text: TextSpan(
style: theme.textTheme.bodyMedium,
children: [
TextSpan(
text: "Prix à neuf : ",
style: TextStyle(fontWeight: FontWeight.bold),
),
TextSpan(text: widget.book.priceNew),
],
),
),
SizedBox(height: 10),
(widget.viewModel.askPrice)
? TextFormField(
decoration: InputDecoration(
labelText: "Prix",
border: OutlineInputBorder(),
suffixText: "",
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
RichText(
text: TextSpan(
style: theme.textTheme.bodyMedium,
children: [
TextSpan(
text: "Titre : ",
style: TextStyle(fontWeight: FontWeight.bold),
),
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!);
},
)
: SizedBox(),
],
TextSpan(text: widget.book.title),
],
),
),
RichText(
text: TextSpan(
style: theme.textTheme.bodyMedium,
children: [
TextSpan(
text: "Auteur·ice : ",
style: TextStyle(fontWeight: FontWeight.bold),
),
TextSpan(text: widget.book.author),
],
),
),
RichText(
text: TextSpan(
style: theme.textTheme.bodyMedium,
children: [
TextSpan(
text: "Prix à neuf : ",
style: TextStyle(fontWeight: FontWeight.bold),
),
TextSpan(text: widget.book.priceNew),
],
),
),
SizedBox(height: 10),
(widget.viewModel.askPrice)
? 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!);
},
)
: SizedBox(),
],
),
),
),
actions: [