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

This commit is contained in:
Mariano Uvalle 2019-03-11 23:38:00 -06:00
parent fa535b86d2
commit 4cc5578576
4 changed files with 41 additions and 10 deletions

View file

@ -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',
),
);

View file

@ -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(),
);
}
}

View file

@ -43,7 +43,7 @@ class LoginScreen extends StatelessWidget {
Future<void> onLoginButtonTap(BuildContext context) async {
final user = await _authService.googleLoginAndSignup();
if (user != null) {
Navigator.of(context).pushNamed('home/');
Navigator.of(context).pushReplacementNamed('home/');
}
}

View file

@ -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: <Widget>[
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),
),
),
),
);
}
}