Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
appFluetter
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
Nayeli Monserrat Velasco Lopez
appFluetter
Commits
b3bc340f
Commit
b3bc340f
authored
Jul 31, 2024
by
nayeli92433
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI home
parent
4c05db99
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
10 deletions
+89
-10
main.dart
lib/main.dart
+2
-2
home_page.dart
lib/src/pages/home_page.dart
+87
-8
No files found.
lib/main.dart
View file @
b3bc340f
...
@@ -13,8 +13,8 @@ class MyApp extends StatelessWidget {
...
@@ -13,8 +13,8 @@ class MyApp extends StatelessWidget {
return
MaterialApp
(
return
MaterialApp
(
title:
'Flutter Demo'
,
title:
'Flutter Demo'
,
debugShowCheckedModeBanner:
false
,
debugShowCheckedModeBanner:
false
,
initialRoute:
'login'
,
// Ruta inicial
initialRoute:
'login'
,
routes:
getApplicationRoutes
(),
// Definición de rutas
routes:
getApplicationRoutes
(),
);
);
}
}
}
}
lib/src/pages/home_page.dart
View file @
b3bc340f
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
class
HomePage
extends
StatelessWidget
{
void
main
(
)
=>
runApp
(
const
DrawerApp
());
const
HomePage
({
Key
?
key
})
:
super
(
key:
key
);
class
DrawerApp
extends
StatelessWidget
{
const
DrawerApp
({
super
.
key
});
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
true
),
home:
const
HomePage
(),
);
}
}
class
HomePage
extends
StatefulWidget
{
const
HomePage
({
super
.
key
});
@override
State
<
HomePage
>
createState
()
=>
_HomePageState
();
}
class
_HomePageState
extends
State
<
HomePage
>
{
String
selectedPage
=
''
;
@override
Widget
build
(
BuildContext
context
)
{
return
DefaultTabController
(
length:
2
,
// Número de pestañas
child:
Scaffold
(
appBar:
AppBar
(
appBar:
AppBar
(
title:
const
Text
(
'Home Page'
),
title:
const
Text
(
'Home Page'
),
),
backgroundColor:
Colors
.
blue
,
body:
Center
(
leading:
Builder
(
child:
ElevatedButton
(
builder:
(
BuildContext
context
)
{
return
IconButton
(
icon:
const
Icon
(
Icons
.
menu
),
onPressed:
()
{
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'articles'
);
Scaffold
.
of
(
context
).
openDrawer
();
},
);
},
},
child:
const
Text
(
'Hola home_page'
),
),
bottom:
const
TabBar
(
tabs:
[
Tab
(
icon:
Icon
(
Icons
.
home
),
text:
'Categoria'
),
Tab
(
icon:
Icon
(
Icons
.
person_2_outlined
),
text:
'Perfil'
),
],
),
),
drawer:
Drawer
(
child:
ListView
(
padding:
EdgeInsets
.
zero
,
children:
<
Widget
>[
const
DrawerHeader
(
decoration:
BoxDecoration
(
color:
Colors
.
blue
,
),
child:
Text
(
'Menu App'
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
24
,
),
),
),
ListTile
(
leading:
const
Icon
(
Icons
.
message
),
title:
const
Text
(
'Mensajes'
),
onTap:
()
{
setState
(()
{
selectedPage
=
'Messages'
;
});
Navigator
.
pop
(
context
);
// Close the drawer
},
),
ListTile
(
leading:
const
Icon
(
Icons
.
settings
),
title:
const
Text
(
'Configuraciones'
),
onTap:
()
{
setState
(()
{
selectedPage
=
'Settings'
;
});
Navigator
.
pop
(
context
);
// Close the drawer
},
),
],
),
),
body:
TabBarView
(
children:
[
Center
(
child:
Text
(
'Tab 1 Contenido'
)),
Center
(
child:
Text
(
'Tab 2 Contenido'
)),
],
),
),
),
),
);
);
...
...
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