66 lines
1.9 KiB
Dart
66 lines
1.9 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'user_progress.dart';
|
|
|
|
// **************************************************************************
|
|
// TypeAdapterGenerator
|
|
// **************************************************************************
|
|
|
|
class UserProgressAdapter extends TypeAdapter<UserProgress> {
|
|
@override
|
|
final int typeId = 1;
|
|
|
|
@override
|
|
UserProgress read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return UserProgress(
|
|
totalPoints: fields[0] as int,
|
|
currentPoints: fields[1] as int,
|
|
lastCheckInDate: fields[2] as DateTime?,
|
|
consecutiveCheckIns: fields[3] as int,
|
|
unlockedAchievements: (fields[4] as Map?)?.cast<String, DateTime>(),
|
|
totalFocusMinutes: fields[5] as int,
|
|
totalDistractions: fields[6] as int,
|
|
totalSessions: fields[7] as int,
|
|
checkInHistory: (fields[8] as List?)?.cast<DateTime>(),
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, UserProgress obj) {
|
|
writer
|
|
..writeByte(9)
|
|
..writeByte(0)
|
|
..write(obj.totalPoints)
|
|
..writeByte(1)
|
|
..write(obj.currentPoints)
|
|
..writeByte(2)
|
|
..write(obj.lastCheckInDate)
|
|
..writeByte(3)
|
|
..write(obj.consecutiveCheckIns)
|
|
..writeByte(4)
|
|
..write(obj.unlockedAchievements)
|
|
..writeByte(5)
|
|
..write(obj.totalFocusMinutes)
|
|
..writeByte(6)
|
|
..write(obj.totalDistractions)
|
|
..writeByte(7)
|
|
..write(obj.totalSessions)
|
|
..writeByte(8)
|
|
..write(obj.checkInHistory);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is UserProgressAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|