WithType class

Override type of a field in a data class. The regular specified type has no effect so it's better not to specify it.

this is needed when you are using one sealed generated type in another.

This can be applied only to method arguments.

for example:

@Sealed(equality: Equality.data)
abstract class _Weather {
  void rainy(@WithType('int') rain);
}
Annotations
  • @Target({TargetKind.parameter, TargetKind.field, TargetKind.getter})

Constructors

WithType(String type)
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
type name. for example "int?", "double" or "Result
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited