WithEquality class

Override equality in generated classes.

If applied to top class it will change equality for all sub classes.

If applied to a sub class it will change equality for the specified sub class.

This can be applied to both sub classes and top class.

Sub class equality will be based on top class equality if equality is not specified. By default top class equality is Equality.data.

for example:

@WithPrefix('Lollipop')
abstract class _Weather { // will become Weather
  void sunny(); // will become LollipopSunny

  void rainy(int rain); // will become LollipopRainy
}
Annotations
  • @Target({TargetKind.classType, TargetKind.method})

Constructors

WithEquality(Equality equality)
const

Properties

equality Equality
equality.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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