write method

  1. @override
void write(
  1. BinaryWriter writer,
  2. Asset obj
)

Is called when a value has to be encoded.

Implementation

@override
void write(BinaryWriter writer, Asset obj) {
  writer
    ..writeByte(1)
    ..writeByte(0)
    // We use the raw protocol config map to avoid issues with nested types
    // and inconsistent toJson/fromJson behaviour with the Asset class.
    ..write(obj.protocol.config);
}