Browse Source

colonne 1

master
Stephane 4 months ago
parent
commit
856da7c009
  1. 35
      lib/pages/tables.dart

35
lib/pages/tables.dart

@ -230,7 +230,7 @@ class _TablesScreenState extends State<TablesScreen> {
final screenWidth = MediaQuery.of(context).size.width; final screenWidth = MediaQuery.of(context).size.width;
final isDesktop = screenWidth >= 768; final isDesktop = screenWidth >= 768;
int crossAxisCount = 2; int crossAxisCount = 1;
if (screenWidth > 1200) { if (screenWidth > 1200) {
crossAxisCount = 4; crossAxisCount = 4;
} else if (screenWidth > 800) { } else if (screenWidth > 800) {
@ -446,12 +446,17 @@ class _TablesScreenState extends State<TablesScreen> {
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
child: ElevatedButton( child: ElevatedButton(
onPressed: isSelectable onPressed:
isSelectable
? () { ? () {
// Affiche un message // Affiche un message
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(
context,
).showSnackBar(
SnackBar( SnackBar(
content: Text('Table ${table.nom} sélectionnée'), content: Text(
'Table ${table.nom} sélectionnée',
),
), ),
); );
@ -459,26 +464,36 @@ class _TablesScreenState extends State<TablesScreen> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => MenuPage( builder:
(context) => MenuPage(
tableId: table.id, tableId: table.id,
personne: table.capacity, // Ajout du paramètre manquant personne:
table
.capacity, // Ajout du paramètre manquant
), ),
), ),
); );
} }
: null, : null,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: isSelectable backgroundColor:
isSelectable
? Colors.green.shade700 ? Colors.green.shade700
: Colors.grey.shade300, : Colors.grey.shade300,
foregroundColor: Colors.white, foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(
vertical: 8,
),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(
8,
),
), ),
), ),
child: Text( child: Text(
isSelectable ? 'Sélectionner' : 'Indisponible', isSelectable
? 'Sélectionner'
: 'Indisponible',
style: const TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,

Loading…
Cancel
Save