Skip to content
pubscout

widgetbook_generator

3.24.0, released 5 months ago by widgetbook.io

Generates and sets up Widgetbook code via build_runner

WASM-ready
$ flutter pub add widgetbook_generator
Source repository

What it does

It automates the creation of Widgetbook configuration files and components. The generator runs as a build_runner builder and outputs Dart code that integrates with the widgetbook package.

AI-written summary of version 3.24.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to use Widgetbook for isolated widget testing and documentation.
  • You need to keep Widgetbook configuration in sync with your codebase.

Skip it when

  • You are not using Widgetbook or prefer manual setup.

Strengths

  • Automates boilerplate for Widgetbook
  • Supports latest analyzer versions
  • Integrates with build_runner ecosystem

Weaknesses

  • Only works with Widgetbook
  • Requires build_runner setup
  • Limited to Dart SDK 3.10+

Setup

Kind
Pure Dart
Effort
Medium
Code generation
Yes (build_runner)
Direct dependencies
10

Add widgetbook_generator to dev_dependencies, run `flutter pub run build_runner build` to generate code.

Alternatives

Packages that do the same job and could replace widgetbook_generator.

Works with

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