RecordExtension class

Annotation for generating record type extensions.

This annotation is applicable to extensions. When applied it specifies that the extension should be used as template for generating extensions on record types.

size record extensions are generated with the number of elements varying from 2 to size.

For example:

@RecordExtension(size: 3)
extension MyExtension<T> on MyType<T> {
...
}

Specifies that the following record extensions should be generated:

extension MyExtension2<T$1, T$2> on (MyType<T$1>, MyType<T$2> {
...
}

extension MyExtension3<T$1, T$2, T$3> on (
  MyType<T$1>,
  MyType<T$2>,
  MyType<T$3>
) {
...
}

Constructors

RecordExtension.new({required int size, String? documentation})
Specifies that size record extensions should be generated using the annotated element as a template.
const

Properties

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