dddd
This commit is contained in:
parent
e61cd760bd
commit
059da2af1b
@ -404,12 +404,7 @@ class _CartPageState extends State<CartPage> {
|
||||
);
|
||||
|
||||
// 3. Succès
|
||||
Navigator.of(context).pushAndRemoveUntil(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const MainLayout(child: TablesScreen()),
|
||||
),
|
||||
(route) => false,
|
||||
);
|
||||
_showPaymentSuccessDialog(commandeData, total);
|
||||
} else {
|
||||
throw Exception('Erreur lors du paiement');
|
||||
}
|
||||
@ -446,9 +441,9 @@ class _CartPageState extends State<CartPage> {
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text('Commande #${commandeData['numeroCommande']}'),
|
||||
Text('Commande #${commandeData['id']}'),
|
||||
const SizedBox(height: 8),
|
||||
Text('${widget.tablename} libérée'),
|
||||
Text('Table ${widget.tablename} libérée'),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'Montant: ${total.toStringAsFixed(2)} €',
|
||||
@ -461,17 +456,32 @@ class _CartPageState extends State<CartPage> {
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pop(); // Retour au menu principal
|
||||
Navigator.of(context).pop(); // Fermer le dialog
|
||||
// Naviguer vers la page des tables
|
||||
Navigator.of(context).pushAndRemoveUntil(
|
||||
MaterialPageRoute(
|
||||
builder:
|
||||
(context) => const MainLayout(child: TablesScreen()),
|
||||
),
|
||||
(route) => false,
|
||||
);
|
||||
},
|
||||
child: const Text('Non merci'),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pop(); // Fermer le dialog
|
||||
await _imprimerTicketPaiement(commandeData, total);
|
||||
Navigator.of(context).pop(); // Retour au menu principal
|
||||
// Naviguer vers la page des tables après l'impression
|
||||
Navigator.of(context).pushAndRemoveUntil(
|
||||
MaterialPageRoute(
|
||||
builder:
|
||||
(context) => const MainLayout(child: TablesScreen()),
|
||||
),
|
||||
(route) => false,
|
||||
);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.green),
|
||||
child: const Text('Imprimer'),
|
||||
),
|
||||
],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user