CopyWith class

Annotation used to indicate that the copyWith extension should be generated for the given class.

Annotations
  • @Target({TargetKind.classType})

Constructors

CopyWith({bool? copyWithNull, bool? skipFields, String? constructor})
const

Properties

constructor String?
Set constructor if you want to use a named constructor. The generated fields will be derived from this constructor. If not set, the unnamed constructor is used.
final
copyWithNull bool?
Set copyWithNull to true if you want to use copyWithNull function that allows you to nullify the fields. E.g. myInstance.copyWithNull(id: true, name: true). Default is false.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
skipFields bool?
Prevent the library from generating copyWith functions for individual fields e.g. instance.copyWith.id("123"). If you want to use only copyWith(...) function. Default is false.
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