2024-08-02 13:53:40 +03:00
|
|
|
import 'package:flame/components.dart';
|
|
|
|
import 'package:flame/game.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
2024-08-05 11:04:54 +03:00
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'board.dart';
|
|
|
|
import 'swap_notifier.dart';
|
2024-08-02 13:53:40 +03:00
|
|
|
|
2024-08-05 11:04:54 +03:00
|
|
|
class MatchMagicGame extends StatelessWidget {
|
|
|
|
final List<Sprite> sprites;
|
2024-08-02 13:53:40 +03:00
|
|
|
|
2024-08-05 11:04:54 +03:00
|
|
|
const MatchMagicGame({required this.sprites, Key? key}) : super(key: key);
|
2024-08-02 13:53:40 +03:00
|
|
|
|
|
|
|
@override
|
2024-08-05 11:04:54 +03:00
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ChangeNotifierProvider(
|
|
|
|
create: (_) => SwapNotifier(),
|
|
|
|
child: GameWidget(
|
|
|
|
game: Board(sprites: sprites),
|
|
|
|
),
|
|
|
|
);
|
2024-08-02 13:53:40 +03:00
|
|
|
}
|
|
|
|
}
|