read method

  1. @override
ChatwootUser read(
  1. BinaryReader reader
)
override

Is called when a value has to be decoded.

Implementation

@override
ChatwootUser read(BinaryReader reader) {
  final numOfFields = reader.readByte();
  final fields = <int, dynamic>{
    for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
  };
  return ChatwootUser(
    identifier: fields[0] as String?,
    identifierHash: fields[1] as String?,
    name: fields[2] as String?,
    email: fields[3] as String?,
    avatarUrl: fields[4] as String?,
    customAttributes: fields[5] as dynamic,
  );
}