back button clears selection: room list and chat
When a room or event is selected and the Android back button is pressed, don't pop but clear the current selection. Fixes #399.
This commit is contained in:
parent
3b91cb3159
commit
405ec5833e
2 changed files with 20 additions and 4 deletions
|
|
@ -54,7 +54,15 @@ class ChatView extends StatelessWidget {
|
|||
context: context, future: () => controller.room.join());
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
return VWidgetGuard(
|
||||
onSystemPop: (redirector) async {
|
||||
if (controller.selectedEvents.isNotEmpty) {
|
||||
controller.clearSelectedEvents();
|
||||
redirector.stopRedirection();
|
||||
}
|
||||
},
|
||||
child:
|
||||
Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: controller.selectMode
|
||||
? IconButton(
|
||||
|
|
@ -694,7 +702,7 @@ class ChatView extends StatelessWidget {
|
|||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue