stager
1.4.0, released 3 months ago by bryanoltman.com
Flutter productivity tool to isolate and run UI widgets as standalone apps.
What it does
Stager allows developers to isolate portions of a Flutter app into self-contained 'Scenes'. It uses code generation to build a control panel app where you can test different UI states, dark mode, text scales, and custom environment controls.
AI-written summary of version 1.4.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to develop and test individual widgets or flows in isolation without navigating through the entire app.
- You need to showcase various UI states (loading, empty, error, dark mode) to designers.
- You want to reuse UI scenes inside widget tests.
Skip it when
- You are building a tiny app where traditional navigation and full-app debugging is already fast enough.
- You cannot use code generation in your project.
Strengths
- Greatly increases development velocity for complex UI components.
- Built-in environment controls for dark mode, text scales, and custom properties.
- Scenes can be easily reused in widget tests.
Weaknesses
- Requires running build_runner to generate Stager app entry points.
- Adds boilerplate for setting up Scene subclasses.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 3
Requires running build_runner to generate the Stager app entry points, and launching apps using the generated files with optional --dart-define parameters.
class EmptyListScene extends BasePostsListScene {
@override
String get title => 'Empty List';
@override
Future<void> setUp() async {
await super.setUp();
when(mockApi.fetchPosts()).thenAnswer((_) async => <Post>[]);
}
}Alternatives
Packages that do the same job and could replace stager.
Works with
Packages commonly used together with stager: ones it builds on, ones built on it, and its own family.
- analyzerstager depends on itPerforms static analysis of Dart code for tool integration and embedding.
- buildstager depends on itPackage for authoring build_runner compatible code generators.
- source_genstager depends on itSource code generation builders and utilities for the Dart build system.
- build_runnerUsed togetherA build system for Dart code generation and modular compilation.