Revert erroneous refactor

This commit is contained in:
Marco 2024-02-05 10:39:01 +01:00
parent ba478fedca
commit 9f64959498

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);
}, },
), ),
], ],