Skip to content
pubscout

stager

1.4.0, released 3 months ago by bryanoltman.com

Flutter productivity tool to isolate and run UI widgets as standalone apps.

WASM-ready
$ flutter pub add stager
Source repository

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.

  • sleuth

    In-app performance diagnostics overlay surfacing jank, memory leaks, and bottlenecks.

Works with

Packages commonly used together with stager: ones it builds on, ones built on it, and its own family.