Explorar el Código

Creacion Pedido Implementaciones de funcionalidad y cambios al disenio

c90Beretta hace 1 mes
padre
commit
be5653a1f4

+ 192 - 38
lib/mvvm/views/pedido/creacion_pedido_screen.dart

@@ -21,8 +21,8 @@ class _CreacionPedidoState extends State<CreacionPedido> {
               end: Alignment.topLeft,
               colors: [
             Color(0xFF7FD4D4),
-            Color(0xFFE5E5E5),
-            Color(0xFFFFFFFF),
+            Color.fromARGB(255, 141, 225, 225),
+            Color.fromARGB(255, 74, 156, 156),
           ])),
       child: Scaffold(
         backgroundColor: Colors.transparent,
@@ -35,53 +35,151 @@ class _CreacionPedidoState extends State<CreacionPedido> {
             Expanded(
               flex: 5,
               child: Container(
-                decoration: BoxDecoration(
-                  borderRadius: BorderRadius.circular(20),
+                decoration: const BoxDecoration(
                   color: Colors.white,
                 ),
-                child: Column(
+                child: const Column(
                   children: [
-                    const CategoryFilters(),
-                    Expanded(
-                      child: Container(
-                        padding: const EdgeInsets.all(8),
-                        child: GridView.builder(
-                          gridDelegate:
-                              const SliverGridDelegateWithFixedCrossAxisCount(
-                            crossAxisCount: 4,
-                            crossAxisSpacing: 10,
-                            mainAxisSpacing: 10,
-                          ),
-                          itemCount: 20,
-                          itemBuilder: (context, index) {
-                            return Container(
-                              decoration: BoxDecoration(
-                                color: Colors.grey.shade200,
-                                borderRadius: BorderRadius.circular(20),
-                              ),
-                              child: Center(
-                                child: Text(
-                                  'Item $index',
-                                  style: const TextStyle(fontSize: 20),
-                                ),
-                              ),
-                            );
-                          },
-                        ),
-                      ),
-                    ),
+                    CategoryFilters(),
+                    CategoryGrid(),
                   ],
                 ),
               ),
             ),
             Expanded(
-              flex: 3,
+              flex: 4,
               child: Container(
-                decoration: BoxDecoration(
-                  borderRadius: BorderRadius.circular(20),
+                decoration: const BoxDecoration(
                   color: Colors.white,
                 ),
-                child: const Text("test"),
+                child: Padding(
+                  padding: const EdgeInsets.all(8.0),
+                  child: Column(
+                    crossAxisAlignment: CrossAxisAlignment.start,
+                    children: [
+                      const Padding(
+                        padding: EdgeInsets.only(left: 10),
+                        child: Text(
+                          "Mesa 3: Palmeras",
+                          textAlign: TextAlign.start,
+                          style: TextStyle(
+                              fontSize: 40,
+                              fontWeight: FontWeight.bold,
+                              color: Colors.black),
+                        ),
+                      ),
+                      const Divider(),
+                      SingleChildScrollView(
+                        child: DataTable(
+                            columnSpacing: 10,
+                            dataRowMinHeight: 40,
+                            dataRowMaxHeight: 80,
+                            columns: <DataColumn>[
+                              const DataColumn(label: Text('Cant')),
+                              const DataColumn(label: Text('Nombre')),
+                              const DataColumn(label: Text('SubTotal')),
+                              const DataColumn(label: Text('Acciones')),
+                            ],
+                            rows: <DataRow>[
+                              DataRow(selected: true, cells: <DataCell>[
+                                const DataCell(Text('1')),
+                                const DataCell(Text('Mesa 1')),
+                                const DataCell(Text('\$100.00')),
+                                DataCell(IconButton(
+                                    icon: const Icon(Icons.pending_sharp),
+                                    onPressed: () {}))
+                              ]),
+                              DataRow(cells: <DataCell>[
+                                const DataCell(Text('1')),
+                                const DataCell(Text(
+                                    'Hamburguesa de Queso y Ahumado sin cebolla ni tomate')),
+                                const DataCell(Text("\$100.00")),
+                                DataCell(IconButton(
+                                    icon: const Icon(Icons.pending_sharp),
+                                    onPressed: () {}))
+                              ]),
+                              DataRow(cells: <DataCell>[
+                                const DataCell(Text('1')),
+                                const DataCell(Text(
+                                    'Hamburguesa de Queso y Ahumado sin cebolla ni tomate')),
+                                const DataCell(Text("\$100.00")),
+                                DataCell(IconButton(
+                                    icon: const Icon(Icons.pending_sharp),
+                                    onPressed: () {}))
+                              ]),
+                              DataRow(cells: <DataCell>[
+                                const DataCell(Text('1')),
+                                const DataCell(Text(
+                                    'Hamburguesa de Queso y Ahumado sin cebolla ni tomate')),
+                                const DataCell(Text("\$100.00")),
+                                DataCell(IconButton(
+                                    icon: const Icon(Icons.pending_sharp),
+                                    onPressed: () {}))
+                              ]),
+                            ]),
+                      ),
+                      Expanded(
+                        child: Column(
+                          children: [
+                            const Divider(),
+                            const Row(
+                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                              children: [
+                                Text(
+                                  "Total",
+                                  style: TextStyle(
+                                      fontSize: 20,
+                                      fontWeight: FontWeight.bold),
+                                ),
+                                Text(
+                                  "\$300.00",
+                                  style: TextStyle(
+                                      fontSize: 20,
+                                      fontWeight: FontWeight.bold),
+                                ),
+                              ],
+                            ),
+                            const SizedBox(height: 10),
+                            Row(
+                              children: [
+                                Expanded(
+                                  flex: 9,
+                                  child: ElevatedButton(
+                                    style: const ButtonStyle(
+                                      backgroundColor: MaterialStatePropertyAll(
+                                          Colors.green),
+                                    ),
+                                    onPressed: () {},
+                                    child: const Text(
+                                      "Mandar a Preparacion",
+                                      style: TextStyle(color: Colors.white),
+                                    ),
+                                  ),
+                                ),
+                                Expanded(
+                                  flex: 1,
+                                  child: IconButton(
+                                    style: const ButtonStyle(
+                                        backgroundColor:
+                                            MaterialStatePropertyAll(
+                                                Colors.white),
+                                        iconColor: MaterialStatePropertyAll(
+                                            Colors.red)),
+                                    icon: const Icon(
+                                      Icons.delete,
+                                      color: Colors.red,
+                                    ),
+                                    onPressed: () {},
+                                  ),
+                                ),
+                              ],
+                            )
+                          ],
+                        ),
+                      )
+                    ],
+                  ),
+                ),
               ),
             )
           ],
@@ -91,6 +189,62 @@ class _CreacionPedidoState extends State<CreacionPedido> {
   }
 }
 
+class CategoryGrid extends StatelessWidget {
+  const CategoryGrid({
+    super.key,
+  });
+
+  @override
+  Widget build(BuildContext context) {
+    return Expanded(
+      child: Container(
+        padding: const EdgeInsets.all(8),
+        child: GridView.builder(
+          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
+            crossAxisCount: 4,
+            crossAxisSpacing: 10,
+            mainAxisSpacing: 15,
+          ),
+          itemCount: 20,
+          itemBuilder: (context, index) {
+            return Card(
+              shadowColor: Colors.grey.shade700,
+              surfaceTintColor: Colors.white,
+              child: Column(children: [
+                Padding(
+                  padding: const EdgeInsets.all(3),
+                  child: Container(
+                    height: 80,
+                    width: double.infinity,
+                    decoration: BoxDecoration(
+                      color: Colors.white,
+                      image: DecorationImage(
+                        image: NetworkImage(
+                            "https://picsum.photos/200/300?random=$index"),
+                        fit: BoxFit.cover,
+                      ),
+                    ),
+                  ),
+                ),
+                Center(
+                  child: Text(
+                    "Producto $index",
+                    style: const TextStyle(
+                        fontWeight: FontWeight.bold,
+                        fontSize: 16,
+                        color: Colors.black),
+                  ),
+                ),
+                const Text("Precio: \$50.00")
+              ]),
+            );
+          },
+        ),
+      ),
+    );
+  }
+}
+
 class CategoryFilters extends StatefulWidget {
   const CategoryFilters({super.key});
 

+ 2 - 0
lib/utils/widgets/navigation_rail.dart

@@ -15,6 +15,8 @@ class Custom_NavigationRailState extends State<CustomNavigationRail> {
   @override
   Widget build(BuildContext context) {
     return NavigationRail(
+      minExtendedWidth: 100,
+      minWidth: 30,
       backgroundColor: Color.fromARGB(255, 25, 30, 41),
       selectedIndex: selectedIndex,
       onDestinationSelected: (int index) {