|
@@ -1,5 +1,70 @@
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
+class OrdenItem {
|
|
|
|
+ final int cantidad;
|
|
|
|
+ final String nombre;
|
|
|
|
+ final String descripcion;
|
|
|
|
+ final String? notas;
|
|
|
|
+ final bool isListo;
|
|
|
|
+
|
|
|
|
+ OrdenItem({
|
|
|
|
+ required this.cantidad,
|
|
|
|
+ required this.nombre,
|
|
|
|
+ required this.descripcion,
|
|
|
|
+ this.notas,
|
|
|
|
+ this.isListo = false,
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+class OrdenesScreen extends StatelessWidget {
|
|
|
|
+ const OrdenesScreen({Key? key}) : super(key: key);
|
|
|
|
+
|
|
|
|
+ @override
|
|
|
|
+ Widget build(BuildContext context) {
|
|
|
|
+ final items = [
|
|
|
|
+ OrdenItem(
|
|
|
|
+ cantidad: 1,
|
|
|
|
+ nombre: 'Chilaquiles Verdes',
|
|
|
|
+ descripcion: 'Tortillas fritas en salsa verde con pollo',
|
|
|
|
+ notas: 'Sin cebolla ni tomate',
|
|
|
|
+ ),
|
|
|
|
+ OrdenItem(
|
|
|
|
+ cantidad: 2,
|
|
|
|
+ nombre: 'Huevos Rancheros',
|
|
|
|
+ descripcion: 'Huevos fritos sobre tortilla con salsa roja',
|
|
|
|
+ ),
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ final items2 = [
|
|
|
|
+ OrdenItem(
|
|
|
|
+ cantidad: 1,
|
|
|
|
+ nombre: 'Club Sandwich',
|
|
|
|
+ descripcion: 'Sándwich triple con pollo, jamón y tocino',
|
|
|
|
+ isListo: true,
|
|
|
|
+ ),
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ return Column(
|
|
|
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
|
+ children: [
|
|
|
|
+ OrdenMesaCard(
|
|
|
|
+ mesaNumero: '5',
|
|
|
|
+ ordenNumero: 'A-123',
|
|
|
|
+ items: items,
|
|
|
|
+ onLiberarOrden: () {},
|
|
|
|
+ ),
|
|
|
|
+ OrdenMesaCard(
|
|
|
|
+ mesaNumero: '3',
|
|
|
|
+ ordenNumero: 'A-124',
|
|
|
|
+ items: items2,
|
|
|
|
+ tieneItemsListos: true,
|
|
|
|
+ onLiberarOrden: () {},
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
class OrdenMesaCard extends StatelessWidget {
|
|
class OrdenMesaCard extends StatelessWidget {
|
|
final String mesaNumero;
|
|
final String mesaNumero;
|
|
final String ordenNumero;
|
|
final String ordenNumero;
|
|
@@ -21,10 +86,8 @@ class OrdenMesaCard extends StatelessWidget {
|
|
return Card(
|
|
return Card(
|
|
margin: const EdgeInsets.all(8.0),
|
|
margin: const EdgeInsets.all(8.0),
|
|
child: Column(
|
|
child: Column(
|
|
- crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
children: [
|
|
- // Encabezado de la mesa
|
|
|
|
Padding(
|
|
Padding(
|
|
padding: const EdgeInsets.all(16.0),
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: Row(
|
|
child: Row(
|
|
@@ -41,33 +104,28 @@ class OrdenMesaCard extends StatelessWidget {
|
|
children: [
|
|
children: [
|
|
const Icon(Icons.access_time, size: 16),
|
|
const Icon(Icons.access_time, size: 16),
|
|
const SizedBox(width: 4),
|
|
const SizedBox(width: 4),
|
|
- Text('15:03'),
|
|
|
|
|
|
+ const Text('15:03'),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
const Divider(height: 1),
|
|
const Divider(height: 1),
|
|
- // Número de orden
|
|
|
|
Padding(
|
|
Padding(
|
|
padding:
|
|
padding:
|
|
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
|
|
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
|
|
- child: Text(
|
|
|
|
- 'Orden #$ordenNumero',
|
|
|
|
- style: TextStyle(
|
|
|
|
- color: Colors.grey[600],
|
|
|
|
- fontSize: 14,
|
|
|
|
|
|
+ child: Align(
|
|
|
|
+ alignment: Alignment.centerLeft,
|
|
|
|
+ child: Text(
|
|
|
|
+ 'Orden #$ordenNumero',
|
|
|
|
+ style: TextStyle(
|
|
|
|
+ color: Colors.grey[600],
|
|
|
|
+ fontSize: 14,
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
- // Lista de items
|
|
|
|
- ListView.builder(
|
|
|
|
- shrinkWrap: true,
|
|
|
|
- physics: const NeverScrollableScrollPhysics(),
|
|
|
|
- itemCount: items.length,
|
|
|
|
- itemBuilder: (context, index) {
|
|
|
|
- final item = items[index];
|
|
|
|
- return ListTile(
|
|
|
|
|
|
+ ...items.map((item) => ListTile(
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
leading: Text(
|
|
leading: Text(
|
|
'${item.cantidad}x',
|
|
'${item.cantidad}x',
|
|
@@ -120,10 +178,7 @@ class OrdenMesaCard extends StatelessWidget {
|
|
),
|
|
),
|
|
)
|
|
)
|
|
: const Icon(Icons.chevron_right),
|
|
: const Icon(Icons.chevron_right),
|
|
- );
|
|
|
|
- },
|
|
|
|
- ),
|
|
|
|
-
|
|
|
|
|
|
+ )),
|
|
Padding(
|
|
Padding(
|
|
padding: const EdgeInsets.all(16.0),
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: ElevatedButton(
|
|
child: ElevatedButton(
|
|
@@ -135,12 +190,16 @@ class OrdenMesaCard extends StatelessWidget {
|
|
borderRadius: BorderRadius.circular(8),
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
- child: const Text(
|
|
|
|
- 'Liberar Orden Completa',
|
|
|
|
- style: TextStyle(
|
|
|
|
- color: Colors.white,
|
|
|
|
- fontSize: 16,
|
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
|
|
|
+ child: const SizedBox(
|
|
|
|
+ width: double.infinity,
|
|
|
|
+ child: Text(
|
|
|
|
+ 'Liberar Orden Completa',
|
|
|
|
+ textAlign: TextAlign.center,
|
|
|
|
+ style: TextStyle(
|
|
|
|
+ color: Colors.white,
|
|
|
|
+ fontSize: 16,
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
@@ -150,71 +209,3 @@ class OrdenMesaCard extends StatelessWidget {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-class OrdenItem {
|
|
|
|
- final int cantidad;
|
|
|
|
- final String nombre;
|
|
|
|
- final String descripcion;
|
|
|
|
- final String? notas;
|
|
|
|
- final bool isListo;
|
|
|
|
-
|
|
|
|
- OrdenItem({
|
|
|
|
- required this.cantidad,
|
|
|
|
- required this.nombre,
|
|
|
|
- required this.descripcion,
|
|
|
|
- this.notas,
|
|
|
|
- this.isListo = false,
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-class OrdenesScreen extends StatelessWidget {
|
|
|
|
- const OrdenesScreen({Key? key}) : super(key: key);
|
|
|
|
-
|
|
|
|
- @override
|
|
|
|
- Widget build(BuildContext context) {
|
|
|
|
- final items = [
|
|
|
|
- OrdenItem(
|
|
|
|
- cantidad: 1,
|
|
|
|
- nombre: 'Chilaquiles Verdes',
|
|
|
|
- descripcion: 'Tortillas fritas en salsa verde con pollo',
|
|
|
|
- notas: 'Sin cebolla ni tomate',
|
|
|
|
- ),
|
|
|
|
- OrdenItem(
|
|
|
|
- cantidad: 2,
|
|
|
|
- nombre: 'Huevos Rancheros',
|
|
|
|
- descripcion: 'Huevos fritos sobre tortilla con salsa roja',
|
|
|
|
- ),
|
|
|
|
- ];
|
|
|
|
-
|
|
|
|
- final items2 = [
|
|
|
|
- OrdenItem(
|
|
|
|
- cantidad: 1,
|
|
|
|
- nombre: 'Club Sandwich',
|
|
|
|
- descripcion: 'Sándwich triple con pollo, jamón y tocino',
|
|
|
|
- isListo: true,
|
|
|
|
- ),
|
|
|
|
- ];
|
|
|
|
-
|
|
|
|
- return ListView(
|
|
|
|
- children: [
|
|
|
|
- OrdenMesaCard(
|
|
|
|
- mesaNumero: '5',
|
|
|
|
- ordenNumero: 'A-123',
|
|
|
|
- items: items,
|
|
|
|
- onLiberarOrden: () {
|
|
|
|
- // Implementar lógica para liberar orden
|
|
|
|
- },
|
|
|
|
- ),
|
|
|
|
- OrdenMesaCard(
|
|
|
|
- mesaNumero: '3',
|
|
|
|
- ordenNumero: 'A-124',
|
|
|
|
- items: items2,
|
|
|
|
- tieneItemsListos: true,
|
|
|
|
- onLiberarOrden: () {
|
|
|
|
- // Implementar lógica para liberar orden
|
|
|
|
- },
|
|
|
|
- ),
|
|
|
|
- ],
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
-}
|
|
|