2022-12-25 18:57:47 +00:00
|
|
|
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';
|
2024-01-05 21:59:31 +00:00
|
|
|
import 'package:mchess/chess_bloc/tap_bloc.dart';
|
2022-12-25 18:57:47 +00:00
|
|
|
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(),
|
2022-12-25 18:57:47 +00:00
|
|
|
),
|
2023-07-01 07:29:43 +00:00
|
|
|
BlocProvider(
|
2024-01-09 18:08:43 +00:00
|
|
|
create: (_) => ChessBloc.getInstance(),
|
2023-07-01 07:29:43 +00:00
|
|
|
),
|
|
|
|
BlocProvider(
|
2024-01-09 18:08:43 +00:00
|
|
|
create: (_) => PromotionBloc.getInstance(),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (_) => TapBloc.getInstance(),
|
2024-01-05 21:59:31 +00:00
|
|
|
),
|
2023-07-01 07:29:43 +00:00
|
|
|
],
|
|
|
|
child: MaterialApp.router(
|
|
|
|
theme: ThemeData.dark(
|
|
|
|
useMaterial3: true,
|
|
|
|
),
|
|
|
|
routerConfig: ChessAppRouter.getInstance().router,
|
2024-01-09 18:08:43 +00:00
|
|
|
title: 'mChess 0.9.115',
|
2022-12-25 18:57:47 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|