Error.deserialize constructor

Error.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory Error.deserialize(BinaryReader reader) {
  // Read [Error] fields.
  final code = reader.readInt32();
  final text = reader.readString();

  // Construct [Error] object.
  final returnValue = Error(
    code: code,
    text: text,
  );

  // Now return the deserialized [Error].
  return returnValue;
}