RecordExtensionElement class

Specify that the annotated element should be included in a generated record extension.

This annotation is applicable to elements within an extension annotated with RecordExtension. When applied it specifies that the annotated element should be included in all generated record extensions for the extension in which the element is defined.

This annotation defines the return type (type) and the code (implementation) serving as the implementation.

Within type and implementation the following placeholders can be used:

  • {types}

    Substituted with the comma-separated list of the record element types, e.g. 'MyType<T$1>, MyType<T$1>, MyType<T$3>'.

  • {elements}

    Substituted with the comma-separated list of accessors for each element, e.g. '$1, $2, $3'.

  • {type-params}

    Substitude with the comma-separated List of the generated extension type parameters, e.g. 'T$1, T$2, T$3'.

The following elements are supported:

  • Property getters

Constructors

RecordExtensionElement.new({required String type, required String implementation, String? documentation})
Specify that the annotated element should be included in a generated record extension.
const

Properties

documentation String?
Documentation comment to insert if not null.
final
hashCode int
The hash code for this object.
no setterinherited
implementation String
The return type and implementation code of this element
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
The return type and implementation code of this element
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