encodeObjectOrNull<T> method

  1. @override
void encodeObjectOrNull<T>(
  1. String key,
  2. T? value, {
  3. int? id,
  4. Encodable<T>? using,
})
override

Encodes a nullable object of type T for the given key or id.

When the value is not null, this behaves the same as encodeObject.

Implementation

@override
void encodeObjectOrNull<T>(String key, T? value, {int? id, Encodable<T>? using}) {
  if (value == null) {
    _value[key] = null;
    return;
  }
  _value[key] = _encode(value, using);
}