Add Android quick streaming and logout confirmation
This commit is contained in:
@@ -140,6 +140,32 @@ class _ExploreViewState extends State<_ExploreView> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _confirmLogout() async {
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Confirm Logout'),
|
||||
content: const Text('Are you sure you want to log out now?'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () => Navigator.pop(context, true),
|
||||
child: const Text('Logout'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
if (confirmed == true && mounted) {
|
||||
await context.read<AuthProvider>().logout();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final settings = context.watch<SettingsProvider>();
|
||||
@@ -152,10 +178,7 @@ class _ExploreViewState extends State<_ExploreView> {
|
||||
icon: Icon(Icons.refresh),
|
||||
onPressed: () => _refreshRooms(),
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.logout),
|
||||
onPressed: () => context.read<AuthProvider>().logout(),
|
||||
),
|
||||
IconButton(icon: Icon(Icons.logout), onPressed: _confirmLogout),
|
||||
],
|
||||
),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
|
||||
Reference in New Issue
Block a user