3 Коммиты 21623b7ccd ... 367b3ea017

Автор SHA1 Сообщение Дата
  BaLa 367b3ea017 se creo la pantalla de recojer месяцев назад: 2
  BaLa af4ae8e4f5 se agregaron widgets del carrito месяцев назад: 2
  BaLa b42608786d se agrego la ruta de recojer месяцев назад: 2

+ 2 - 0
lib/main.dart

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:provider/provider.dart';
 import 'package:sqflite_common_ffi/sqflite_ffi.dart';
+import 'package:turquessa_mesas_hoster/mvvm/views/home/carrito/Recojer_screen.dart';
 import 'package:turquessa_mesas_hoster/mvvm/views/home/carrito/carrito_screen.dart';
 import 'package:turquessa_mesas_hoster/mvvm/views/home/producto/producto_screen.dart';
 import 'dart:io';
@@ -87,6 +88,7 @@ class MyApp extends StatelessWidget {
         'producto': (context) =>
             ProductScreen(product: Product.staticSandwich()),
         'carrito': (context) => const CarritoScreen(),
+        'Recojer': (context) => const RecojerScreen(),
       },
     );
   }

+ 126 - 0
lib/mvvm/views/home/carrito/Recojer_screen.dart

@@ -0,0 +1,126 @@
+import 'package:flutter/material.dart';
+
+class RecojerScreen extends StatefulWidget {
+  const RecojerScreen({super.key});
+
+  @override
+  State<RecojerScreen> createState() => _parallevarScreenState();
+}
+
+class _parallevarScreenState extends State<RecojerScreen> {
+  String seleccionado = "";
+  final List<Map<String, dynamic>> items = [
+  {
+    'nombre': 'Hamburguesa de res',
+    'precio': '\$ 120.00',
+    'imageUrl':
+        'https://cdn.pixabay.com/photo/2016/03/05/19/02/hamburger-1238246_960_720.jpg',
+  },
+  {
+    'nombre': 'Hamburguesa de pollo',
+    'precio': '\$ 100.00',
+    'imageUrl':
+        'https://cdn.pixabay.com/photo/2016/03/05/19/02/hamburger-1238246_960_720.jpg',
+  },
+  {
+    'nombre': 'Hamburguesa de res',
+    'precio': '\$ 120.00',
+    'imageUrl':
+        'https://cdn.pixabay.com/photo/2016/03/05/19/02/hamburger-1238246_960_720.jpg',
+  },
+  {
+    'nombre': 'Hamburguesa de pollo',
+    'precio': '\$ 100.00',
+    'imageUrl':
+        'https://cdn.pixabay.com/photo/2016/03/05/19/02/hamburger-1238246_960_720.jpg',
+  },
+  {
+    'nombre': 'Hamburguesa de pollo',
+    'precio': '\$ 100.00',
+    'imageUrl':
+        'https://cdn.pixabay.com/photo/2016/03/05/19/02/hamburger-1238246_960_720.jpg',
+  },
+ ];
+
+
+  
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      backgroundColor: Colors.white,
+      appBar: AppBar(
+         actions: const [],
+        title: const Row(
+          mainAxisAlignment: MainAxisAlignment.spaceBetween,
+          children: [
+            Text('Atrás'),
+            Column(
+              children: [
+                Text(
+                  'Su carrito',
+                  style: TextStyle(fontSize: 17, color: Colors.black54),
+                ),
+                Text(
+                  style: TextStyle(fontSize: 20, fontWeight: FontWeight.w800),
+                  'MXN 69.00',
+                )
+              ],
+            )
+          ],
+        ),
+      ),
+      bottomNavigationBar: BottomAppBar(
+        height: 100,
+        color: Colors.transparent,
+        child: Padding(
+          padding: const EdgeInsets.all(10),
+          child: Row(
+            mainAxisAlignment: MainAxisAlignment.center,
+            children: [
+              TextButton(
+                style: TextButton.styleFrom(
+                  minimumSize: const Size(350, 50),
+                  backgroundColor: Colors.black,
+                  foregroundColor: Colors.white,
+                  shape: RoundedRectangleBorder(
+                  borderRadius: BorderRadius.circular(10),
+                  ),
+                ),
+                onPressed: (){},
+                child: const Row(
+                  children: [
+                    Padding(
+                      padding: EdgeInsets.only(left:8),
+                      child: Text(
+                        'Pedir (MXN 69.00)',
+                        textAlign: TextAlign.center,
+                        style: TextStyle(
+                          fontSize: 17,
+                        ),
+                      ),
+                    )
+                  ],
+                ),
+              ),
+              
+            ],
+          ),
+        ),
+      ),
+      body:
+       const Padding(
+        padding:  EdgeInsets.all(8.0),
+        child: Column(
+          children: [
+             Padding(
+              padding: EdgeInsets.all(5),
+            ),
+            Row(
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+            ),
+          ],
+        ),
+      ),
+    );
+  }
+}

+ 136 - 32
lib/mvvm/views/home/carrito/carrito_screen.dart

