import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; class LobbySelector extends StatelessWidget { const LobbySelector({super.key}); final buttonStyle = const ButtonStyle(); @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ ElevatedButton( onPressed: () { _dialogBuilder(context); }, child: const Row( mainAxisSize: MainAxisSize.min, children: [ Icon(Icons.lock), SizedBox( width: 10, ), Text('Private game') ], ), ), ], ), ), ); } Future _dialogBuilder(BuildContext context) { return showDialog( context: context, builder: (BuildContext context) { return AlertDialog( title: const Text('Host or join?'), actions: [ TextButton( child: const Text('Host'), onPressed: () { context.push('/host'); }, ), TextButton( child: const Text('Join'), onPressed: () { context.push('/join'); }, ), ], ); }, ); } }