Module constructor

Module({
  1. String name = 'unnamed_module',
  2. bool reserveName = false,
  3. String? definitionName,
  4. bool reserveDefinitionName = false,
})

Constructs a new Module with instance name name and definition name definitionName.

If reserveName is set, then the model will not build if it's unable to keep from uniquifying (changing) name to avoid conflicts.

If reserveDefinitionName is set, then code generation will fail if it is unable to keep from uniquifying definitionName to avoid conflicts.

Implementation

Module(
    {this.name = 'unnamed_module',
    this.reserveName = false,
    String? definitionName,
    this.reserveDefinitionName = false})
    : _uniqueInstanceName =
          Naming.validatedName(name, reserveName: reserveName) ?? name,
      _definitionName = Naming.validatedName(definitionName,
          reserveName: reserveDefinitionName);