From 4cc5578576fae4043a065a554c7d146c5bc02eeb Mon Sep 17 00:00:00 2001 From: AYM1607 Date: Mon, 11 Mar 2019 23:38:00 -0600 Subject: [PATCH] Fixed a bug in the login screen where it wasnt being popped and replaced by the home screen, Added skeleton layout for the task list tile --- lib/src/App.dart | 1 + lib/src/screens/home_screen.dart | 11 ++------- lib/src/screens/login_screen.dart | 2 +- lib/src/widgets/task_list_tile.dart | 37 +++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 lib/src/widgets/task_list_tile.dart diff --git a/lib/src/App.dart b/lib/src/App.dart index f6d3e74..4d40442 100644 --- a/lib/src/App.dart +++ b/lib/src/App.dart @@ -12,6 +12,7 @@ class App extends StatelessWidget { onGenerateRoute: routes, theme: ThemeData( canvasColor: Color.fromRGBO(23, 25, 29, 1.0), + cardColor: Color.fromRGBO(36, 39, 44, 1.0), fontFamily: 'IBM Plex Sans', ), ); diff --git a/lib/src/screens/home_screen.dart b/lib/src/screens/home_screen.dart index 509e16d..924a13b 100644 --- a/lib/src/screens/home_screen.dart +++ b/lib/src/screens/home_screen.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import '../resources/authService.dart'; +import '../widgets/task_list_tile.dart'; class HomeScreen extends StatelessWidget { final _auth = authService; @@ -10,15 +11,7 @@ class HomeScreen extends StatelessWidget { appBar: AppBar( title: Text('Main Screen'), ), - body: MaterialButton( - onPressed: () => _auth.signOut(), - child: Text( - 'SignOut', - style: TextStyle( - color: Colors.white, - ), - ), - ), + body: TaskListTile(), ); } } diff --git a/lib/src/screens/login_screen.dart b/lib/src/screens/login_screen.dart index c9b1b50..1f0b65f 100644 --- a/lib/src/screens/login_screen.dart +++ b/lib/src/screens/login_screen.dart @@ -43,7 +43,7 @@ class LoginScreen extends StatelessWidget { Future onLoginButtonTap(BuildContext context) async { final user = await _authService.googleLoginAndSignup(); if (user != null) { - Navigator.of(context).pushNamed('home/'); + Navigator.of(context).pushReplacementNamed('home/'); } } diff --git a/lib/src/widgets/task_list_tile.dart b/lib/src/widgets/task_list_tile.dart new file mode 100644 index 0000000..86f1f74 --- /dev/null +++ b/lib/src/widgets/task_list_tile.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; + +class TaskListTile extends StatelessWidget { + Widget build(BuildContext context) { + return FractionallySizedBox( + widthFactor: .9, + child: Container( + height: 116, + child: Stack( + children: [ + Positioned( + top: 0, + left: 0, + child: Container( + width: 88, + height: 25, + decoration: BoxDecoration( + color: Colors.pink, + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(14), + ), + ), + ), + ) + ], + ), + decoration: BoxDecoration( + color: Theme.of(context).cardColor, + borderRadius: BorderRadius.only( + topRight: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + ), + ), + ); + } +}