Multiple improvements in authentication functionality
This commit is contained in:
1 parent
bd5c4e002f
commit
fbee31841d
11 files changed
+260
-17
No files matched your search
@@ -1,5 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'chat_list_screen.dart';
|
||||
import 'user_checker.dart';
|
||||
import 'backend.dart';
|
||||
|
||||
class AppMenu extends StatelessWidget {
|
||||
const AppMenu({super.key});
|
||||
@@ -21,6 +24,22 @@ class AppMenu extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: const Text('Logout'),
|
||||
onTap: () async {
|
||||
final storage = const FlutterSecureStorage();
|
||||
await storage.delete(key: 'username');
|
||||
await storage.delete(key: 'password');
|
||||
Backend.disconnect();
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => UserChecker(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
// Add other settings options here
|
||||
],
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user