back to all notes

tooling1 min read

Automated Dart & Flutter Exports

Maintaining Dart exporter files by hand gets repetitive as files are added or moved. I wrote the Dart & Flutter Exports extension to generate them from a selected directory.

Source repository: dart-flutter-exports.

The extension scans directories recursively and creates or updates an exporter named folder_name.dart. It prompts before overwriting an existing exporter and checks whether a file looks like an exporter rather than ordinary Dart code.

To use it, right-click a folder in the IDE and select Generate Dart export files. Selecting a root folder also generates exporter files in its descendant directories.

The checks reduce the chance of overwriting unrelated code; they are not a reason to skip reviewing the generated changes.