@@ -8,13 +8,28 @@ class CarritoScreen extends StatefulWidget {
 }
 
 class _CarritoScreenState extends State<CarritoScreen> {
+  int value = 1;
+
+  void increment(){
+    setState(() {
+      value++;
+      });
+  }
+
+  void decrement(){
+    setState(() {
+      if(value > 1){
+        value--;
+      }
+    });
+  }
   @override
   Widget build(BuildContext context) {
     return Scaffold(
       backgroundColor: Colors.white,
       appBar: AppBar(
-        actions: [],
-        title: const  Row(
+         actions: const [],
+        title: const Row(
           mainAxisAlignment: MainAxisAlignment.spaceBetween,
           children: [
             Text('Atrás'),
@@ -22,16 +37,10 @@ class _CarritoScreenState extends State<CarritoScreen> {
               children: [
                 Text(
                   'Su carrito',
-                  style:TextStyle(
-                    fontSize: 17,
-                    color: Colors.black54
-                  ),
+                  style: TextStyle(fontSize: 17, color: Colors.black54),
                 ),
                 Text(
-                  style: TextStyle(
-                    fontSize: 20,
-                    fontWeight: FontWeight.w800
-                  ),
+                  style: TextStyle(fontSize: 20, fontWeight: FontWeight.w800),
                   'MXN 69.00',
                 )
               ],
@@ -39,34 +48,129 @@ class _CarritoScreenState extends State<CarritoScreen> {
           ],
         ),
       ),
-      body: Column(
-        children:[ 
-          Row(
+      bottomNavigationBar: BottomAppBar(
+        height: 100,
+        color: Colors.transparent,
+        child: Padding(
+          padding: const EdgeInsets.all(10),
+          child: Row(
             mainAxisAlignment: MainAxisAlignment.spaceBetween,
             children: [
-              Image.network('https://cdn.pixabay.com/photo/2016/03/05/19/02/hamburger-1238246_960_720.jpg',
-              width: 100,
-              height: 100,
-              ),
-              
-             const Column (children: [
-              Text(
-                '1.HAMBURGUESA SENCILLA'
-              ),
-              Text(
-                style: TextStyle(
-                  fontWeight: FontWeight.bold,
+              TextButton(
+                style: TextButton.styleFrom(
+                  minimumSize: const Size(170, 200),
+                  backgroundColor: Colors.blue,
+                  foregroundColor: Colors.white,
+                  shape: RoundedRectangleBorder(
+                  borderRadius: BorderRadius.circular(10),
+                  ),
+                ),
+                onPressed: (){},
+                child: const Row(
+                  children: [
+                    Padding(
+                      padding: EdgeInsets.only(bottom: 3),
+                      child: Icon(Icons.fastfood_outlined),
+                    ),
+                    
+                    Padding(
+                      padding: EdgeInsets.only(left:8),
+                      child: Text('En el local'),
+                    )
+                  ],
                 ),
-                'MXN 115.00'
               ),
-          ],),
-              
-              
-              
-              
+              TextButton(
+                style: TextButton.styleFrom(
+                  minimumSize: const Size(170, 200),
+                  backgroundColor: Colors.blue,
+                  foregroundColor: Colors.white,
+                  shape: RoundedRectangleBorder(
+                    borderRadius: BorderRadius.circular(10),
+                  ),
+                ),
+                onPressed: (){
+                    Navigator.of(context).pushNamed('Recojer');
+
+                },
+                child: const Row(
+                  children: [
+                    Padding(
+                      padding: EdgeInsets.only(bottom: 3),
+                      child: Icon(Icons.shopping_bag_outlined),
+                    ),
+                    
+                    Padding(
+                      padding: EdgeInsets.only(left:8),
+                      child: Text('Para recojer'),
+                    )
+                  ],
+                ),
+              )
             ],
           ),
-        ],
+        ),
+      ),
+      body:
+      Padding(
+        padding: const EdgeInsets.all(8.0),
+        child: Column(
+          children: [
+            const Padding(
+              padding: EdgeInsets.all(5),
+            ),
+            Row(
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children:  [
+                ClipRRect(
+                  borderRadius: BorderRadius.circular(10),
+                  child: Image.network(
+                  'https://cdn.pixabay.com/photo/2016/03/05/19/02/hamburger-1238246_960_720.jpg',
+                  width: 80,
+                  height: 80,
+                  fit: BoxFit.cover,
+                )
+        
+                ),
+              
+                const Column(
+                  children: [
+                    Text('1.HAMBURGUESA SENCILLA'),
+                    Text(
+                        style: TextStyle(
+                          fontWeight: FontWeight.bold,
+                        ),
+                        'MXN 115.00'),
+                  ],
+                ),
+                Column(
+                  children: [
+                    Row(
+                      children: [
+                        IconButton(
+                          onPressed: increment,
+                          icon: const Icon(Icons.add),
+                          color: Colors.blue
+                        ),
+        
+                        Text(
+                          "$value"
+                        ),
+        
+                        IconButton(
+                          onPressed: decrement,
+                          icon: const Icon(Icons.remove),
+                          color: Colors.blue
+                        ),
+                      ],
+                    )
+                  ],
+                ),
+                
+              ],
+            ),
+          ],
+        ),
       ),
     );
   }