BuilderEntryImpl.forSharedPart constructor

BuilderEntryImpl.forSharedPart(
  1. String key,
  2. GeneratorFactory generator, {
  3. bool generateToCache = false,
  4. Set<String> generateFor = const <String>{},
  5. Set<String> runsBefore = const <String>{},
  6. Map<String, dynamic> options = const <String, dynamic>{},
  7. Map<Type, String> registeredTypes = const <Type, String>{},
  8. bool allowSyntaxErrors = false,
  9. Set<String> applies = const <String>{},
})

Creates a BuilderEntryImpl with a shared part builder.

key A unique identifier for this builder. generator A factory function that creates the generator. generateToCache Whether outputs should be written to the build cache. generateFor Glob patterns that determine which files to process. runsBefore Builder keys that this builder should run before. options Configuration options for the builder. registeredTypes Runtime type register map for the builder. allowSyntaxErrors Whether to generate code even if the source file has syntax errors. applies Builder keys that this builder applies to.

Implementation

factory BuilderEntryImpl.forSharedPart(
  String key,
  GeneratorFactory generator, {
  bool generateToCache = false,
  Set<String> generateFor = const <String>{},
  Set<String> runsBefore = const <String>{},
  Map<String, dynamic> options = const <String, dynamic>{},
  Map<Type, String> registeredTypes = const <Type, String>{},
  bool allowSyntaxErrors = false,
  Set<String> applies = const <String>{},
}) {
  return BuilderEntryImpl(
    key,
    (BuilderOptions ops) => SharedPartBuilder(
      <Generator>[generator(ops)],
      allowSyntaxErrors: allowSyntaxErrors,
      options: ops,
    ),
    generateToCache: generateToCache,
    generateFor: generateFor,
    runsBefore: <String>{...runsBefore, ...applies},
    options: options,
    registeredTypes: registeredTypes,
    applies: applies,
  );
}