|
@@ -40,61 +40,81 @@ class Formulario extends State<HomeScreen> {
|
|
appBar: AppBar(
|
|
appBar: AppBar(
|
|
title: const CustomAppbar(),
|
|
title: const CustomAppbar(),
|
|
),
|
|
),
|
|
- body: Row(
|
|
|
|
- children: [
|
|
|
|
- CustomNavigationRail(selectedIndex: _selectedIndex),
|
|
|
|
- Expanded(
|
|
|
|
- child: Center(
|
|
|
|
- child: GridView.builder(
|
|
|
|
- gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
- crossAxisCount: 4,
|
|
|
|
- childAspectRatio: 1.0,
|
|
|
|
- crossAxisSpacing: 10.0,
|
|
|
|
- mainAxisSpacing: 10.0,
|
|
|
|
- ),
|
|
|
|
- padding: const EdgeInsets.all(10),
|
|
|
|
- itemCount: mesaViewModel.mesas.length,
|
|
|
|
- itemBuilder: (context, index) {
|
|
|
|
- final mesa = mesaViewModel.mesas[index];
|
|
|
|
- return GestureDetector(
|
|
|
|
- onTap: () {
|
|
|
|
- setState(() {
|
|
|
|
- mesaViewModel.selectMesa(mesa);
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- child: TableCard(
|
|
|
|
- mesa: mesa,
|
|
|
|
- ),
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
|
|
+ body: Container(
|
|
|
|
+ decoration: const BoxDecoration(
|
|
|
|
+ gradient: LinearGradient(
|
|
|
|
+ begin: Alignment.topCenter,
|
|
|
|
+ end: Alignment.bottomCenter,
|
|
|
|
+ colors: [
|
|
|
|
+ Color(0xFFE0F7FA),
|
|
|
|
+ Color(0xFFB2EBF2),
|
|
|
|
+ Color(0xFF80DEEA),
|
|
|
|
+ Color(0xFF4DD0E1),
|
|
|
|
+ ],
|
|
),
|
|
),
|
|
- if (mesaViewModel.selectedMesa != null)
|
|
|
|
|
|
+ ),
|
|
|
|
+ child: Row(
|
|
|
|
+ children: [
|
|
|
|
+ CustomNavigationRail(selectedIndex: _selectedIndex),
|
|
Expanded(
|
|
Expanded(
|
|
|
|
+ child: Center(
|
|
child: Container(
|
|
child: Container(
|
|
- margin: const EdgeInsets.all(10),
|
|
|
|
- decoration: BoxDecoration(
|
|
|
|
- color: Colors.white,
|
|
|
|
- borderRadius: BorderRadius.circular(10),
|
|
|
|
- boxShadow: [
|
|
|
|
- BoxShadow(
|
|
|
|
- color: Colors.grey.withOpacity(0.2),
|
|
|
|
- blurRadius: 5,
|
|
|
|
- spreadRadius: 1,
|
|
|
|
- )
|
|
|
|
- ],
|
|
|
|
|
|
+ decoration: const BoxDecoration(
|
|
|
|
+ color: Colors.white,
|
|
|
|
+ ),
|
|
|
|
+ child: GridView.builder(
|
|
|
|
+ gridDelegate:
|
|
|
|
+ const SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
+ crossAxisCount: 4,
|
|
|
|
+ childAspectRatio: 1.0,
|
|
|
|
+ crossAxisSpacing: 10.0,
|
|
|
|
+ mainAxisSpacing: 10.0,
|
|
|
|
+ ),
|
|
|
|
+ padding: const EdgeInsets.all(10),
|
|
|
|
+ itemCount: mesaViewModel.mesas.length,
|
|
|
|
+ itemBuilder: (context, index) {
|
|
|
|
+ final mesa = mesaViewModel.mesas[index];
|
|
|
|
+ return GestureDetector(
|
|
|
|
+ onTap: () {
|
|
|
|
+ setState(() {
|
|
|
|
+ mesaViewModel.selectMesa(mesa);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ child: TableCard(
|
|
|
|
+ mesa: mesa,
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
- child: TablaDetalles(
|
|
|
|
- status: EstadoPedido.disponible,
|
|
|
|
- table: mesaViewModel.selectedMesa ??
|
|
|
|
- Mesa(
|
|
|
|
- activa: false,
|
|
|
|
- id: 0,
|
|
|
|
- nombre: 'Mesa sin nombre',
|
|
|
|
- estado: EstadoPedido.disponible)),
|
|
|
|
- )),
|
|
|
|
- ],
|
|
|
|
|
|
+ ),
|
|
|
|
+ if (mesaViewModel.selectedMesa != null)
|
|
|
|
+ Expanded(
|
|
|
|
+ child: Container(
|
|
|
|
+ margin: const EdgeInsets.symmetric(horizontal: 10),
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
+ color: Colors.white,
|
|
|
|
+ borderRadius: BorderRadius.circular(10),
|
|
|
|
+ boxShadow: [
|
|
|
|
+ BoxShadow(
|
|
|
|
+ color: Colors.grey.withOpacity(0.2),
|
|
|
|
+ blurRadius: 5,
|
|
|
|
+ spreadRadius: 1,
|
|
|
|
+ )
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
|
|
+ child: TablaDetalles(
|
|
|
|
+ status: EstadoPedido.disponible,
|
|
|
|
+ table: mesaViewModel.selectedMesa ??
|
|
|
|
+ Mesa(
|
|
|
|
+ activa: false,
|
|
|
|
+ id: 0,
|
|
|
|
+ nombre: 'Mesa sin nombre',
|
|
|
|
+ estado: EstadoPedido.disponible)),
|
|
|
|
+ )),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
);
|
|
);
|
|
}
|
|
}
|
|
@@ -113,10 +133,9 @@ class TablaDetalles extends StatelessWidget {
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
return Container(
|
|
- margin: const EdgeInsets.all(10),
|
|
|
|
|
|
+ padding: const EdgeInsets.all(10),
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
color: Colors.white,
|
|
- borderRadius: BorderRadius.circular(10),
|
|
|
|
boxShadow: [
|
|
boxShadow: [
|
|
BoxShadow(
|
|
BoxShadow(
|
|
color: Colors.grey.withOpacity(0.2),
|
|
color: Colors.grey.withOpacity(0.2),
|
|
@@ -175,7 +194,7 @@ class TablaDetalles extends StatelessWidget {
|
|
Expanded(
|
|
Expanded(
|
|
child: SingleChildScrollView(
|
|
child: SingleChildScrollView(
|
|
child: Padding(
|
|
child: Padding(
|
|
- padding: const EdgeInsets.all(16),
|
|
|
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
child: Column(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
children: [
|
|
@@ -196,10 +215,21 @@ class TablaDetalles extends StatelessWidget {
|
|
),
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
- const SizedBox(height: 16),
|
|
|
|
|
|
+ // const SizedBox(height: 16),
|
|
// IconDataByStatus(status: status),
|
|
// IconDataByStatus(status: status),
|
|
const SizedBox(height: 16),
|
|
const SizedBox(height: 16),
|
|
- OrdenesScreen(),
|
|
|
|
|
|
+ IconButton.outlined(
|
|
|
|
+ style: const ButtonStyle(
|
|
|
|
+ backgroundColor:
|
|
|
|
+ MaterialStatePropertyAll(Colors.lightGreen)),
|
|
|
|
+ onPressed: () {
|
|
|
|
+ Navigator.of(context).pushNamed('creacion-pedido');
|
|
|
|
+ },
|
|
|
|
+ icon: const Icon(
|
|
|
|
+ Icons.start_rounded,
|
|
|
|
+ color: Colors.white,
|
|
|
|
+ ))
|
|
|
|
+ // const OrdenesScreen(),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|