Modifier<T extends Object> class

A wrapper that distinguishes "set this value" from "leave unchanged" and "explicitly set to null" — safer than nullable parameters for update()- style APIs.

Usage:

  • Modifier(x) — set to x (including false, 0, "", empty maps).
  • Modifier.nullable() — explicitly clear the field to null.
  • Pass null (omit the parameter) — leave the field unchanged.

Constructors

Modifier(T? value)
Sets the field to value. false, 0, empty strings/maps/lists are treated as valid values, not as "no value".
const
Modifier.nullable()
Explicitly clears the field to null.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
isNull → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → T?
final

Methods

modify({T? old}) → T?
Resolves this modifier against an existing old value.
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