mchess-client/lib/utils/chess_router.dart

27 lines
594 B
Dart

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