index_generator
4.1.2, released a year ago by an unverified publisher
Automatically generate index / barrel / library files with all exports needed.
What it does
Scans directories and automatically generates index, barrel, or library files with the necessary export statements. It can be run globally via the command line or integrated via build_runner.
AI-written summary of version 4.1.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to automate the creation of barrel files (index.dart) for your libraries.
- You need to include/exclude specific files or packages using glob expressions.
Skip it when
- You prefer manually maintaining all export statements in your project.
Strengths
- Supports custom include/exclude filters via glob expressions.
- Can be run via CLI or integrated with build_runner.
- Allows custom output paths, disclaimers, and package-style exports.
Weaknesses
- Not documented beyond configuration options and basic usage.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 11
Activate globally or add to dev_dependencies with build_runner, and configure via index_generator.yaml or pubspec.yaml.
index_generator:
exclude:
- "**.g.dart"
libraries:
- directory_path: libAlternatives
Packages that do the same job and could replace index_generator.
- json_serializable
Automatically generate code for converting Dart classes to and from JSON.
94Compare - protobuf
Provides runtime support for Dart protocol buffer messages generated by protoc_plugin.
84Compare - protoc_plugin
Generates Dart source files from Protocol Buffer (.proto) definitions using the protoc compiler.
80Compare - mason
Dart template generator for quick file creation
89Compare
Works with
Packages commonly used together with index_generator: ones it builds on, ones built on it, and its own family.
- yamlindex_generator depends on itA Dart library for parsing YAML documents into Dart data structures.
- pub_semverindex_generator depends on itVersions and version constraints implementing pub's versioning policy.
- globindex_generator depends on itA file and directory globbing library that supports Bash-style path matching and listing.
- dart_styleindex_generator depends on itProvides an API and CLI to format Dart source code automatically.
- json_annotationindex_generator depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- argsindex_generator depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- checked_yamlindex_generator depends on itProvides checkedYamlDecode to give detailed errors when decoding YAML with json_serializable.
- buildindex_generator depends on itPackage for authoring build_runner compatible code generators.