mchess-client/lib/chess/chess_app.dart

35 lines
981 B
Dart
Raw Normal View History

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:mchess/chess_bloc/chess_bloc.dart';
2023-07-01 07:29:43 +00:00
import 'package:mchess/chess_bloc/promotion_bloc.dart';
import 'package:mchess/connection_cubit/connection_cubit.dart';
import 'package:mchess/utils/chess_router.dart';
class ChessApp extends StatelessWidget {
const ChessApp({super.key});
@override
Widget build(BuildContext context) {
2023-07-01 07:29:43 +00:00
return MultiBlocProvider(
providers: [
BlocProvider(
create: (_) => ConnectionCubit.getInstance(),
),
2023-07-01 07:29:43 +00:00
BlocProvider(
create: (context) => ChessBloc.getInstance(),
),
BlocProvider(
2023-07-03 17:41:12 +00:00
create: (context) => PromotionBloc.getInstance(),
2023-07-01 07:29:43 +00:00
)
],
child: MaterialApp.router(
theme: ThemeData.dark(
useMaterial3: true,
),
routerConfig: ChessAppRouter.getInstance().router,
2023-12-25 16:50:58 +00:00
title: 'mChess 0.1339',
),
);
}
}