Skip to main content

read method

User read (BinaryReader reader)

<span class="feature">override</span>

<p>Is called when a value has to be decoded.</p>

Implementation

@override
User read(BinaryReader reader) \{
final numOfFields = reader.readByte();
final fields = \<int, dynamic\>\{
for (int i = 0; i \< numOfFields; i++) reader.readByte(): reader.read(),
\};
return User(
adminFor: (fields[9] as List?)?.cast\<OrgInfo\>(),
createdOrganizations: (fields[8] as List?)?.cast\<OrgInfo\>(),
email: fields[5] as String?,
firstName: fields[3] as String?,
id: fields[2] as String?,
image: fields[6] as String?,
joinedOrganizations: (fields[7] as List?)?.cast\<OrgInfo\>(),
lastName: fields[4] as String?,
authToken: fields[0] as String?,
refreshToken: fields[1] as String?,
membershipRequests: (fields[10] as List?)?.cast\<OrgInfo\>(),
);
\}