mchess-client/lib/chess/chess_app.dart

39 lines
1.1 KiB
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/chess_bloc/tap_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: (_) => ChessBloc.getInstance(),
2023-07-01 07:29:43 +00:00
),
BlocProvider(
create: (_) => PromotionBloc.getInstance(),
),
BlocProvider(
create: (_) => TapBloc.getInstance(),
),
2023-07-01 07:29:43 +00:00
],
child: MaterialApp.router(
theme: ThemeData.dark(
useMaterial3: true,
),
routerConfig: ChessAppRouter.getInstance().router,
2024-05-19 19:18:47 +00:00
title: 'mChess 1.0.6',
),
);
}
}