nicer looking splash screen, removed unintentional addition of back (to splash screen) button
This commit is contained in:
parent
0969b41bc3
commit
55e8c828a4
3 changed files with 24 additions and 14 deletions
|
@ -34,7 +34,7 @@ void main() {
|
||||||
|
|
||||||
title: "Buypeeb Mobile",
|
title: "Buypeeb Mobile",
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Colors.orange,
|
primarySwatch: Colors.pink,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
|
@ -9,13 +9,7 @@ class RouteHome extends StatelessWidget {
|
||||||
// This widget is the root of your application.
|
// This widget is the root of your application.
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MainPage();
|
||||||
title: "Buypeeb",
|
|
||||||
theme: ThemeData(
|
|
||||||
primarySwatch: Colors.orange,
|
|
||||||
),
|
|
||||||
home: MainPage(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,9 @@ class RouteSplash extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _RouteSplashState extends State<RouteSplash> {
|
class _RouteSplashState extends State<RouteSplash> {
|
||||||
bool _ready = false;
|
|
||||||
|
|
||||||
_loadUserSettings() async {
|
_loadUserSettings() async {
|
||||||
// sleep for a bit to "simulate" loading
|
// sleep for a bit to "simulate" loading
|
||||||
await Future.delayed(Duration(seconds: 1));
|
await Future.delayed(Duration(seconds: 2));
|
||||||
// add some random stuff to the listings
|
// add some random stuff to the listings
|
||||||
var listings = context.read<UserListings>();
|
var listings = context.read<UserListings>();
|
||||||
var _rng = new Random();
|
var _rng = new Random();
|
||||||
|
@ -28,8 +26,11 @@ class _RouteSplashState extends State<RouteSplash> {
|
||||||
}
|
}
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_ready = true;
|
Navigator.pushNamedAndRemoveUntil(
|
||||||
Navigator.pushNamed(context, '/');
|
context,
|
||||||
|
'/',
|
||||||
|
(Route<dynamic> route) => false,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +44,22 @@ class _RouteSplashState extends State<RouteSplash> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
body: Center(
|
||||||
child: CircularProgressIndicator(),
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: const EdgeInsets.all(12.0),
|
||||||
|
child: Text(
|
||||||
|
"Buypeeb Mobile",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 36.0,
|
||||||
|
fontWeight: FontWeight.w200
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
CircularProgressIndicator(),
|
||||||
|
]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue