Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
deliciafernandes committed Nov 27, 2020
1 parent 17cfefb commit 2e7473f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/models/check_if_user_logged_in.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/material.dart';

class CheckIfUserLoggedIn extends ChangeNotifier {
bool _userLoggedIn = false;
FirebaseUser loggedInUser;
User loggedInUser;

String getCurrentUserEmail() {
loggedInUser = _auth.currentUser;
Expand Down
2 changes: 1 addition & 1 deletion lib/views/account_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AccountView extends StatefulWidget {
class _AccountViewState extends State<AccountView> {
@override
Widget build(BuildContext context) {
return !Provider.of<CheckIfUserLoggedIn>(context).getCurrentUser()
return Provider.of<CheckIfUserLoggedIn>(context).getCurrentUser()
? ProfileBody()
: AuthBody();
}
Expand Down
8 changes: 6 additions & 2 deletions lib/views/body_widgets/profile_body.dart
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import 'package:checklst/models/check_if_user_logged_in.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart';
import 'package:geolocator/geolocator.dart';
import 'package:flutter/services.dart';

CheckIfUserLoggedIn checkIfUserLoggedIn = CheckIfUserLoggedIn();
String email = checkIfUserLoggedIn.getCurrentUserEmail();

class ProfileBody extends StatefulWidget {
@override
_ProfileBodyState createState() => _ProfileBodyState();
}

class _ProfileBodyState extends State<ProfileBody> {
String email = '[email protected]';
String location = 'Mahalaxmi, Mumbai.';
final FirebaseAuth auth = FirebaseAuth.instance;

signOut() async {
await auth.signOut();
}
Expand Down Expand Up @@ -161,7 +165,7 @@ class _ProfileBodyState extends State<ProfileBody> {
),
SizedBox(height: 20.0),
Text(
'If you want to sign out of Checklst App, click Sign Out.',
'If you want to sign out of Checklst App, click Sign Out.',
style: TextStyle(
fontSize: 16.0,
fontFamily: 'WorkSans',
Expand Down

0 comments on commit 2e7473f

Please sign in to comment.