ModuleId extension type

Identifies a module: a lower snake_case name such as go_router.

A module package declares its id once, as a constant of its module class:

final class GoRouterModule extends SmfModule {
  static const id = ModuleId('go_router');
  // ...
}

Other modules refer to that constant in ModuleDescriptor.dependsOn, so that a dependency on a module is also a pub dependency on its package; the contract tests check that the two agree, because writing ModuleId('go_router') by hand would bypass it. Variants key their variants by the id's value instead, because a feature must not depend on the packages of every provider it supports.

The id is a zero-cost wrapper over the name: ids compare by name, work as keys of constant maps, and print as the plain name. The pipeline rejects registries with invalid ids; see isValid.

on
Implemented types

Constructors

ModuleId(String value)
const
ModuleId.parse(String value)
Parses value, such as a module name given on the command line.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
lowerCamelCase → String
The id as a lowerCamelCase Dart identifier: firebase_core becomes firebaseCore.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
upperCamelCase → String
The id as an UpperCamelCase Dart identifier: firebase_core becomes FirebaseCore.
no setter
value → String
final

Methods

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

isValid(String value) → bool
Whether value is a valid module id: lower snake_case, see SmfNames.isSnakeCase.