Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
Practica_Flutter_E
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Efren David Jimenez Martinez
Practica_Flutter_E
Commits
532fbac5
Commit
532fbac5
authored
Jul 31, 2024
by
Efren David Jimenez Martinez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Actividad 5 home
parent
568a3cdb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
96 additions
and
44 deletions
+96
-44
categoria.dart
lib/model/categoria.dart
+0
-0
articles_page.dart
lib/src/pages/articles_page.dart
+1
-1
home_page.dart
lib/src/pages/home_page.dart
+73
-12
login_page.dart
lib/src/pages/login_page.dart
+22
-29
pubspec.yaml
pubspec.yaml
+0
-2
No files found.
lib/model/categoria.dart
0 → 100644
View file @
532fbac5
lib/src/pages/articles_page.dart
View file @
532fbac5
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:practica1_flutter/src/pages/home_page.dart'
;
class
ArticlesPage
extends
StatelessWidget
{
class
ArticlesPage
extends
StatelessWidget
{
const
ArticlesPage
({
Key
?
key
})
:
super
(
key:
key
);
const
ArticlesPage
({
Key
?
key
})
:
super
(
key:
key
);
...
...
lib/src/pages/home_page.dart
View file @
532fbac5
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:practica1_flutter/src/pages/articles_page.dart'
;
class
HomeSellerPage
extends
StatelessWidget
{
class
HomeSellerPage
extends
StatelessWidget
{
const
HomeSellerPage
({
Key
?
key
})
:
super
(
key:
key
);
const
HomeSellerPage
({
Key
?
key
})
:
super
(
key:
key
);
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
DefaultTabController
(
// Agrega un DefaultTabController para manejar el estado de las pestañas.
appBar:
AppBar
(
length:
2
,
// Define el número de pestañas.
title:
Text
(
'Estoy en Home'
),
child:
MaterialApp
(
backgroundColor:
Colors
.
green
,
debugShowCheckedModeBanner:
false
,
),
title:
'Estoy en Home'
,
body:
Center
(
theme:
ThemeData
(
child:
ElevatedButton
(
primaryColor:
Colors
.
blue
,
onPressed:
()
{
),
// Navega a la página 'homePage' cuando se presiona el botón.
home:
Scaffold
(
Navigator
.
pushNamed
(
context
,
'articulos'
);
appBar:
AppBar
(
},
title:
const
Text
(
"ShopMaster"
),
child:
Text
(
'Avanzar a Articulos'
),
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:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
/*ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, '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"
),
),
],
),
);
}
}
lib/src/pages/login_page.dart
View file @
532fbac5
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
class
LoginPage
extends
State
ful
Widget
{
class
LoginPage
extends
State
less
Widget
{
const
LoginPage
({
Key
?
key
})
:
super
(
key:
key
);
const
LoginPage
({
Key
?
key
})
:
super
(
key:
key
);
@override
@override
_LoginPageState
createState
()
=>
_LoginPageState
();
}
class
_LoginPageState
extends
State
<
LoginPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
appBar:
AppBar
(
appBar:
AppBar
(
title:
const
Text
(
'Iniciar sesión'
),
title:
const
Text
(
'Estoy en Login'
),
backgroundColor:
Colors
.
lightBlue
,
backgroundColor:
Colors
.
lightBlue
,
// Agregar color en la appBar
actions:
const
[
Icon
(
Icons
.
search
),
Icon
(
Icons
.
menu
),
],
),
),
body:
Padding
(
body:
Center
(
padding:
const
EdgeInsets
.
all
(
16.0
),
child:
Column
(
child:
Center
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
child:
Column
(
children:
[
mainAxisAlignment:
MainAxisAlignment
.
center
,
Image
.
asset
(
'assets/img/logo_visorus.jpg'
,
height:
100
),
children:
[
const
SizedBox
(
height:
20
),
//Espacio entre la imagen y campo de texto
Image
.
asset
(
'assets/img/logo_visorus.jpg'
),
const
SizedBox
(
height:
20
),
//Campo de Usuario
Padding
(
TextField
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
80.0
),
// añado mi margen horizontal
child:
TextField
(
decoration:
const
InputDecoration
(
decoration:
const
InputDecoration
(
labelText:
'Usuario'
,
labelText:
'Usuario'
,
border:
OutlineInputBorder
(),
border:
OutlineInputBorder
(),
),
),
),
),
const
SizedBox
(
height:
20
),
),
const
SizedBox
(
height:
20
),
//Campo de contraseña
Padding
(
TextField
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
80.0
),
// Añado mi margen horizontal
child:
TextField
(
decoration:
const
InputDecoration
(
decoration:
const
InputDecoration
(
labelText:
'Contraseña'
,
labelText:
'Contraseña'
,
border:
OutlineInputBorder
(),
border:
OutlineInputBorder
(),
),
),
obscureText:
true
,
obscureText:
true
,
),
),
const
SizedBox
(
height:
20
),
),
const
SizedBox
(
height:
20
),
ElevatedButton
(
ElevatedButton
(
onPressed:
()
{
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'homeSeller'
);
Navigator
.
pushNamed
(
context
,
'homeSeller'
);
},
},
child:
const
Text
(
'Acceder'
),
child:
const
Text
(
'Acceder'
),
),
),
],
],
),
),
),
),
),
);
);
}
}
}
}
pubspec.yaml
View file @
532fbac5
...
@@ -31,8 +31,6 @@ environment:
...
@@ -31,8 +31,6 @@ environment:
dependencies
:
dependencies
:
flutter
:
flutter
:
sdk
:
flutter
sdk
:
flutter
# The following adds the Cupertino Icons font to your application.
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons
:
^1.0.6
cupertino_icons
:
^1.0.6
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment