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:
parent
fa535b86d2
commit
4cc5578576
4 changed files with 41 additions and 10 deletions
|
|
@ -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',
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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/');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
37
lib/src/widgets/task_list_tile.dart
Normal file
37
lib/src/widgets/task_list_tile.dart
Normal 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),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue