Leave room support, persist last room, fixes
This commit is contained in:
parent
f7c6c3bb6a
commit
7dfd47a404
17 changed files with 312 additions and 136 deletions
|
|
@ -20,8 +20,32 @@ class RoomMenu extends StatelessWidget {
|
|||
child: ListTile(leading: Icon(Icons.link), title: Text("Copy Link")),
|
||||
),
|
||||
PopupMenuItem(
|
||||
onTap: () =>
|
||||
showDialog(context: context, builder: (context) => AlertDialog()),
|
||||
onTap: () => showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text("Leave Room"),
|
||||
content: Text(
|
||||
"Are you sure you want to leave \"${room.getLocalizedDisplayname()}\"?",
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: Navigator.of(context).pop,
|
||||
child: Text("Cancel"),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
final snackbar = ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text("Leaving room...")));
|
||||
await room.leave();
|
||||
snackbar.close();
|
||||
},
|
||||
child: Text("Leave"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.logout, color: danger),
|
||||
title: Text("Leave", style: TextStyle(color: danger)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue