A Bevy-inspired Entity Component System (ECS) framework for Dart and Flutter game development.
Fledge brings the power of modern ECS architecture to Flutter, enabling you to build performant 2D games with clean, composable code. Inspired by Bevy, Fledge separates data (components) from logic (systems) for maximum flexibility and testability.
- Entity Component System — Compose game objects from reusable components
- System Scheduling — Automatic parallel execution with dependency resolution, fixed-timestep support, and an ordering-ambiguity checker
- Two-World Architecture — Separate game logic from rendering via extractors and a dedicated render world
- Real Canvas Rendering — Sprite pipeline built on
Canvas.drawRawAtlaswith layer-sorted draws - Ref-counted Assets — Shared
Handle<T>+Assets<T>store used by render, audio, tiled - 2.5D Primitives — Orthographic, isometric, and oblique projections; camera follow, shake, letterbox, parallax
- Dynamic Lighting — Point / directional / spot lights and ambient illumination
- Retained-mode HUD/UI — Anchor-based layout, containers, text, images, panels
- Debug Tooling — Runtime overlay (FPS, entity count, ordering ambiguities) plus AABB / collider / camera-frustum gizmos
- Plugin System — Modular, reusable game features
- Action-Based Input — Map physical inputs to semantic actions
- Spatial Audio — 2D positional audio with volume channels
- Tiled Integration — Load and render TMX/TSX tilemaps
- Yarn Dialogue — Branching dialogue with variables and commands
- Physics & Collision — Layer-based collision detection and resolution
- Save System — File-based save/load with versioning
- Game Calendar — Day/night cycles, seasons, curfew
- Multiplayer Networking — Encrypted host/client transport with state sync and input prediction
| Package | Description | pub.dev |
|---|---|---|
| fledge_ecs | Core ECS framework | |
| fledge_ecs_annotations | Annotations for code generation | |
| fledge_ecs_generator | Code generator for components/systems | |
| fledge_assets | Ref-counted asset store |
| Package | Description | pub.dev |
|---|---|---|
| fledge_render_2d | 2D rendering + core render infrastructure | |
| fledge_camera_2d | Cameras, follow, shake, letterbox, parallax | |
| fledge_particles | CPU-driven particle system | |
| fledge_lighting_2d | Dynamic 2D lighting | |
| fledge_tween | Easing curves and value tweens | |
| fledge_ui | Retained-mode HUD/UI | |
| fledge_debug | Overlay + gizmos |
| Package | Description | pub.dev |
|---|---|---|
| fledge_input | Action-based input handling | |
| fledge_audio | Music and sound effects | |
| fledge_window | Window management | |
| fledge_tiled | Tiled tilemap support | |
| fledge_yarn | Yarn Spinner dialogue system | |
| fledge_physics | Physics and collision detection | |
| fledge_save | Save/load system with versioning | |
| fledge_calendar | Game calendar and day/night cycles | |
| fledge_net | Multiplayer networking |
Add Fledge to your project:
dependencies:
fledge_ecs: ^0.2.1Create your first ECS app:
import 'package:fledge_ecs/fledge_ecs.dart';
// Components are plain Dart classes
class Position {
double x, y;
Position(this.x, this.y);
}
class Velocity {
double x, y;
Velocity(this.x, this.y);
}
// Systems operate on component queries
class MovementSystem extends System {
@override
SystemMeta get meta => SystemMeta(
name: 'movement',
writes: {ComponentId.of<Position>()},
reads: {ComponentId.of<Velocity>()},
resourceReads: {WallTime},
);
@override
Future<void> run(World world) async {
final time = world.getResource<WallTime>()!;
for (final (_, pos, vel) in world.query2<Position, Velocity>().iter()) {
pos.x += vel.x * time.delta;
pos.y += vel.y * time.delta;
}
}
}
void main() async {
final app = App()
..addPlugin(WallTimePlugin())
..addSystem(MovementSystem());
// Spawn an entity
app.world.spawn()
..insert(Position(0, 0))
..insert(Velocity(10, 5));
// Run the game loop
await app.run();
}Visit fledge-framework.dev for:
See the examples directory for complete sample projects.
This monorepo uses Melos for package management:
# Install melos
dart pub global activate melos
# Bootstrap all packages
melos bootstrap
# Run tests across all packages
melos run test
# Analyze all packages
melos run analyzeContributions are welcome! Please read our contributing guidelines before submitting PRs.
Apache 2.0 - See LICENSE for details.