FLUTTER ECOSYSTEM

barrel_files

Generate barrel files for Dart and Flutter packages with build_runner based on code annotations

Latest version
0.3.0
30-day downloads
63
Likes
35
Pub points
150

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

barrel_files is a build_runner-based code generation package for Dart and Flutter that automatically creates barrel files (re-exports) based on annotations in your code. It simplifies package organization by generating concise entry points that expose public APIs from multiple files, reducing import boilerplate. Ideal for large projects where maintaining clean exports is crucial. The package integrates seamlessly with existing build systems and supports cross-platform development on macOS, Windows, and Linux.

Use cases
  • Automating export file creation
  • Simplifying package API exposure
  • Reducing import redundancy in large projects
  • Streamlining codebase organization
  • Supporting modular Flutter app architecture
Key features
  • Annotation-driven generation
  • Integration with build_runner
  • Cross-platform support
  • Automatic re-export management
  • Minimal configuration required
Suitable for
  • Large-scale Flutter/Dart projects
  • Modular application architectures
  • Teams prioritizing code maintainability
  • Developers using code generation workflows
  • Projects with frequent API surface changes
Considerations
  • Requires build_runner setup
  • May increase build time slightly
  • Limited to annotated files only
  • Not suitable for runtime decisions
  • Dependent on correct annotation usage
Supported platformsmacOSWindowsLinux

Install package

flutter pub add barrel_files

Categories

Dependencies

Dependency list 11 items

Source repository

Related projects

No data available yet.