Fix snackbar in host/join dialog #9

Merged
marco merged 2 commits from fix-dialog-snackbar into master 2024-02-05 09:48:30 +00:00
Showing only changes of commit 9f64959498 - Show all commits

View File

@ -59,27 +59,26 @@ class _LobbySelectorState extends State<LobbySelector> {
Future<void> buildJoinOrHostDialog(BuildContext context) { Future<void> buildJoinOrHostDialog(BuildContext context) {
return showDialog<void>( return showDialog<void>(
context: context, context: context,
builder: (BuildContext builderContext) { builder: (BuildContext context) {
return Scaffold( return Scaffold(
body: AlertDialog( body: AlertDialog(
title: const Text('Host or join?'), title: const Text('Host or join?'),
actions: <Widget>[ actions: <Widget>[
TextButton( TextButton(
child: const Text('Cancel'), child: const Text('Cancel'),
onPressed: () => builderContext.pop(), onPressed: () => context.pop(),
), ),
TextButton( TextButton(
child: const Text('Host'), child: const Text('Host'),
onPressed: () { onPressed: () {
builderContext.pop(); //close dialog before going to host context.pop(); //close dialog before going to host
builderContext.goNamed('host'); context.goNamed('host');
}), }),
TextButton( TextButton(
child: const Text('Join'), child: const Text('Join'),
onPressed: () { onPressed: () {
builderContext context.pop(); //close dialog before going to next dialog
.pop(); //close dialog before going to next dialog buildEnterPassphraseDialog(context);
buildEnterPassphraseDialog(builderContext);
}, },
), ),
], ],