widgetbook_generator
3.24.0, released 5 months ago by widgetbook.io
Generates and sets up Widgetbook code via build_runner
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.
- copy_with_extension
Annotation for generating copyWith extensions code using copy_with_extension_gen.
87Compare - copy_with_extension_gen
Generate type‑safe copyWith extensions for annotated classes and record typedefs.
85Compare - json_serializable
Automatically generate code for converting Dart classes to and from JSON.
94Compare - json_annotation
Provides annotations for json_serializable to generate JSON (de)serialization code.
84Compare
Works with
Packages commonly used together with widgetbook_generator: ones it builds on, ones built on it, and its own family.
- analyzerwidgetbook_generator depends on itPerforms static analysis of Dart code for tool integration and embedding.
- cryptowidgetbook_generator depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- globwidgetbook_generator depends on itA file and directory globbing library that supports Bash-style path matching and listing.
- code_builderwidgetbook_generator depends on itA fluent, builder-based library for generating valid Dart code programmatically.
- buildwidgetbook_generator depends on itPackage for authoring build_runner compatible code generators.
- source_genwidgetbook_generator depends on itSource code generation builders and utilities for the Dart build system.
- widgetbook_annotationwidgetbook_generator depends on itAnnotations for widgetbook_generator to build Flutter widgets in isolation.
- build_runnerUsed togetherA build system for Dart code generation and modular compilation.