OrNullEncodable<T> class

An Encodable that can encode T or null.

Prefer using AsNullableEncodable.orNull instead of the constructor.

Implemented types
Available extensions

Constructors

OrNullEncodable.new(Encodable<T> codable)
const

Properties

codable Encodable<T>
final
hashCode int
The hash code for this object.
no setterinherited
orNull Encodable<T?>

Available on Encodable<T>, provided by the AsNullableListEncodable extension

Returns an Encodable that can encode T or null.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

encode(T? value, Encoder encoder) → void
Encodes the value using the encoder.
override
future() Encodable<Future<T>>

Available on Encodable<T>, provided by the AsFutureEncodable extension

Returns an Encodable that can encode a future of T.
list() Encodable<List<T>>

Available on Encodable<T>, provided by the AsListEncodable extension

Returns an Encodable that can encode a list of T.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set() Encodable<Set<T>>

Available on Encodable<T>, provided by the AsSetEncodable extension

Returns an Encodable that can encode a set of T.
stream() Encodable<Stream<T>>

Available on Encodable<T>, provided by the AsFutureEncodable extension

Returns an Encodable that can encode a stream of T.
toCsv(Iterable<T> value) String

Available on Encodable<T>, provided by the CsvEncodable extension

Encodes a list of objects into a CSV string.
toCsvBytes(Iterable<T> value) List<int>

Available on Encodable<T>, provided by the CsvEncodable extension

toJson(T value) String

Available on Encodable<T>, provided by the JsonEncodable extension

toJsonBytes(T value) List<int>

Available on Encodable<T>, provided by the JsonEncodable extension

toMap(T value) Map<String, dynamic>

Available on Encodable<T>, provided by the StandardEncodable extension

toMsgPack(T value) List<int>

Available on Encodable<T>, provided by the MsgPackEncodable extension

toProgressiveJson(T value) List<int>

Available on Encodable<T>, provided by the ProgressiveJsonEncodable extension

toProgressiveJsonStream(T value) Stream<List<int>>

Available on Encodable<T>, provided by the ProgressiveJsonEncodable extension

Encodes the value to a Stream of progressive JSON bytes.
toString() String
A string representation of this object.
inherited
toValue(T value) Object?

Available on Encodable<T>, provided by the StandardEncodable extension

Operators

operator ==(Object other) bool
The equality operator.
inherited