auto_exporter
4.2.0, released 3 months ago by normidar.com
Automatically export Dart classes and enums using annotations and build_runner.
What it does
Auto Exporter is a code generation tool that automatically creates export directives for Dart classes and enums within a project or sub-packages. It allows developers to control what gets exported using annotations like @AutoExport and @IgnoreExport, and configures via build.yaml.
AI-written summary of version 4.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to automate the maintenance of export statements in large Dart or Flutter packages.
- You need explicit control over what gets exported using annotations.
Skip it when
- Your project does not use code generation or build_runner.
- You prefer manually managing export files.
Strengths
- Sorts and formats export lists consistently across different devices and environments.
- Supports sub-package exporting and configurable default export behaviors.
Weaknesses
- Requires build_runner to generate files, adding a build step to development.
- Depends on specific versions of the analyzer and build packages.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 7
Add auto_exporter_annotation to dependencies, auto_exporter and build_runner to dev_dependencies, and configure build.yaml at the root of the project.
targets:
$default:
builders:
auto_exporter:
options:
default_export_all: true
project_name: <your plugin name>Alternatives
Packages that do the same job and could replace auto_exporter.
- embed
Generates Dart code that embeds arbitrary file contents as literals.
75Compare - freezed
Code generation for immutable classes, tagged unions, and cloning without boilerplate.
96Compare - protobuf
Provides runtime support for Dart protocol buffer messages generated by protoc_plugin.
84Compare - auto_mappr
Code generation package for mapping between different objects with ease.
79Compare
Works with
Packages commonly used together with auto_exporter: ones it builds on, ones built on it, and its own family.
- analyzerauto_exporter depends on itPerforms static analysis of Dart code for tool integration and embedding.
- pub_semverauto_exporter depends on itVersions and version constraints implementing pub's versioning policy.
- globauto_exporter depends on itA file and directory globbing library that supports Bash-style path matching and listing.
- dart_styleauto_exporter depends on itProvides an API and CLI to format Dart source code automatically.
- buildauto_exporter depends on itPackage for authoring build_runner compatible code generators.
- source_genauto_exporter 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.