nicer looking splash screen, removed unintentional addition of back (to splash screen) button

This commit is contained in:
Lynne Megido 2020-09-30 13:02:05 +10:00
parent 0969b41bc3
commit 55e8c828a4
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90
3 changed files with 24 additions and 14 deletions

View File

@ -34,7 +34,7 @@ void main() {
title: "Buypeeb Mobile",
theme: ThemeData(
primarySwatch: Colors.orange,
primarySwatch: Colors.pink,
),
)
),

View File

@ -9,13 +9,7 @@ class RouteHome extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: "Buypeeb",
theme: ThemeData(
primarySwatch: Colors.orange,
),
home: MainPage(),
);
return MainPage();
}
}

View File

@ -10,11 +10,9 @@ class RouteSplash extends StatefulWidget {
}
class _RouteSplashState extends State<RouteSplash> {
bool _ready = false;
_loadUserSettings() async {
// 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
var listings = context.read<UserListings>();
var _rng = new Random();
@ -28,8 +26,11 @@ class _RouteSplashState extends State<RouteSplash> {
}
setState(() {
_ready = true;
Navigator.pushNamed(context, '/');
Navigator.pushNamedAndRemoveUntil(
context,
'/',
(Route<dynamic> route) => false,
);
});
}
@ -43,7 +44,22 @@ class _RouteSplashState extends State<RouteSplash> {
Widget build(BuildContext context) {
return Scaffold(
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(),
]
)
)
);
}