buildExtensions property

  1. @override
Map<String, List<String>> get buildExtensions

Mapping from input file extension to output file extensions.

All input sources matching any key in this map will be passed as build step to this builder. Only files with the same basename and an extension from the values in this map are expected as outputs.

Implementation

@override
Map<String, List<String>> get buildExtensions => const {
      // To implement directory moves, this builder uses capture groups
      // ({{}}). Capture groups can match anything in the input's path,
      // including subdirectories. The `^assets` at the beginning ensures that
      // only jsons under the top-level `assets/` folder will be considered.
      '^assets/{{}}.json': ['lib/generated/{{}}.dart'],
    };