Browse Source

colonne 1

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

69
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,39 +446,54 @@ class _TablesScreenState extends State<TablesScreen> {
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
child: ElevatedButton( child: ElevatedButton(
onPressed: isSelectable onPressed:
? () { isSelectable
// Affiche un message ? () {
ScaffoldMessenger.of(context).showSnackBar( // Affiche un message
SnackBar( ScaffoldMessenger.of(
content: Text('Table ${table.nom} sélectionnée'), context,
), ).showSnackBar(
); SnackBar(
content: Text(
// Redirige vers MenuPage avec les paramètres requis 'Table ${table.nom} sélectionnée',
Navigator.push( ),
context,
MaterialPageRoute(
builder: (context) => MenuPage(
tableId: table.id,
personne: table.capacity, // Ajout du paramètre manquant
), ),
), );
);
} // Redirige vers MenuPage avec les paramètres requis
: null, Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => MenuPage(
tableId: table.id,
personne:
table
.capacity, // Ajout du paramètre manquant
),
),
);
}
: null,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: isSelectable backgroundColor:
? Colors.green.shade700 isSelectable
: Colors.grey.shade300, ? Colors.green.shade700
: 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