Add logout button

This commit is contained in:
Moe Poi ~ 2022-05-22 21:40:40 +07:00
parent ecd0f9f928
commit a221a98e39

View file

@ -26,6 +26,42 @@ class _SessionsState extends State<Sessions> {
title: const Text('Active Sessions'),
centerTitle: true,
backgroundColor: const Color(0xff212226),
actions: [
IconButton(
icon: const Icon(Icons.logout),
onPressed: () {
removeSession();
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Log out', style: TextStyle(color: Colors.white),),
backgroundColor: const Color(0xff212226),
content: SingleChildScrollView(
child: ListBody(
children: const <Widget>[
Text('You have successfully logged out', style: TextStyle(
color: Colors.white
)),
],
),
),
actions: <Widget>[
TextButton(
child: const Text('Close', style: TextStyle(color: Colors.white),),
onPressed: () {
Navigator.of(context).pop();
Navigator.pushReplacementNamed(context, '');
},
),
],
);
}
);
},
)
],
),
body: FutureBuilder<dynamic>(
future: loadSessions(),