From 6c24c7d6baaff4e4409cefcf9b6e02b8d49b9228 Mon Sep 17 00:00:00 2001 From: uumair327 Date: Thu, 4 Jul 2024 22:18:45 +0530 Subject: [PATCH] Logout added --- lib/src/features/profile/screens/account.dart | 10 +++++++- pubspec.lock | 24 ++++++++++++------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/lib/src/features/profile/screens/account.dart b/lib/src/features/profile/screens/account.dart index 1aae79e..8021f96 100644 --- a/lib/src/features/profile/screens/account.dart +++ b/lib/src/features/profile/screens/account.dart @@ -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) { @@ -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 route) => false, + ); }, ), ], diff --git a/pubspec.lock b/pubspec.lock index a784982..c885f8f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: @@ -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: @@ -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: