MaybeExtension<T extends Object?> class abstract

{@macro enum_assist_annotation.extension}

{@macro enum_assist_annotation.method_type.maybe_map}


Value (required)

{@macro enum_assist_annotation.extension.value}


Method Name (required)

{@macro enum_assist_annotation.extension.method_name}


Default Value (required)

{@macro enum_assist_annotation.extension.default_value}


Doc Comment (optional)

{@macro enum_assist_annotation.extension.doc_comment}


Allow Nulls (optional)

{@macro enum_assist_annotation.extension.allow_nulls}


example:

class ExampleExt extends MaybeExtension<String> {
  const ExampleExt(String value) : super(
    value,
    methodName: 'example',
    defaultValue: 'default',
    docComment: 'Example Extension',
    allowNulls: false,
  );
}
Inheritance

Constructors

MaybeExtension(T value, {required String methodName, required T defaultValue, String? docComment, bool allowNulls = false})
{@macro enum_assist_annotation.extension}
const

Properties

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

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