Actividad 5 home

parent 568a3cdb
import 'package:flutter/material.dart';
import 'package:practica1_flutter/src/pages/home_page.dart';
class ArticlesPage extends StatelessWidget {
const ArticlesPage({Key? key}) : super(key: key);
......
import 'package:flutter/material.dart';
import 'package:practica1_flutter/src/pages/articles_page.dart';
class HomeSellerPage extends StatelessWidget {
const HomeSellerPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
return DefaultTabController(// Agrega un DefaultTabController para manejar el estado de las pestañas.
length: 2, // Define el número de pestañas.
child: MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Estoy en Home',
theme: ThemeData(
primaryColor: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
title: Text('Estoy en Home'),
backgroundColor: Colors.green,
title: const Text("ShopMaster"),
bottom: const TabBar( // Agrega el TabBar en la parte inferior de la AppBar.
tabs: [
Tab(icon: Icon(Icons.article_outlined), text: "Articulos"),
Tab(icon: Icon(Icons.shop_2), text: "Ventas"),
],
),
),
drawer: MenuLateral(),
body: Center(
child: ElevatedButton(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
/*ElevatedButton(
onPressed: () {
// Navega a la página 'homePage' cuando se presiona el botón.
Navigator.pushNamed(context, 'articulos');
},
child: Text('Avanzar a Articulos'),
child: const Text('Acceder a articulos -->'),
),*/
const SizedBox(height: 200),
FloatingActionButton(
onPressed: () {
},
child: Icon(Icons.add),
tooltip: 'Agregar Categoría',//Mensaje
),
],
),
),
),
),
);
}
}
//Clase del meuno lateral
class MenuLateral extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Drawer(
child: ListView(
children: [
const UserAccountsDrawerHeader(
accountName: Text("Mi cuenta"),
accountEmail: Text("Prueba@gmail.com"),
),
Ink(
color: Colors.indigo, // Cambiar color de cada menú.
child: ListTile(
title: const Text("Menu 1", style: TextStyle(color: Colors.white)),
),
),
const ListTile(
title: Text("Menu 2"),
),
const ListTile(
title: Text("Menu 2"),
),
],
),
);
}
}
import 'package:flutter/material.dart';
class LoginPage extends StatefulWidget {
class LoginPage extends StatelessWidget {
const LoginPage({Key? key}) : super(key: key);
@override
_LoginPageState createState() => _LoginPageState();
}
class _LoginPageState extends State<LoginPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Iniciar sesión'),
backgroundColor: Colors.lightBlue,
actions: const [
Icon(Icons.search),
Icon(Icons.menu),
],
title: const Text('Estoy en Login'),
backgroundColor: Colors.lightBlue, // Agregar color en la appBar
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Center(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset('assets/img/logo_visorus.jpg'),
const SizedBox(height: 20),
Image.asset('assets/img/logo_visorus.jpg', height: 100),
const SizedBox(height: 20),//Espacio entre la imagen y campo de texto
//Campo de Usuario
TextField(
Padding(
padding: const EdgeInsets.symmetric(horizontal: 80.0), // añado mi margen horizontal
child: TextField(
decoration: const InputDecoration(
labelText: 'Usuario',
border: OutlineInputBorder(),
),
),
),
const SizedBox(height: 20),
//Campo de contraseña
TextField(
Padding(
padding: const EdgeInsets.symmetric(horizontal: 80.0), // Añado mi margen horizontal
child: TextField(
decoration: const InputDecoration(
labelText: 'Contraseña',
border: OutlineInputBorder(),
),
obscureText: true,
),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, 'homeSeller');
......@@ -56,7 +49,7 @@ class _LoginPageState extends State<LoginPage> {
],
),
),
),
);
}
}
......@@ -31,8 +31,6 @@ environment:
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.6
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment