Curso Flutter App Restaurant con Carrito
Diseño de la pantalla Carta e implementación del menú Drawer
Creación de la Pantalla Carta y Menú Drawer o menu lateral en Flutter | CURSO DE FLUTTER APP RESTAURANT CON CARRITO DE COMPRA [Parte 4]
Diseño de la pantalla carta, es aqui donde nos centraremos en el menu lateral o drawer de nuestra aplicación básicamente crearemos un menú de navegación sencillo para desplazarse entre las diferentes pantallas de nuesta app. En resumen:
import 'package:flutter/material.dart';
class PantallaCarta extends StatefulWidget {
@override
_PantallaCartaState createState() => _PantallaCartaState();
}
class _PantallaCartaState extends State<PantallaCarta> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.amberAccent,
drawer: menuLateral(),
body: Container( ),
);
}
}
Veamos parte del código fuente del Menu Drawer en Flutter
class menuLateral extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Drawer(
child: ListView(
children: <Widget>[
UserAccountsDrawerHeader(
accountName: Text("TÍPIKA Restaurant"),
decoration: BoxDecoration(color: Colors.amber),
),
InkWell(
child: new ListTile(
title: Text(
"INICIO",
style: TextStyle(color: Colors.amberAccent),
),
leading: Icon(
Icons.home,
color: Colors.amber,
),
),
onTap: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (BuildContext) => PantallaInicio()));
},
),
InkWell(
child: new ListTile(
title: Text(
"CARTA",
style: TextStyle(color: Colors.amberAccent),
),
leading: Icon(
Icons.airplay,
color: Colors.amber,
),
),
onTap: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (BuildContext) => PantallaCarta()));
},
),
InkWell(
child: new ListTile(
title: Text(
"CARRITO",
style: TextStyle(color: Colors.amberAccent),
),
leading: Icon(
Icons.add_shopping_cart,
color: Colors.amber,
),
),
onTap: () {},
),
InkWell(
child: new ListTile(
title: Text(
"RESTAURANT",
style: TextStyle(color: Colors.amberAccent),
),
leading: Icon(
Icons.account_box,
color: Colors.amber,
),
),
onTap: () {},
)
],
),
);
}
}
1744 visitas
Sigue con el curso: Capítulo 5 – Tabs o secciones
Descarga el código fuente del proyecto adquiriendo el curso completo
Comprar© Todos los derechos reservados Codea App | ...de frente al código!!! | 2020 - 2023