|
@@ -13,6 +13,7 @@ import '../../models/models.dart';
|
|
import '../../viewmodels/viewmodels.dart';
|
|
import '../../viewmodels/viewmodels.dart';
|
|
import 'package:collection/collection.dart';
|
|
import 'package:collection/collection.dart';
|
|
import '../../widgets/widgets.dart';
|
|
import '../../widgets/widgets.dart';
|
|
|
|
+import 'package:uuid/uuid.dart';
|
|
import '../../services/services.dart';
|
|
import '../../services/services.dart';
|
|
import 'package:timezone/data/latest.dart' as timezone;
|
|
import 'package:timezone/data/latest.dart' as timezone;
|
|
import 'package:timezone/timezone.dart' as timezone;
|
|
import 'package:timezone/timezone.dart' as timezone;
|
|
@@ -55,6 +56,8 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
TextEditingController efectivoController = TextEditingController();
|
|
TextEditingController efectivoController = TextEditingController();
|
|
TextEditingController tarjetaController = TextEditingController();
|
|
TextEditingController tarjetaController = TextEditingController();
|
|
TextEditingController transferenciaController = TextEditingController();
|
|
TextEditingController transferenciaController = TextEditingController();
|
|
|
|
+ TextEditingController _propinaCantidadController = TextEditingController();
|
|
|
|
+ TextEditingController _propinaComentarioController = TextEditingController();
|
|
double cambio = 0.0;
|
|
double cambio = 0.0;
|
|
double faltante = 0.0;
|
|
double faltante = 0.0;
|
|
bool totalCompletado = false;
|
|
bool totalCompletado = false;
|
|
@@ -131,6 +134,7 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
return ItemCarrito(
|
|
return ItemCarrito(
|
|
producto: producto.producto!,
|
|
producto: producto.producto!,
|
|
cantidad: producto.cantidad!,
|
|
cantidad: producto.cantidad!,
|
|
|
|
+ comentario: producto.comentario,
|
|
selectedToppings: producto.toppings.fold<Map<int, Set<int>>>(
|
|
selectedToppings: producto.toppings.fold<Map<int, Set<int>>>(
|
|
{},
|
|
{},
|
|
(acc, topping) {
|
|
(acc, topping) {
|
|
@@ -143,6 +147,8 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
}).toList();
|
|
}).toList();
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ selectedDescuento = pedidoCompleto.descuento ?? 0;
|
|
|
|
+
|
|
_recalcularTotal();
|
|
_recalcularTotal();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -295,11 +301,14 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
_mostrarDialogoPedidoVacio();
|
|
_mostrarDialogoPedidoVacio();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
TextEditingController nombreController = TextEditingController();
|
|
TextEditingController nombreController = TextEditingController();
|
|
TextEditingController descripcionController = TextEditingController();
|
|
TextEditingController descripcionController = TextEditingController();
|
|
|
|
+ TextEditingController mesaSearchController = TextEditingController();
|
|
|
|
|
|
- int? idMesaSeleccionada;
|
|
|
|
|
|
+ Mesa? mesaSeleccionada;
|
|
|
|
|
|
|
|
+ // Inicializa las mesas disponibles
|
|
await Provider.of<MesaViewModel>(context, listen: false).fetchLocalAll();
|
|
await Provider.of<MesaViewModel>(context, listen: false).fetchLocalAll();
|
|
List<Mesa> mesasDisponibles =
|
|
List<Mesa> mesasDisponibles =
|
|
Provider.of<MesaViewModel>(context, listen: false).mesas;
|
|
Provider.of<MesaViewModel>(context, listen: false).mesas;
|
|
@@ -327,21 +336,21 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
hintText: 'Descripción del Pedido',
|
|
hintText: 'Descripción del Pedido',
|
|
),
|
|
),
|
|
const SizedBox(height: 10),
|
|
const SizedBox(height: 10),
|
|
- DropdownButtonFormField<int>(
|
|
|
|
- hint: const Text('Seleccionar Mesa'),
|
|
|
|
- items: mesasDisponibles
|
|
|
|
- .map((mesa) => DropdownMenuItem<int>(
|
|
|
|
- value: mesa.id,
|
|
|
|
- child: Text(mesa.nombre ?? 'Sin Nombre'),
|
|
|
|
- ))
|
|
|
|
- .toList(),
|
|
|
|
- onChanged: (value) {
|
|
|
|
- idMesaSeleccionada = value;
|
|
|
|
|
|
+ AppDropdownSearch(
|
|
|
|
+ controller: mesaSearchController,
|
|
|
|
+ etiqueta: 'Seleccionar Mesa',
|
|
|
|
+ asyncItems: (String query) async {
|
|
|
|
+ await Provider.of<MesaViewModel>(context, listen: false)
|
|
|
|
+ .fetchLocalByName(nombre: query);
|
|
|
|
+ return Provider.of<MesaViewModel>(context, listen: false)
|
|
|
|
+ .mesas;
|
|
|
|
+ },
|
|
|
|
+ itemAsString: (dynamic mesa) =>
|
|
|
|
+ (mesa as Mesa).nombre ?? 'Sin Nombre',
|
|
|
|
+ selectedItem: mesaSeleccionada,
|
|
|
|
+ onChanged: (dynamic nuevaMesa) {
|
|
|
|
+ mesaSeleccionada = nuevaMesa as Mesa;
|
|
},
|
|
},
|
|
- decoration: const InputDecoration(
|
|
|
|
- labelText: 'Mesa',
|
|
|
|
- border: OutlineInputBorder(),
|
|
|
|
- ),
|
|
|
|
),
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
@@ -350,18 +359,17 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
onPressed: () => Navigator.of(context).pop(false),
|
|
onPressed: () => Navigator.of(context).pop(false),
|
|
child: const Text('Cancelar'),
|
|
child: const Text('Cancelar'),
|
|
style: ButtonStyle(
|
|
style: ButtonStyle(
|
|
- padding: MaterialStatePropertyAll(
|
|
|
|
- EdgeInsets.fromLTRB(20, 10, 20, 10)),
|
|
|
|
- backgroundColor: MaterialStatePropertyAll(Colors.red),
|
|
|
|
- foregroundColor:
|
|
|
|
- MaterialStatePropertyAll(AppTheme.secondary)),
|
|
|
|
- ),
|
|
|
|
- const SizedBox(
|
|
|
|
- width: 10,
|
|
|
|
|
|
+ padding: MaterialStatePropertyAll(
|
|
|
|
+ EdgeInsets.fromLTRB(20, 10, 20, 10),
|
|
|
|
+ ),
|
|
|
|
+ backgroundColor: MaterialStatePropertyAll(Colors.red),
|
|
|
|
+ foregroundColor: MaterialStatePropertyAll(AppTheme.secondary),
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
|
|
+ const SizedBox(width: 10),
|
|
TextButton(
|
|
TextButton(
|
|
onPressed: () {
|
|
onPressed: () {
|
|
- if (idMesaSeleccionada != null) {
|
|
|
|
|
|
+ if (mesaSeleccionada != null) {
|
|
Navigator.of(context).pop(true);
|
|
Navigator.of(context).pop(true);
|
|
} else {
|
|
} else {
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
@@ -373,11 +381,12 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
},
|
|
},
|
|
child: const Text('Guardar'),
|
|
child: const Text('Guardar'),
|
|
style: ButtonStyle(
|
|
style: ButtonStyle(
|
|
- padding: MaterialStatePropertyAll(
|
|
|
|
- EdgeInsets.fromLTRB(20, 10, 20, 10)),
|
|
|
|
- backgroundColor: MaterialStatePropertyAll(Colors.black),
|
|
|
|
- foregroundColor:
|
|
|
|
- MaterialStatePropertyAll(AppTheme.quaternary)),
|
|
|
|
|
|
+ padding: MaterialStatePropertyAll(
|
|
|
|
+ EdgeInsets.fromLTRB(20, 10, 20, 10),
|
|
|
|
+ ),
|
|
|
|
+ backgroundColor: MaterialStatePropertyAll(Colors.black),
|
|
|
|
+ foregroundColor: MaterialStatePropertyAll(AppTheme.quaternary),
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
],
|
|
],
|
|
);
|
|
);
|
|
@@ -390,9 +399,10 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
nombreCliente: nombreController.text,
|
|
nombreCliente: nombreController.text,
|
|
comentarios: descripcionController.text,
|
|
comentarios: descripcionController.text,
|
|
estatus: 'NUEVO',
|
|
estatus: 'NUEVO',
|
|
- idMesa: idMesaSeleccionada,
|
|
|
|
|
|
+ idMesa: mesaSeleccionada?.id,
|
|
totalPedido: totalPedido,
|
|
totalPedido: totalPedido,
|
|
descuento: selectedDescuento,
|
|
descuento: selectedDescuento,
|
|
|
|
+ uuid: Uuid().v4(),
|
|
idUsuario: await SessionStorage().getId(),
|
|
idUsuario: await SessionStorage().getId(),
|
|
productos: carrito.map((item) {
|
|
productos: carrito.map((item) {
|
|
return PedidoProducto(
|
|
return PedidoProducto(
|
|
@@ -400,6 +410,7 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
producto: item.producto,
|
|
producto: item.producto,
|
|
costoUnitario: item.producto.precio.toString(),
|
|
costoUnitario: item.producto.precio.toString(),
|
|
cantidad: item.cantidad,
|
|
cantidad: item.cantidad,
|
|
|
|
+ comentario: item.comentario,
|
|
toppings: item.selectedToppings.entries.expand((entry) {
|
|
toppings: item.selectedToppings.entries.expand((entry) {
|
|
return entry.value.map((toppingId) {
|
|
return entry.value.map((toppingId) {
|
|
return PedidoProductoTopping(
|
|
return PedidoProductoTopping(
|
|
@@ -482,6 +493,7 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
bool efectivoCompleto = false;
|
|
bool efectivoCompleto = false;
|
|
bool tarjetaCompleto = false;
|
|
bool tarjetaCompleto = false;
|
|
bool transferenciaCompleto = false;
|
|
bool transferenciaCompleto = false;
|
|
|
|
+ bool propinaExpandida = false;
|
|
|
|
|
|
void _calcularCambio(StateSetter setState) {
|
|
void _calcularCambio(StateSetter setState) {
|
|
double totalPagado = (double.tryParse(efectivoController.text) ?? 0) +
|
|
double totalPagado = (double.tryParse(efectivoController.text) ?? 0) +
|
|
@@ -506,189 +518,216 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
'Finalizar Pedido',
|
|
'Finalizar Pedido',
|
|
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w500),
|
|
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w500),
|
|
),
|
|
),
|
|
- content: Container(
|
|
|
|
- height:
|
|
|
|
- pedidoActual == null || pedidoActual!.id == 0 ? 600 : 400,
|
|
|
|
- child: Column(
|
|
|
|
- children: [
|
|
|
|
- Expanded(
|
|
|
|
- child: SingleChildScrollView(
|
|
|
|
- child: Column(
|
|
|
|
- children: [
|
|
|
|
- if (nombreController != null)
|
|
|
|
- AppTextField(
|
|
|
|
- controller: nombreController,
|
|
|
|
- etiqueta: 'Nombre',
|
|
|
|
- hintText: "Nombre del Cliente",
|
|
|
|
- ),
|
|
|
|
- if (comentarioController != null) ...[
|
|
|
|
- const SizedBox(height: 10),
|
|
|
|
- AppTextField(
|
|
|
|
- controller: comentarioController,
|
|
|
|
- etiqueta: 'Comentarios (opcional)',
|
|
|
|
- hintText: 'Comentarios',
|
|
|
|
- maxLines: 2,
|
|
|
|
- ),
|
|
|
|
- ],
|
|
|
|
- const SizedBox(height: 10),
|
|
|
|
- Align(
|
|
|
|
- alignment: Alignment.center,
|
|
|
|
- child: Text(
|
|
|
|
- 'Métodos de pago',
|
|
|
|
- style: TextStyle(
|
|
|
|
- fontWeight: FontWeight.bold, fontSize: 20),
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
- const SizedBox(height: 10),
|
|
|
|
- // Efectivo
|
|
|
|
- _buildPaymentMethodRow(
|
|
|
|
- setState,
|
|
|
|
- label: 'Efectivo',
|
|
|
|
- selected: efectivoSeleccionado,
|
|
|
|
- exactSelected: efectivoCompleto,
|
|
|
|
- controller: efectivoController,
|
|
|
|
- onSelected: (value) {
|
|
|
|
- setState(() {
|
|
|
|
- efectivoSeleccionado = value;
|
|
|
|
- if (!efectivoSeleccionado) {
|
|
|
|
- efectivoCompleto = false;
|
|
|
|
- efectivoController.clear();
|
|
|
|
- }
|
|
|
|
- _calcularCambio(setState);
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- onExactSelected: (value) {
|
|
|
|
- setState(() {
|
|
|
|
- efectivoCompleto = value;
|
|
|
|
- if (efectivoCompleto) {
|
|
|
|
- efectivoController.text =
|
|
|
|
- totalPedido.toStringAsFixed(2);
|
|
|
|
- efectivoSeleccionado = true;
|
|
|
|
- tarjetaSeleccionada = false;
|
|
|
|
- transferenciaSeleccionada = false;
|
|
|
|
- tarjetaController.clear();
|
|
|
|
- transferenciaController.clear();
|
|
|
|
- } else {
|
|
|
|
- efectivoController.clear();
|
|
|
|
- }
|
|
|
|
- _calcularCambio(setState);
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- disableOtherMethods:
|
|
|
|
- tarjetaCompleto || transferenciaCompleto,
|
|
|
|
- onChangedMonto: () => _calcularCambio(setState),
|
|
|
|
- ),
|
|
|
|
- // Tarjeta
|
|
|
|
- _buildPaymentMethodRow(
|
|
|
|
- setState,
|
|
|
|
- label: 'Tarjeta',
|
|
|
|
- selected: tarjetaSeleccionada,
|
|
|
|
- exactSelected: tarjetaCompleto,
|
|
|
|
- controller: tarjetaController,
|
|
|
|
- onSelected: (value) {
|
|
|
|
- setState(() {
|
|
|
|
- tarjetaSeleccionada = value;
|
|
|
|
- if (!tarjetaSeleccionada) {
|
|
|
|
- tarjetaCompleto = false;
|
|
|
|
- tarjetaController.clear();
|
|
|
|
- }
|
|
|
|
- _calcularCambio(setState);
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- onExactSelected: (value) {
|
|
|
|
- setState(() {
|
|
|
|
- tarjetaCompleto = value;
|
|
|
|
- if (tarjetaCompleto) {
|
|
|
|
- tarjetaController.text =
|
|
|
|
- totalPedido.toStringAsFixed(2);
|
|
|
|
- tarjetaSeleccionada = true;
|
|
|
|
- efectivoSeleccionado = false;
|
|
|
|
- transferenciaSeleccionada = false;
|
|
|
|
- efectivoController.clear();
|
|
|
|
- transferenciaController.clear();
|
|
|
|
- } else {
|
|
|
|
- tarjetaController.clear();
|
|
|
|
- }
|
|
|
|
- _calcularCambio(setState);
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- disableOtherMethods:
|
|
|
|
- efectivoCompleto || transferenciaCompleto,
|
|
|
|
- onChangedMonto: () => _calcularCambio(setState),
|
|
|
|
- ),
|
|
|
|
- // Transferencia
|
|
|
|
- _buildPaymentMethodRow(
|
|
|
|
- setState,
|
|
|
|
- label: 'Transferencia',
|
|
|
|
- selected: transferenciaSeleccionada,
|
|
|
|
- exactSelected: transferenciaCompleto,
|
|
|
|
- controller: transferenciaController,
|
|
|
|
- onSelected: (value) {
|
|
|
|
- setState(() {
|
|
|
|
- transferenciaSeleccionada = value;
|
|
|
|
- if (!transferenciaSeleccionada) {
|
|
|
|
- transferenciaCompleto = false;
|
|
|
|
- transferenciaController.clear();
|
|
|
|
- }
|
|
|
|
- _calcularCambio(setState);
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- onExactSelected: (value) {
|
|
|
|
- setState(() {
|
|
|
|
- transferenciaCompleto = value;
|
|
|
|
- if (transferenciaCompleto) {
|
|
|
|
- transferenciaController.text =
|
|
|
|
- totalPedido.toStringAsFixed(2);
|
|
|
|
- transferenciaSeleccionada = true;
|
|
|
|
- efectivoSeleccionado = false;
|
|
|
|
- tarjetaSeleccionada = false;
|
|
|
|
- efectivoController.clear();
|
|
|
|
- tarjetaController.clear();
|
|
|
|
- } else {
|
|
|
|
- transferenciaController.clear();
|
|
|
|
- }
|
|
|
|
- _calcularCambio(setState);
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- disableOtherMethods:
|
|
|
|
- efectivoCompleto || tarjetaCompleto,
|
|
|
|
- onChangedMonto: () => _calcularCambio(setState),
|
|
|
|
- ),
|
|
|
|
- ],
|
|
|
|
|
|
+ content: SingleChildScrollView(
|
|
|
|
+ child: AnimatedSize(
|
|
|
|
+ duration: const Duration(milliseconds: 300),
|
|
|
|
+ curve: Curves.easeInOut,
|
|
|
|
+ child: Column(
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
+ children: [
|
|
|
|
+ if (nombreController != null)
|
|
|
|
+ AppTextField(
|
|
|
|
+ controller: nombreController,
|
|
|
|
+ etiqueta: 'Nombre',
|
|
|
|
+ hintText: "Nombre del Cliente",
|
|
|
|
+ ),
|
|
|
|
+ if (comentarioController != null) ...[
|
|
|
|
+ const SizedBox(height: 10),
|
|
|
|
+ AppTextField(
|
|
|
|
+ controller: comentarioController,
|
|
|
|
+ etiqueta: 'Comentarios (opcional)',
|
|
|
|
+ hintText: 'Comentarios',
|
|
|
|
+ maxLines: 2,
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ const SizedBox(height: 10),
|
|
|
|
+ Align(
|
|
|
|
+ alignment: Alignment.center,
|
|
|
|
+ child: Text(
|
|
|
|
+ 'Métodos de pago',
|
|
|
|
+ style: TextStyle(
|
|
|
|
+ fontWeight: FontWeight.bold, fontSize: 20),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
- ),
|
|
|
|
- // Total y Faltante
|
|
|
|
- Align(
|
|
|
|
- alignment: Alignment.centerRight,
|
|
|
|
- child: Column(
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
|
+ const SizedBox(height: 10),
|
|
|
|
+ // Efectivo
|
|
|
|
+ _buildPaymentMethodRow(
|
|
|
|
+ setState,
|
|
|
|
+ label: 'Efectivo',
|
|
|
|
+ selected: efectivoSeleccionado,
|
|
|
|
+ exactSelected: efectivoCompleto,
|
|
|
|
+ controller: efectivoController,
|
|
|
|
+ onSelected: (value) {
|
|
|
|
+ setState(() {
|
|
|
|
+ efectivoSeleccionado = value;
|
|
|
|
+ if (!efectivoSeleccionado) {
|
|
|
|
+ efectivoCompleto = false;
|
|
|
|
+ efectivoController.clear();
|
|
|
|
+ }
|
|
|
|
+ _calcularCambio(setState);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ onExactSelected: (value) {
|
|
|
|
+ setState(() {
|
|
|
|
+ efectivoCompleto = value;
|
|
|
|
+ if (efectivoCompleto) {
|
|
|
|
+ efectivoController.text =
|
|
|
|
+ totalPedido.toStringAsFixed(2);
|
|
|
|
+ efectivoSeleccionado = true;
|
|
|
|
+ tarjetaSeleccionada = false;
|
|
|
|
+ transferenciaSeleccionada = false;
|
|
|
|
+ tarjetaController.clear();
|
|
|
|
+ transferenciaController.clear();
|
|
|
|
+ } else {
|
|
|
|
+ efectivoController.clear();
|
|
|
|
+ }
|
|
|
|
+ _calcularCambio(setState);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ disableOtherMethods:
|
|
|
|
+ tarjetaCompleto || transferenciaCompleto,
|
|
|
|
+ onChangedMonto: () => _calcularCambio(setState),
|
|
|
|
+ ),
|
|
|
|
+ // Tarjeta
|
|
|
|
+ _buildPaymentMethodRow(
|
|
|
|
+ setState,
|
|
|
|
+ label: 'Tarjeta',
|
|
|
|
+ selected: tarjetaSeleccionada,
|
|
|
|
+ exactSelected: tarjetaCompleto,
|
|
|
|
+ controller: tarjetaController,
|
|
|
|
+ sinCambio: true,
|
|
|
|
+ onSelected: (value) {
|
|
|
|
+ setState(() {
|
|
|
|
+ tarjetaSeleccionada = value;
|
|
|
|
+ if (!tarjetaSeleccionada) {
|
|
|
|
+ tarjetaCompleto = false;
|
|
|
|
+ tarjetaController.clear();
|
|
|
|
+ }
|
|
|
|
+ _calcularCambio(setState);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ onExactSelected: (value) {
|
|
|
|
+ setState(() {
|
|
|
|
+ tarjetaCompleto = value;
|
|
|
|
+ if (tarjetaCompleto) {
|
|
|
|
+ tarjetaController.text =
|
|
|
|
+ totalPedido.toStringAsFixed(2);
|
|
|
|
+ tarjetaSeleccionada = true;
|
|
|
|
+ efectivoSeleccionado = false;
|
|
|
|
+ transferenciaSeleccionada = false;
|
|
|
|
+ efectivoController.clear();
|
|
|
|
+ transferenciaController.clear();
|
|
|
|
+ } else {
|
|
|
|
+ tarjetaController.clear();
|
|
|
|
+ }
|
|
|
|
+ _calcularCambio(setState);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ disableOtherMethods:
|
|
|
|
+ efectivoCompleto || transferenciaCompleto,
|
|
|
|
+ onChangedMonto: () => _calcularCambio(setState),
|
|
|
|
+ ),
|
|
|
|
+ // Transferencia
|
|
|
|
+ _buildPaymentMethodRow(
|
|
|
|
+ setState,
|
|
|
|
+ label: 'Transferencia',
|
|
|
|
+ selected: transferenciaSeleccionada,
|
|
|
|
+ exactSelected: transferenciaCompleto,
|
|
|
|
+ controller: transferenciaController,
|
|
|
|
+ sinCambio: true,
|
|
|
|
+ onSelected: (value) {
|
|
|
|
+ setState(() {
|
|
|
|
+ transferenciaSeleccionada = value;
|
|
|
|
+ if (!transferenciaSeleccionada) {
|
|
|
|
+ transferenciaCompleto = false;
|
|
|
|
+ transferenciaController.clear();
|
|
|
|
+ }
|
|
|
|
+ _calcularCambio(setState);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ onExactSelected: (value) {
|
|
|
|
+ setState(() {
|
|
|
|
+ transferenciaCompleto = value;
|
|
|
|
+ if (transferenciaCompleto) {
|
|
|
|
+ transferenciaController.text =
|
|
|
|
+ totalPedido.toStringAsFixed(2);
|
|
|
|
+ transferenciaSeleccionada = true;
|
|
|
|
+ efectivoSeleccionado = false;
|
|
|
|
+ tarjetaSeleccionada = false;
|
|
|
|
+ efectivoController.clear();
|
|
|
|
+ tarjetaController.clear();
|
|
|
|
+ } else {
|
|
|
|
+ transferenciaController.clear();
|
|
|
|
+ }
|
|
|
|
+ _calcularCambio(setState);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ disableOtherMethods:
|
|
|
|
+ efectivoCompleto || tarjetaCompleto,
|
|
|
|
+ onChangedMonto: () => _calcularCambio(setState),
|
|
|
|
+ ),
|
|
|
|
+ // Propina Expandable
|
|
|
|
+ ExpansionTile(
|
|
|
|
+ title: const Text(
|
|
|
|
+ 'Agregar Propina',
|
|
|
|
+ style: TextStyle(
|
|
|
|
+ fontSize: 18, fontWeight: FontWeight.bold),
|
|
|
|
+ ),
|
|
|
|
+ initiallyExpanded: propinaExpandida,
|
|
|
|
+ onExpansionChanged: (isExpanded) {
|
|
|
|
+ setState(() {
|
|
|
|
+ propinaExpandida = isExpanded;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
children: [
|
|
children: [
|
|
- Text(
|
|
|
|
- 'Total del pedido: \$${totalPedido.toStringAsFixed(2)}',
|
|
|
|
- style: const TextStyle(
|
|
|
|
- fontWeight: FontWeight.bold, fontSize: 18),
|
|
|
|
|
|
+ AppTextField(
|
|
|
|
+ separarMiles: true,
|
|
|
|
+ controller: _propinaCantidadController,
|
|
|
|
+ etiqueta: 'Propina',
|
|
|
|
+ hintText: '0.00',
|
|
|
|
+ keyboardType: TextInputType.number,
|
|
),
|
|
),
|
|
- if (faltante > 0)
|
|
|
|
- Text(
|
|
|
|
- 'Faltante: \$${faltante.toStringAsFixed(2)}',
|
|
|
|
- style: const TextStyle(
|
|
|
|
- color: Colors.red,
|
|
|
|
- fontSize: 18,
|
|
|
|
- fontWeight: FontWeight.bold),
|
|
|
|
- )
|
|
|
|
- else if (cambio > 0)
|
|
|
|
|
|
+ const SizedBox(height: 10),
|
|
|
|
+ AppTextField(
|
|
|
|
+ controller: _propinaComentarioController,
|
|
|
|
+ etiqueta: 'Comentario',
|
|
|
|
+ hintText: 'Comentario',
|
|
|
|
+ maxLines: 2,
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
|
|
+ const SizedBox(height: 10),
|
|
|
|
+ Align(
|
|
|
|
+ alignment: Alignment.centerRight,
|
|
|
|
+ child: Column(
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
+ children: [
|
|
Text(
|
|
Text(
|
|
- 'Cambio: \$${cambio.toStringAsFixed(2)}',
|
|
|
|
|
|
+ 'Total del pedido: \$${totalPedido.toStringAsFixed(2)}',
|
|
style: const TextStyle(
|
|
style: const TextStyle(
|
|
- color: Colors.green,
|
|
|
|
- fontSize: 18,
|
|
|
|
- fontWeight: FontWeight.bold),
|
|
|
|
|
|
+ fontWeight: FontWeight.bold, fontSize: 18),
|
|
),
|
|
),
|
|
- ],
|
|
|
|
|
|
+ if (faltante > 0)
|
|
|
|
+ Text(
|
|
|
|
+ 'Faltante: \$${faltante.toStringAsFixed(2)}',
|
|
|
|
+ style: const TextStyle(
|
|
|
|
+ color: Colors.red,
|
|
|
|
+ fontSize: 18,
|
|
|
|
+ fontWeight: FontWeight.bold),
|
|
|
|
+ )
|
|
|
|
+ else if (cambio > 0)
|
|
|
|
+ Text(
|
|
|
|
+ 'Cambio: \$${cambio.toStringAsFixed(2)}',
|
|
|
|
+ style: const TextStyle(
|
|
|
|
+ color: Colors.green,
|
|
|
|
+ fontSize: 18,
|
|
|
|
+ fontWeight: FontWeight.bold),
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
- ),
|
|
|
|
- ],
|
|
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
actions: [
|
|
actions: [
|
|
@@ -734,6 +773,8 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
tipoPago: _obtenerTipoPago(),
|
|
tipoPago: _obtenerTipoPago(),
|
|
estatus: "TERMINADO",
|
|
estatus: "TERMINADO",
|
|
);
|
|
);
|
|
|
|
+
|
|
|
|
+ await _guardarPropina(pedidoActual!.id!);
|
|
} else {
|
|
} else {
|
|
prepararPedidoActual(
|
|
prepararPedidoActual(
|
|
nombreController?.text ?? '',
|
|
nombreController?.text ?? '',
|
|
@@ -746,6 +787,29 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Future<void> _guardarPropina(int idPedido) async {
|
|
|
|
+ double? cantidad =
|
|
|
|
+ double.tryParse(_propinaCantidadController.text.replaceAll(',', '')) ??
|
|
|
|
+ 0.0;
|
|
|
|
+ String comentario = _propinaComentarioController.text.trim();
|
|
|
|
+
|
|
|
|
+ if (cantidad != null && cantidad > 0) {
|
|
|
|
+ Propinas nuevaPropina = Propinas(
|
|
|
|
+ idPedido: idPedido,
|
|
|
|
+ cantidad: cantidad,
|
|
|
|
+ comentario: comentario,
|
|
|
|
+ sincronizado: null,
|
|
|
|
+ creado: DateTime.now().toUtc(),
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ await Provider.of<PropinaViewModel>(context, listen: false)
|
|
|
|
+ .guardarPropina(nuevaPropina);
|
|
|
|
+ print('Propina guardada correctamente');
|
|
|
|
+ } else {
|
|
|
|
+ print('Propina no guardada (cantidad inválida)');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
Widget _buildPaymentMethodRow(
|
|
Widget _buildPaymentMethodRow(
|
|
StateSetter setState, {
|
|
StateSetter setState, {
|
|
required String label,
|
|
required String label,
|
|
@@ -756,6 +820,7 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
required Function(bool) onExactSelected,
|
|
required Function(bool) onExactSelected,
|
|
required bool disableOtherMethods,
|
|
required bool disableOtherMethods,
|
|
required Function() onChangedMonto,
|
|
required Function() onChangedMonto,
|
|
|
|
+ bool sinCambio = false,
|
|
}) {
|
|
}) {
|
|
return Row(
|
|
return Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
@@ -825,7 +890,16 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
etiqueta: 'Cantidad',
|
|
etiqueta: 'Cantidad',
|
|
hintText: '0.00',
|
|
hintText: '0.00',
|
|
keyboardType: TextInputType.number,
|
|
keyboardType: TextInputType.number,
|
|
- onChanged: (_) {
|
|
|
|
|
|
+ onChanged: (value) {
|
|
|
|
+ if (sinCambio) {
|
|
|
|
+ double? input = double.tryParse(value) ?? 0;
|
|
|
|
+ if (input > totalPedido) {
|
|
|
|
+ controller.text = totalPedido.toStringAsFixed(2);
|
|
|
|
+ controller.selection = TextSelection.fromPosition(
|
|
|
|
+ TextPosition(offset: controller.text.length),
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
onChangedMonto();
|
|
onChangedMonto();
|
|
},
|
|
},
|
|
),
|
|
),
|
|
@@ -868,6 +942,7 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
cantEfectivo: cantEfectivo,
|
|
cantEfectivo: cantEfectivo,
|
|
cantTarjeta: cantTarjeta,
|
|
cantTarjeta: cantTarjeta,
|
|
cantTransferencia: cantTransferencia,
|
|
cantTransferencia: cantTransferencia,
|
|
|
|
+ uuid: Uuid().v4(),
|
|
);
|
|
);
|
|
|
|
|
|
List<PedidoProducto> listaPedidoProducto = carrito.map((item) {
|
|
List<PedidoProducto> listaPedidoProducto = carrito.map((item) {
|
|
@@ -887,7 +962,7 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
producto: item.producto,
|
|
producto: item.producto,
|
|
costoUnitario: item.producto.precio.toString(),
|
|
costoUnitario: item.producto.precio.toString(),
|
|
cantidad: item.cantidad,
|
|
cantidad: item.cantidad,
|
|
- comentario: comentarios,
|
|
|
|
|
|
+ comentario: item.comentario,
|
|
toppings: selectedToppings,
|
|
toppings: selectedToppings,
|
|
);
|
|
);
|
|
}).toList();
|
|
}).toList();
|
|
@@ -1081,11 +1156,52 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
)
|
|
)
|
|
.toList(),
|
|
.toList(),
|
|
selectedValue: selectedDescuento,
|
|
selectedValue: selectedDescuento,
|
|
- onChanged: (value) {
|
|
|
|
- setState(() {
|
|
|
|
- selectedDescuento = value;
|
|
|
|
- _recalcularTotal();
|
|
|
|
- });
|
|
|
|
|
|
+ onChanged: (value) async {
|
|
|
|
+ if (value != null && value != selectedDescuento) {
|
|
|
|
+ // Guardar el valor anterior
|
|
|
|
+ final previousValue = selectedDescuento;
|
|
|
|
+
|
|
|
|
+ // Actualizar el descuento temporalmente
|
|
|
|
+ print('Descuento temporal seleccionado: $value');
|
|
|
|
+ setState(() {
|
|
|
|
+ selectedDescuento = value;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // Mostrar cuadro de confirmación
|
|
|
|
+ final authenticated = await showDialog<bool>(
|
|
|
|
+ context: context,
|
|
|
|
+ builder: (context) {
|
|
|
|
+ return TotpCuadroConfirmacion(
|
|
|
|
+ title: "Aplicar Descuento",
|
|
|
|
+ content:
|
|
|
|
+ "Por favor, ingresa el código de autenticación para continuar.",
|
|
|
|
+ onSuccess: () {
|
|
|
|
+ // Confirmación exitosa: recalcular total y actualizar UI
|
|
|
|
+ print(
|
|
|
|
+ 'Autenticación exitosa. Aplicando descuento...');
|
|
|
|
+ setState(() {
|
|
|
|
+ _recalcularTotal();
|
|
|
|
+ print('Descuento aplicado: $selectedDescuento');
|
|
|
|
+ print('Total recalculado: $totalPedido');
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ // Si la autenticación falla, revertir el descuento
|
|
|
|
+ if (authenticated != true) {
|
|
|
|
+ print(
|
|
|
|
+ 'Autenticación fallida. Revirtiendo descuento...');
|
|
|
|
+ setState(() {
|
|
|
|
+ selectedDescuento = previousValue;
|
|
|
|
+ _recalcularTotal(); // Recalcular con el valor anterior
|
|
|
|
+ print('Descuento revertido: $selectedDescuento');
|
|
|
|
+ print(
|
|
|
|
+ 'Total recalculado tras revertir: $totalPedido');
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
);
|
|
);
|
|
},
|
|
},
|
|
@@ -1197,34 +1313,73 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
|
|
|
|
return Column(
|
|
return Column(
|
|
children: [
|
|
children: [
|
|
- ListTile(
|
|
|
|
- title: Text(item.producto.nombre!,
|
|
|
|
- style: const TextStyle(fontWeight: FontWeight.w600)),
|
|
|
|
- subtitle: Text('\$${item.producto.precio}',
|
|
|
|
- style: const TextStyle(
|
|
|
|
- fontWeight: FontWeight.bold,
|
|
|
|
- color: Color(0xFF008000))),
|
|
|
|
- trailing: Row(
|
|
|
|
- mainAxisSize: MainAxisSize.min,
|
|
|
|
- children: [
|
|
|
|
- IconButton(
|
|
|
|
|
|
+ Row(
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
+ children: [
|
|
|
|
+ Expanded(
|
|
|
|
+ child: Column(
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
+ children: [
|
|
|
|
+ Text(item.producto.nombre!,
|
|
|
|
+ style: const TextStyle(
|
|
|
|
+ fontWeight: FontWeight.w600,
|
|
|
|
+ fontSize: 16)),
|
|
|
|
+ Text('\$${item.producto.precio}',
|
|
|
|
+ style: const TextStyle(
|
|
|
|
+ fontWeight: FontWeight.bold,
|
|
|
|
+ fontSize: 14,
|
|
|
|
+ color: Color(0xFF008000))),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ Row(
|
|
|
|
+ children: [
|
|
|
|
+ IconButton(
|
|
icon: const Icon(Icons.delete, color: Colors.red),
|
|
icon: const Icon(Icons.delete, color: Colors.red),
|
|
onPressed: () =>
|
|
onPressed: () =>
|
|
- eliminarProductoDelCarrito(index)),
|
|
|
|
- IconButton(
|
|
|
|
|
|
+ eliminarProductoDelCarrito(index),
|
|
|
|
+ ),
|
|
|
|
+ IconButton(
|
|
icon: const Icon(Icons.remove),
|
|
icon: const Icon(Icons.remove),
|
|
- onPressed: () => quitarProductoDelCarrito(item)),
|
|
|
|
- const SizedBox(width: 5),
|
|
|
|
- Text('${item.cantidad}',
|
|
|
|
- style: const TextStyle(
|
|
|
|
- fontWeight: FontWeight.bold, fontSize: 14)),
|
|
|
|
- const SizedBox(width: 5),
|
|
|
|
- IconButton(
|
|
|
|
|
|
+ onPressed: () => quitarProductoDelCarrito(item),
|
|
|
|
+ ),
|
|
|
|
+ Text('${item.cantidad}',
|
|
|
|
+ style: const TextStyle(
|
|
|
|
+ fontWeight: FontWeight.bold, fontSize: 14)),
|
|
|
|
+ IconButton(
|
|
icon: const Icon(Icons.add),
|
|
icon: const Icon(Icons.add),
|
|
- onPressed: () => incrementarProducto(item)),
|
|
|
|
- ],
|
|
|
|
- ),
|
|
|
|
|
|
+ onPressed: () => incrementarProducto(item),
|
|
|
|
+ ),
|
|
|
|
+ IconButton(
|
|
|
|
+ icon:
|
|
|
|
+ Icon(Icons.message, color: AppTheme.tertiary),
|
|
|
|
+ onPressed: () {
|
|
|
|
+ setState(() {
|
|
|
|
+ item.expandido = !item.expandido;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
),
|
|
),
|
|
|
|
+ if (item.expandido) ...[
|
|
|
|
+ const SizedBox(height: 5),
|
|
|
|
+ Padding(
|
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
|
|
+ child: TextField(
|
|
|
|
+ controller: item.comentarioController,
|
|
|
|
+ decoration: const InputDecoration(
|
|
|
|
+ hintText: 'Agregar un comentario...',
|
|
|
|
+ border: OutlineInputBorder(),
|
|
|
|
+ ),
|
|
|
|
+ maxLines: 2,
|
|
|
|
+ onChanged: (value) {
|
|
|
|
+ item.comentario = value.trim();
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
// ExpansionTile para todos los toppings
|
|
// ExpansionTile para todos los toppings
|
|
if (item.selectableToppings.isNotEmpty)
|
|
if (item.selectableToppings.isNotEmpty)
|
|
ExpansionTile(
|
|
ExpansionTile(
|
|
@@ -1390,6 +1545,50 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ void _mostrarDialogoComentario(
|
|
|
|
+ BuildContext context, ItemCarrito item, int index) {
|
|
|
|
+ TextEditingController comentarioController =
|
|
|
|
+ TextEditingController(text: carrito[index].comentario ?? '');
|
|
|
|
+
|
|
|
|
+ showDialog(
|
|
|
|
+ context: context,
|
|
|
|
+ builder: (BuildContext context) {
|
|
|
|
+ return AlertDialog(
|
|
|
|
+ title: const Text(
|
|
|
|
+ 'Comentario del Producto',
|
|
|
|
+ style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold),
|
|
|
|
+ ),
|
|
|
|
+ content: TextField(
|
|
|
|
+ controller: comentarioController,
|
|
|
|
+ maxLines: 3,
|
|
|
|
+ decoration: const InputDecoration(
|
|
|
|
+ hintText: 'Escribe un comentario...',
|
|
|
|
+ border: OutlineInputBorder(),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ actions: [
|
|
|
|
+ TextButton(
|
|
|
|
+ onPressed: () => Navigator.of(context).pop(),
|
|
|
|
+ child: const Text('Cancelar'),
|
|
|
|
+ ),
|
|
|
|
+ TextButton(
|
|
|
|
+ onPressed: () {
|
|
|
|
+ setState(() {
|
|
|
|
+ carrito[index].comentario = comentarioController.text.trim();
|
|
|
|
+ });
|
|
|
|
+ Navigator.of(context).pop();
|
|
|
|
+ ScaffoldMessenger.of(context).showSnackBar(
|
|
|
|
+ const SnackBar(content: Text('Comentario guardado')),
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ child: const Text('Guardar'),
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
void eliminarProductoDelCarrito(int index) async {
|
|
void eliminarProductoDelCarrito(int index) async {
|
|
bool autorizado = true;
|
|
bool autorizado = true;
|
|
|
|
|
|
@@ -1729,8 +1928,8 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
|
|
|
|
Widget _buildMesaSelector() {
|
|
Widget _buildMesaSelector() {
|
|
return FutureBuilder(
|
|
return FutureBuilder(
|
|
- future:
|
|
|
|
- Provider.of<MesaViewModel>(context, listen: false).fetchLocalAll(),
|
|
|
|
|
|
+ future: Provider.of<MesaViewModel>(context, listen: false)
|
|
|
|
+ .fetchLocalAll(sinLimite: true),
|
|
builder: (context, snapshot) {
|
|
builder: (context, snapshot) {
|
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
|
return const Center(child: CircularProgressIndicator());
|
|
return const Center(child: CircularProgressIndicator());
|
|
@@ -1739,6 +1938,8 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
List<Mesa> mesasDisponibles =
|
|
List<Mesa> mesasDisponibles =
|
|
Provider.of<MesaViewModel>(context, listen: false).mesas;
|
|
Provider.of<MesaViewModel>(context, listen: false).mesas;
|
|
|
|
|
|
|
|
+ TextEditingController mesaSearchController = TextEditingController();
|
|
|
|
+
|
|
return Padding(
|
|
return Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
|
|
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
|
|
child: Row(
|
|
child: Row(
|
|
@@ -1750,22 +1951,26 @@ class _PedidoFormState extends State<PedidoForm> {
|
|
),
|
|
),
|
|
const SizedBox(width: 16),
|
|
const SizedBox(width: 16),
|
|
Expanded(
|
|
Expanded(
|
|
- child: DropdownButtonFormField<int>(
|
|
|
|
- value: pedidoActual?.idMesa,
|
|
|
|
- items: mesasDisponibles.map((mesa) {
|
|
|
|
- return DropdownMenuItem<int>(
|
|
|
|
- value: mesa.id,
|
|
|
|
- child: Text(mesa.nombre ?? 'Sin Nombre'),
|
|
|
|
- );
|
|
|
|
- }).toList(),
|
|
|
|
- onChanged: (int? nuevaMesaId) {
|
|
|
|
|
|
+ child: AppDropdownSearch(
|
|
|
|
+ controller: mesaSearchController,
|
|
|
|
+ asyncItems: (String query) async {
|
|
|
|
+ await Provider.of<MesaViewModel>(context, listen: false)
|
|
|
|
+ .fetchLocalByName(nombre: query);
|
|
|
|
+ return Provider.of<MesaViewModel>(context, listen: false)
|
|
|
|
+ .mesas;
|
|
|
|
+ },
|
|
|
|
+ itemAsString: (dynamic mesa) =>
|
|
|
|
+ (mesa as Mesa).nombre ?? 'Sin Nombre',
|
|
|
|
+ selectedItem: mesasDisponibles.firstWhere(
|
|
|
|
+ (mesa) => mesa.id == pedidoActual?.idMesa,
|
|
|
|
+ orElse: () => null as Mesa,
|
|
|
|
+ ),
|
|
|
|
+ onChanged: (dynamic nuevaMesa) {
|
|
setState(() {
|
|
setState(() {
|
|
- pedidoActual?.idMesa = nuevaMesaId;
|
|
|
|
|
|
+ pedidoActual?.idMesa = (nuevaMesa as Mesa).id;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- decoration: const InputDecoration(
|
|
|
|
- border: OutlineInputBorder(),
|
|
|
|
- ),
|
|
|
|
|
|
+ items: mesasDisponibles,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
],
|