flame_riverpod
5.5.5, released 4 months ago by flame-engine.org
Helpers for using Riverpod state management within Flame game engines.
What it does
Bridges Riverpod state management with Flame game components. It provides specialized mixins and widgets like RiverpodAwareGameWidget, RiverpodGameMixin, and RiverpodComponentMixin to manage provider subscriptions based on component lifecycles.
AI-written summary of version 5.5.5, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building a game using Flame and want to use Riverpod for state management
- You need Flame components to react to provider changes and manage subscriptions automatically
Skip it when
- You are not using the Flame game engine
- You prefer a state management solution other than Riverpod
Strengths
- Integrates Riverpod naturally with Flame component lifecycles
- Automatically handles subscription initialization and cleanup
- Provides access to WidgetRef operations within components
Weaknesses
- Tied strictly to Flame and Riverpod ecosystems
- Requires specific mixins and game widget replacements
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Use RiverpodAwareGameWidget, add RiverpodGameMixin to your game, and RiverpodComponentMixin to interacting components.
class RefExampleGame extends FlameGame with RiverpodGameMixin {
@override
Future<void> onLoad() async {
await super.onLoad();
add(RiverpodAwareTextComponent());
}
}Alternatives
Packages that do the same job and could replace flame_riverpod.
Works with
Packages commonly used together with flame_riverpod: ones it builds on, ones built on it, and its own family.
- riverpodflame_riverpod depends on itA reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
- flutter_riverpodflame_riverpod depends on itA reactive caching and data-binding framework for Flutter.
- flameflame_riverpod depends on itA minimalist Flutter game engine, provides a nice set of somewhat independent modules you can choose from.
- flame_audioSame familyAudio support wrapper for the Flame game engine
- flame_testSame familyClasses and helpers for testing applications built with the Flame Engine.
- flame_svgSame familyAdds SVG rendering support for the Flame game engine
- flame_blocSame familyIntegration for the Bloc state management library to Flame games.
- flame_lintSame familyA strict and satisfying lint package for Flame, Flutter, or Dart projects.