Extension<T extends Object?> class abstract

IMPORTANT: All properties (other than value) need to be defined within the super constructor!

Creates an extension method for the enum.



Value

The value to be returned by the extension method for this enum field

The value is the ONLY argument to be passed through the constructor

  • It is not recommended to use named arguments
  • Positioned arguments are supported

Default Value

The default value to be used if EnumValue.extensions
does not declare a value for this Extension


Method Name

The name of the method to be created

During generation, the method name will be converted to camelCase


Method Type

Specifies how the generated method will be created


Doc Comment

The doc comment for the method

multi-line strings are supported

During generation, /// will be prepended to each new line

default: "/// @nodoc"


Allow Nulls

If set to true, the method will be created with a nullable return type

default: false

Implementers

Constructors

Extension(T value, {T? defaultValue, required String methodName, MethodType methodType = MethodType.maybeMap, String? docComment, bool allowNulls = false})
IMPORTANT: All properties (other than value) need to be defined within the super constructor!
const

Properties

allowNulls bool
If set to true, the method will be created with a nullable return type
final
defaultValue → T?
The default value to be used if EnumValue.extensions
does not declare a value for this Extension
final
hashCode int
The hash code for this object.
no setterinherited
methodName String
The name of the method to be created
final
methodType MethodType
Specifies how the generated method will be created
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The value to be returned by the extension method for this enum field
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