Fix Logout issue
This commit is contained in:
@@ -1,17 +1,21 @@
|
|||||||
import 'package:firebase_auth/firebase_auth.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:le_kiosque_by_gcs/services/auth/auth.dart';
|
import 'package:le_kiosque_by_gcs/services/auth/auth.dart';
|
||||||
import 'package:le_kiosque_by_gcs/ui/custom/dialog.dart';
|
import 'package:le_kiosque_by_gcs/ui/custom/dialog.dart';
|
||||||
import 'package:le_kiosque_by_gcs/ui/view/about.dart';
|
import 'package:le_kiosque_by_gcs/ui/view/about.dart';
|
||||||
import 'package:le_kiosque_by_gcs/ui/view/setting/item_logout.dart';
|
import 'package:le_kiosque_by_gcs/ui/view/setting/item_logout.dart';
|
||||||
import 'package:le_kiosque_by_gcs/ui/view/setting/item_title_group.dart';
|
import 'package:le_kiosque_by_gcs/ui/view/setting/item_title_group.dart';
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
|
||||||
import 'item_title_setting.dart';
|
import 'item_title_setting.dart';
|
||||||
|
|
||||||
class SettingView extends StatelessWidget {
|
class SettingView extends StatelessWidget {
|
||||||
|
final Auth auth;
|
||||||
|
|
||||||
|
const SettingView({
|
||||||
|
Key key,
|
||||||
|
@required this.auth,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
_navigateToAboutView(BuildContext context) {
|
_navigateToAboutView(BuildContext context) {
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
@@ -41,12 +45,9 @@ class SettingView extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_changeLanguage(BuildContext context) async {
|
_changeLanguage(BuildContext context) async {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
_showLogoutDialog(BuildContext context) async {
|
_showLogoutDialog(BuildContext context) async {
|
||||||
final auth = Provider.of<Auth>(context, listen: false);
|
|
||||||
final isConfirm = await showAlertDialog(
|
final isConfirm = await showAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: "Deconnexion",
|
title: "Deconnexion",
|
||||||
@@ -57,6 +58,7 @@ class SettingView extends StatelessWidget {
|
|||||||
|
|
||||||
if (isConfirm) {
|
if (isConfirm) {
|
||||||
await auth.signOut();
|
await auth.signOut();
|
||||||
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +66,6 @@ class SettingView extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// TOdo: Remove statique data
|
// TOdo: Remove statique data
|
||||||
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user