Small fix

This commit is contained in:
2025-06-27 16:02:39 +03:00
parent 5f78dfb603
commit 74f5b9872a
2 changed files with 110 additions and 0 deletions
+85
View File
@@ -0,0 +1,85 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'hive_adapters.dart';
// **************************************************************************
// AdaptersGenerator
// **************************************************************************
class ColorAdapter extends TypeAdapter<Color> {
@override
final typeId = 0;
@override
Color read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Color((fields[0] as num).toInt());
}
@override
void write(BinaryWriter writer, Color obj) {
writer
..writeByte(1)
..writeByte(0)
..write(obj.value);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is ColorAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class IconDataAdapter extends TypeAdapter<IconData> {
@override
final typeId = 1;
@override
IconData read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return IconData(
(fields[0] as num).toInt(),
fontFamily: fields[1] as String?,
fontPackage: fields[2] as String?,
matchTextDirection: fields[3] == null ? false : fields[3] as bool,
fontFamilyFallback: (fields[4] as List?)?.cast<String>(),
);
}
@override
void write(BinaryWriter writer, IconData obj) {
writer
..writeByte(5)
..writeByte(0)
..write(obj.codePoint)
..writeByte(1)
..write(obj.fontFamily)
..writeByte(2)
..write(obj.fontPackage)
..writeByte(3)
..write(obj.matchTextDirection)
..writeByte(4)
..write(obj.fontFamilyFallback);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is IconDataAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
+25
View File
@@ -0,0 +1,25 @@
# Generated by Hive CE
# Manual modifications may be necessary for certain migrations
# Check in to version control
nextTypeId: 2
types:
Color:
typeId: 0
nextIndex: 1
fields:
value:
index: 0
IconData:
typeId: 1
nextIndex: 5
fields:
codePoint:
index: 0
fontFamily:
index: 1
fontPackage:
index: 2
matchTextDirection:
index: 3
fontFamilyFallback:
index: 4