mchess-client/lib/utils/chess_router.dart

30 lines
709 B
Dart

import 'package:go_router/go_router.dart';
import 'package:mchess/pages/lobby_selector.dart';
import 'package:mchess/pages/prepare_chess_game.dart';
class ChessAppRouter {
static final ChessAppRouter _instance = ChessAppRouter._internal();
ChessAppRouter._internal();
static ChessAppRouter getInstance() {
return _instance;
}
final router = GoRouter(
routes: [
GoRoute(
path: '/',
name: 'lobbySelector',
builder: (context, state) => const LobbySelector(),
),
GoRoute(
path: '/play',
name: 'prepareChessGame',
builder: (context, state) {
return const PrepareChessGameWidget();
})
],
);
}