Marco
212a54612c
This adds an option to dragging-and-dropping which is slightly hard on smaller screens. Fix promotions when tapping and fix handling of subsequently tapping two pieces of your color Cancel tap if a drag is started (tapped square will not stay red in case a drag is started) Change url strategy back to the hashtag thing Change version Fix bug that would not allow a piece move if you tried to take an opponents piece. Fix the coloring of the last move after an invalid move was played. Upgrading deps
39 lines
1.1 KiB
Dart
39 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:mchess/chess_bloc/chess_bloc.dart';
|
|
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) {
|
|
return MultiBlocProvider(
|
|
providers: [
|
|
BlocProvider(
|
|
create: (_) => ConnectionCubit.getInstance(),
|
|
),
|
|
BlocProvider(
|
|
create: (_) => ChessBloc.getInstance(),
|
|
),
|
|
BlocProvider(
|
|
create: (_) => PromotionBloc.getInstance(),
|
|
),
|
|
BlocProvider(
|
|
create: (_) => TapBloc.getInstance(),
|
|
),
|
|
],
|
|
child: MaterialApp.router(
|
|
theme: ThemeData.dark(
|
|
useMaterial3: true,
|
|
),
|
|
routerConfig: ChessAppRouter.getInstance().router,
|
|
title: 'mChess 0.9.115',
|
|
),
|
|
);
|
|
}
|
|
}
|