MasonGenerator class

A MasonGenerator which extends Generator and exposes the ability to create a Generator from a Brick.

Implemented types

Constructors

MasonGenerator(String id, String description, {List<TemplateFile?> files = const <TemplateFile>[], GeneratorHooks hooks = const GeneratorHooks(), List<String> vars = const <String>[]})
A MasonGenerator which extends Generator and exposes the ability to create a Generator from a Brick.

Properties

description String
Description of the generator.
finalinherited
files List<TemplateFile>
List of TemplateFile which will be used to generate files.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
hooks GeneratorHooks
Hooks associated with the generator.
finalinherited
id String
Unique identifier for the generator.
finalinherited
partials Map<String, List<int>>
Map of partial files which will be used as includes.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
vars List<String>
Optional list of variables which will be used to populate the corresponding mustache variables within the template.
final

Methods

addTemplateFile(TemplateFile? file) → void
Add a new template file.
inherited
compareTo(Generator other) int
Compares this object to another object.
inherited
generate(GeneratorTarget target, {Map<String, dynamic> vars = const <String, dynamic>{}, FileConflictResolution? fileConflictResolution, Logger? logger}) Future<List<GeneratedFile>>
Generates files based on the provided GeneratorTarget and vars. Returns a list of GeneratedFile.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromBrick(Brick brick) Future<MasonGenerator>
Factory which creates a MasonGenerator based on a GitPath for a remote BrickYaml file.
fromBundle(MasonBundle bundle) Future<MasonGenerator>
Factory which creates a MasonGenerator based on a local MasonBundle.