Compare commits

..

2 commits

Author SHA1 Message Date
Ninjdai
fa7182d75e feat: trim user input 2025-08-14 13:32:41 +02:00
Ninjdai
821232addc feat: snackbar on book instance save 2025-08-14 13:26:36 +02:00
5 changed files with 13 additions and 7 deletions

View file

@ -143,6 +143,12 @@ class _ConfirmationPopupState extends State<ConfirmationPopup> {
TextButton( TextButton(
onPressed: () { onPressed: () {
widget.exitPopup(context); widget.exitPopup(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text("Enregistré: ${widget.book.title}"),
behavior: SnackBarBehavior.floating,
),
);
}, },
child: Text("Ok"), child: Text("Ok"),
), ),

View file

@ -243,7 +243,7 @@ class _FullyManualState extends State<_FullyManual> {
return null; return null;
}, },
onSaved: (newValue) { onSaved: (newValue) {
title = newValue; title = newValue?.trim();
}, },
), ),
SizedBox(height: 10), SizedBox(height: 10),
@ -259,7 +259,7 @@ class _FullyManualState extends State<_FullyManual> {
return null; return null;
}, },
onSaved: (newValue) { onSaved: (newValue) {
author = newValue; author = newValue?.trim();
}, },
), ),
SizedBox(height: 10), SizedBox(height: 10),

View file

@ -87,7 +87,7 @@ class _OwnerPopupState extends State<OwnerPopup> {
), ),
onSaved: (newValue) { onSaved: (newValue) {
setState(() { setState(() {
lastName = newValue; lastName = newValue?.trim();
}); });
}, },
validator: (value) { validator: (value) {
@ -105,7 +105,7 @@ class _OwnerPopupState extends State<OwnerPopup> {
), ),
onSaved: (newValue) { onSaved: (newValue) {
setState(() { setState(() {
firstName = newValue; firstName = newValue?.trim();
}); });
}, },
validator: (value) { validator: (value) {
@ -123,7 +123,7 @@ class _OwnerPopupState extends State<OwnerPopup> {
), ),
onSaved: (newValue) { onSaved: (newValue) {
setState(() { setState(() {
contact = newValue; contact = newValue?.trim();
}); });
}, },
validator: (value) { validator: (value) {

View file

@ -134,7 +134,7 @@ class _EditPopup extends State<EditPopup> {
return null; return null;
}, },
onSaved: (newValue) { onSaved: (newValue) {
name = newValue; name = newValue?.trim();
}, },
), ),
Row( Row(

View file

@ -61,7 +61,7 @@ class _CreateConfirmationPopupState extends State<CreateConfirmationPopup> {
return null; return null;
}, },
onSaved: (newValue) { onSaved: (newValue) {
name = newValue; name = newValue?.trim();
}, },
), ),
Row( Row(