Skip to content
pubscout

auto_exporter

4.2.0, released 3 months ago by normidar.com

Automatically export Dart classes and enums using annotations and build_runner.

$ flutter pub add auto_exporter
Source repository

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.

  • freezed

    Code generation for immutable classes, tagged unions, and cloning without boilerplate.

  • protobuf

    Provides runtime support for Dart protocol buffer messages generated by protoc_plugin.

  • auto_mappr

    Code generation package for mapping between different objects with ease.

Works with

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