Required class

Used on global option getters to ensure a value is provided via CLI or environment if annotated.

For example:

class Options extends GlobalOptions {
  @Required()
  static String get foo {
    return GlobalOptions.value;
  }
}

GlobalOptions.value will now throw an exception if it would have returned null. We need this annotation because of the way global options are implemented as methods and not method parameters that can be implicitly marked as required by not providing a default value.

Constructors

Required([bool value = true])
const

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
value bool
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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

fromMetadata(DeclarationMirror p) Required
hasMetadata(DeclarationMirror p) bool