Codigo del Splash:
void main() => runApp(MaterialApp(
home: MyApp(),
));
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Welcome to Flutter',
home:Scaffold(
body: HomePageBody(),
)
);
}
}
class HomePageBody extends StatefulWidget {
@override
_HomePageBodyState createState() => new _HomePageBodyState();
}
class _HomePageBodyState extends State<HomePageBody> {
@override
void initState() { //SPLASH SCREEN
super.initState();
Future.delayed(
Duration (seconds: 3),
() {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => HomePage(),
),
);
}
);
}
@override
Widget build(BuildContext context) { //PLASH SCREEN
return new Scaffold(
//appBar: new AppBar(),
body: Column(
children: <Widget>[
new Container(
height: 100.0,
),
new Text(
"¡Bienvenidos a Carhue!",
style: TextStyle(
color: Tema.Colors.appBarGradientEnd,
fontWeight: FontWeight.w800,
fontFamily: 'Poppins',
letterSpacing: 0.8,
fontSize: 20.0,
),
),
new Container(
height: 120.0,
),
new Image.asset(
'fotos/fondo.jpg',
width: 600.0,
height: 240.0,
fit: BoxFit.cover,
alignment: Alignment.bottomCenter,
),
],
),
);
}
}
Codigo del Home:
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return MaterialApp(
title: 'Bienvenidos!',
home:Scaffold(
body: Home(),
)
);
}
}
class Home extends StatefulWidget {
@override
_Home createState() => new _Home();
}
class _Home extends State<Home> {
@override
Widget build(BuildContext context) {
return new Scaffold(
body: Stack(
children: <Widget>[
new Container(
decoration: BoxDecoration(
//color: Colors.yellow
),
),
GradientAppBar("¡Vivi Carhue!"),
menubotones(),
],
)
);
}
}