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
24fadfa6
Commit
24fadfa6
authored
Jul 31, 2024
by
Efren David Jimenez Martinez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Subiendo actividades
parent
48bb5d54
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
84 additions
and
112 deletions
+84
-112
logo_visorus.jpg
assets/img/logo_visorus.jpg
+0
-0
main.dart
lib/main.dart
+16
-17
routes.dart
lib/src/config/routes.dart
+10
-6
articles_page.dart
lib/src/pages/articles_page.dart
+15
-15
home_page.dart
lib/src/pages/home_page.dart
+15
-38
login_page.dart
lib/src/pages/login_page.dart
+25
-35
pubspec.yaml
pubspec.yaml
+3
-1
No files found.
assets/img/logo_visorus.jpg
0 → 100644
View file @
24fadfa6
4.34 KB
lib/main.dart
View file @
24fadfa6
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:practica1_flutter/src/config/routes.dart'
;
import
'package:practica1_flutter/src/config/routes.dart'
;
// Importa el archivo de rutas
void
main
(
)
{
void
main
(
)
{
runApp
(
const
MyApp
());
runApp
(
const
MyApp
());
...
@@ -13,34 +15,31 @@ class MyApp extends StatelessWidget {
...
@@ -13,34 +15,31 @@ class MyApp extends StatelessWidget {
debugShowCheckedModeBanner:
false
,
debugShowCheckedModeBanner:
false
,
title:
'Flutter Demo'
,
title:
'Flutter Demo'
,
theme:
ThemeData
(
theme:
ThemeData
(
colorScheme:
ColorScheme
.
fromSeed
(
seedColor:
Colors
.
deepPurple
),
colorScheme:
ColorScheme
.
fromSeed
(
seedColor:
Colors
.
deepPurple
),
useMaterial3:
true
,
useMaterial3:
true
,
),
),
home:
myWidget
(),
//home: myWidget() : Se quita la propiedad home para permitir la navegación basada en rutas
initialRoute:
'login'
,
// se define la ruta inicial
routes:
getApplicationRoutes
(),
// Se usa las rutas definidas en routes.dart y se quito el myWidget
);
);
}
}
}
}
class
m
yWidget
extends
StatelessWidget
{
class
M
yWidget
extends
StatelessWidget
{
const
m
yWidget
({
super
.
key
});
const
M
yWidget
({
super
.
key
});
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
//child: Text("Hola mundo")
appBar:
AppBar
(
// Barra que se encuentra en la parte superior
appBar:
AppBar
(
//Barra que se encuentra en la parte superior
title:
Text
(
"Prueba flutter estamo en el main "
),
// Agregar titulo en appBar
title:
Text
(
"Prueba AppBarsss"
),
//Agregar titulo en appBar
backgroundColor:
Colors
.
lightBlue
,
// Agregar color en la appBar
backgroundColor:
Colors
.
lightBlue
,
//Agregar color en la appBar
actions:
const
[
// Agregar iconos
actions:
const
[
//Agregar iconos
Icon
(
Icons
.
search
),
Icon
(
Icons
.
search
),
Icon
(
Icons
.
menu
)
Icon
(
Icons
.
menu
)
],
],
),
),
body:
Column
(
children:
[]),
// Va a tener varios hijos
body:
Column
(
children:
[]),
//Va a tener varios hijos
);
);
}
}
}
}
lib/src/config/routes.dart
View file @
24fadfa6
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:practica1_flutter/src/config/routes.dart'
;
import
'../pages/home_page.dart'
;
import
'../pages/login_page.dart'
;
import
'../pages/articles_page.dart'
;
Map
<
String
,
WidgetBuilder
>
getApplicationRoutes
(){
Map
<
String
,
WidgetBuilder
>
getApplicationRoutes
()
{
return
<
String
,
WidgetBuilder
>{
return
<
String
,
WidgetBuilder
>{
'login'
:
(
context
)=>
const
LoginPage
(),
'login'
:
(
BuildContext
context
)
=>
const
LoginPage
(),
'homeSeller'
:
(
context
)=>
const
HomeSellerPage
(),
'homeSeller'
:
(
BuildContext
context
)
=>
const
HomeSellerPage
(),
'articulos'
:
(
BuildContext
context
)
=>
const
ArticlesPage
(),
};
};
}
}
\ No newline at end of file
lib/src/pages/articles_page.dart
View file @
24fadfa6
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
void
main
(
)
{
class
ArticlesPage
extends
StatelessWidget
{
runApp
(
const
MyApp
());
const
ArticlesPage
({
Key
?
key
})
:
super
(
key:
key
);
}
class
MyApp
extends
StatelessWidget
{
const
MyApp
({
super
.
key
});
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
return
Scaffold
(
debugShowCheckedModeBanner:
false
,
appBar:
AppBar
(
title:
'hola articles page '
,
title:
Text
(
'Estoy en Articulos'
),
theme:
ThemeData
(
backgroundColor:
Colors
.
red
,
actions:
[
colorScheme:
ColorScheme
.
fromSeed
(
seedColor:
Colors
.
deepPurple
),
Center
(
useMaterial3:
true
,
child:
const
Icon
(
Icons
.
shop
),
)
],
),
body:
Center
(
child:
Text
(
'Bienvenido a los articulos'
),
),
),
);
);
}
}
}
}
\ No newline at end of file
lib/src/pages/home_page.dart
View file @
24fadfa6
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
void
main
(
)
{
class
HomeSellerPage
extends
StatelessWidget
{
runApp
(
const
MyApp
());
const
HomeSellerPage
({
Key
?
key
})
:
super
(
key:
key
);
}
class
MyApp
extends
StatelessWidget
{
const
MyApp
({
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
title:
'Flutter Demo'
,
theme:
ThemeData
(
colorScheme:
ColorScheme
.
fromSeed
(
seedColor:
Colors
.
deepPurple
),
useMaterial3:
true
,
),
home:
myWidget
(),
);
}
}
class
myWidget
extends
StatelessWidget
{
const
myWidget
({
super
.
key
});
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
//child: Text("Hola mundo")
appBar:
AppBar
(
appBar:
AppBar
(
//Barra que se encuentra en la parte superior
title:
Text
(
'Estoy en Home'
),
title:
Text
(
"hola mundo home page "
),
//Agregar titulo en appBar
backgroundColor:
Colors
.
green
,
backgroundColor:
Colors
.
lightBlue
,
//Agregar color en la appBar
),
actions:
const
[
//Agregar iconos
body:
Center
(
Icon
(
Icons
.
search
),
child:
ElevatedButton
(
Icon
(
Icons
.
menu
)
onPressed:
()
{
],
// Navega a la página 'homePage' cuando se presiona el botón.
Navigator
.
pushNamed
(
context
,
'articulos'
);
},
child:
Text
(
'Avanzar a Articulos'
),
),
),
),
body:
Column
(
children:
[]),
//Va a tener varios hijos
);
);
}
}
}
}
\ No newline at end of file
lib/src/pages/login_page.dart
View file @
24fadfa6
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
void
main
(
)
{
class
LoginPage
extends
StatelessWidget
{
runApp
(
const
MyApp
());
const
LoginPage
({
Key
?
key
})
:
super
(
key:
key
);
}
class
MyApp
extends
StatelessWidget
{
const
MyApp
({
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
title:
'Flutter Demo'
,
theme:
ThemeData
(
colorScheme:
ColorScheme
.
fromSeed
(
seedColor:
Colors
.
deepPurple
),
useMaterial3:
true
,
),
home:
myWidget
(),
);
}
}
class
myWidget
extends
StatelessWidget
{
const
myWidget
({
super
.
key
});
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
//child: Text("Hola mundo")
appBar:
AppBar
(
appBar:
AppBar
(
//Barra que se encuentra en la parte superior
title:
const
Text
(
'Estoy en Login'
),
title:
Text
(
"Hola mundo login page"
),
//Agregar titulo en appBar
backgroundColor:
Colors
.
lightBlue
,
// Agregar color en la appBar
backgroundColor:
Colors
.
lightBlue
,
//Agregar color en la appBar
actions:
const
[
// Agregar iconos
actions:
const
[
//Agregar iconos
Icon
(
Icons
.
search
),
Icon
(
Icons
.
search
),
Icon
(
Icons
.
menu
)
Icon
(
Icons
.
menu
)
,
],
],
),
),
body:
Column
(
children:
[]),
//Va a tener varios hijos
body:
Center
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
// Agrega la imagen local
Image
.
asset
(
'assets/img/logo_visorus.jpg'
,
height:
100
),
// Botón para navegar a la página 'homeSeller'
ElevatedButton
(
onPressed:
()
{
// Navega a la página 'homeSeller' cuando se presiona el botón.
Navigator
.
pushNamed
(
context
,
'homeSeller'
);
},
child:
const
Text
(
'Avanzar a Home'
),
),
],
),
),
);
);
}
}
}
}
\ No newline at end of file
pubspec.yaml
View file @
24fadfa6
name
:
practica1_flutter
name
:
practica1_flutter
description
:
"
A
new
Flutter
project."
description
:
"
A
new
Flutter
project."
# The following line prevents the package from being accidentally published to
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
# pub.dev using `flutter pub publish`. This is preferred for private packages.
...
@@ -57,7 +58,8 @@ flutter:
...
@@ -57,7 +58,8 @@ flutter:
# included with your application, so that you can use the icons in
# included with your application, so that you can use the icons in
# the material Icons class.
# the material Icons class.
uses-material-design
:
true
uses-material-design
:
true
assets
:
-
assets/img/
# To add assets to your application, add an assets section, like this:
# To add assets to your application, add an assets section, like this:
# assets:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_burr.jpeg
...
...
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