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: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/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_title_group.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
|
||||
import 'item_title_setting.dart';
|
||||
|
||||
class SettingView extends StatelessWidget {
|
||||
final Auth auth;
|
||||
|
||||
const SettingView({
|
||||
Key key,
|
||||
@required this.auth,
|
||||
}) : super(key: key);
|
||||
|
||||
_navigateToAboutView(BuildContext context) {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
@@ -41,12 +45,9 @@ class SettingView extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
_changeLanguage(BuildContext context) async {
|
||||
|
||||
}
|
||||
_changeLanguage(BuildContext context) async {}
|
||||
|
||||
_showLogoutDialog(BuildContext context) async {
|
||||
final auth = Provider.of<Auth>(context, listen: false);
|
||||
final isConfirm = await showAlertDialog(
|
||||
context: context,
|
||||
title: "Deconnexion",
|
||||
@@ -57,6 +58,7 @@ class SettingView extends StatelessWidget {
|
||||
|
||||
if (isConfirm) {
|
||||
await auth.signOut();
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +66,6 @@ class SettingView extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
// TOdo: Remove statique data
|
||||
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
|
||||
Reference in New Issue
Block a user