Skip to content

Commit

Permalink
Logout added
Browse files Browse the repository at this point in the history
  • Loading branch information
uumair327 committed Jul 4, 2024
1 parent 3862609 commit 6c24c7d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
10 changes: 9 additions & 1 deletion lib/src/features/profile/screens/account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:guardiancare/src/constants/colors.dart';
import 'package:guardiancare/src/features/authentication/screens/loginPage.dart';
import 'package:guardiancare/src/features/emergency/screens/emergencyContactPage.dart';
import 'package:guardiancare/src/features/report/screens/reportPage.dart';

class Account extends StatelessWidget {
final User? user;

const Account({Key? key, this.user}) : super(key: key);
const Account({super.key, this.user});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -95,6 +96,13 @@ class Account extends StatelessWidget {
onTap: () async {
await GoogleSignIn().signOut();
await FirebaseAuth.instance.signOut();
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => const LoginPage(),
),
(Route<dynamic> route) => false,
);
},
),
],
Expand Down
24 changes: 16 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,18 @@ packages:
dependency: transitive
description:
name: dio
sha256: "11e40df547d418cc0c4900a9318b26304e665da6fa4755399a9ff9efd09034b5"
sha256: e17f6b3097b8c51b72c74c9f071a605c47bcc8893839bd66732457a5ebe73714
url: "https://pub.dev"
source: hosted
version: "5.4.3+1"
version: "5.5.0+1"
dio_web_adapter:
dependency: transitive
description:
name: dio_web_adapter
sha256: "36c5b2d79eb17cdae41e974b7a8284fec631651d2a6f39a8a2ff22327e90aeac"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -396,10 +404,10 @@ packages:
dependency: transitive
description:
name: freezed_annotation
sha256: c3fd9336eb55a38cc1bbd79ab17573113a8deccd0ecbbf926cca3c62803b5c2d
sha256: f54946fdb1fa7b01f780841937b1a80783a20b393485f3f6cdf336fd6f4705f2
url: "https://pub.dev"
source: hosted
version: "2.4.1"
version: "2.4.2"
get:
dependency: "direct main"
description:
Expand Down Expand Up @@ -913,18 +921,18 @@ packages:
dependency: "direct main"
description:
name: video_player
sha256: "3f7694b0fa01ee654f439b1161f3c23cd8e87e15a714fd894307240fe1de1a4a"
sha256: e30df0d226c4ef82e2c150ebf6834b3522cf3f654d8e2f9419d376cdc071425d
url: "https://pub.dev"
source: hosted
version: "2.9.0"
version: "2.9.1"
video_player_android:
dependency: transitive
description:
name: video_player_android
sha256: "3ff2da7e5a9274bef9b5deb9084f73a77920211c463e0e836361b14146e67339"
sha256: fdc0331ce9f808cc2714014cb8126bd6369943affefd54f8fdab0ea0bb617b7f
url: "https://pub.dev"
source: hosted
version: "2.5.1"
version: "2.5.2"
video_player_avfoundation:
dependency: transitive
description:
Expand Down

0 comments on commit 6c24c7d

Please sign in to comment.