bonfire_bloc 0.0.2 bonfire_bloc: ^0.0.2 copied to clipboard
Integration for the Bloc state management library to Bonfire games.
import 'package:bonfire_bloc_example/bloc/inventory_bloc.dart';
import 'package:bonfire_bloc_example/game/game.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => InventoryBloc(),
child: MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const GameWidget(),
),
);
}
}