Skip to content

Commit

Permalink
Added more logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
archelangelo committed Jan 2, 2020
1 parent e4c0d6e commit b4b8166
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
11 changes: 7 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:flutter/material.dart';
// import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:pal_finder/screens/home.dart';
import 'package:pal_finder/screens/login.dart';
import 'package:pal_finder/screens/splash.dart';

final GlobalKey<NavigatorState> navigatorKey = new GlobalKey<NavigatorState>();
// final GlobalKey<NavigatorState> navigatorKey = new GlobalKey<NavigatorState>();

void main() => runApp(MyApp());

Expand All @@ -13,14 +13,17 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
print('Building MyApp');
return CupertinoApp(
title: _title,
navigatorKey: navigatorKey,
// navigatorKey: navigatorKey,
initialRoute: '/',
routes: {
'/': (context) => SplashScreen(),
'/home': (context) => HomeScreen(),
'/login': (context) => LoginScreen(),
},
home: SplashScreen(),
// home: SplashScreen(),
);
}
}
1 change: 1 addition & 0 deletions lib/screens/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class LoginScreen extends StatelessWidget {

@override
Widget build(BuildContext context) {
print('Building login page... $context');
return WillPopScope(
onWillPop: () {
if(Navigator.canPop(context)) {
Expand Down
13 changes: 7 additions & 6 deletions lib/screens/splash.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ class SplashScreen extends StatelessWidget {
final int splashDuration = 2;

_startTimer(BuildContext context) async {
return Timer(
Duration(seconds: splashDuration),
() {
SystemChannels.textInput.invokeMethod('TextInput.hide');
Navigator.of(context).pushReplacementNamed('/login');
}
Future.delayed(
Duration(seconds: splashDuration),
() {
SystemChannels.textInput.invokeMethod('TextInput.hide');
Navigator.pushReplacementNamed(context, '/login');
},
);
}

@override
Widget build(BuildContext context) {
print('Building splashscreen in $context');
_startTimer(context);
return Scaffold(
body: Container(
Expand Down
1 change: 1 addition & 0 deletions lib/widgets/event_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class _EventListState extends State<EventList> {

@override
Widget build(BuildContext context) {
print('Building event list in $context');
return DecoratedBox(
decoration: BoxDecoration(color: Color.fromRGBO(128, 128, 128, 1)),
child: ListView.builder(
Expand Down

0 comments on commit b4b8166

Please sign in to comment.