DataField class

Customize data class field generation

Annotations
  • @Target({TargetKind.field})

Constructors

DataField({bool comparable = true, Equality? equality, bool stringify = true, bool updatable = true, Object? stringifier(dynamic value)?})
Ex. @DataClass() class Product { @DataField(updatable: false) final String field; }
const

Properties

comparable bool
It will be considered in the Object.== and Object.hashCode methods.
final
equality → Equality?
This equality is used in the following methods Object.== and Object.hashCode.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringifier → (Object? Function(dynamic value)?)
Allows you to override the toString
final
stringify bool
It will be considered in the Object.toString method
final
updatable bool
It will be considered in the copyWith and/or change methods
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