opt: blacklist (#501)

This commit is contained in:
My-Responsitories
2025-03-23 19:13:07 +08:00
committed by GitHub
parent a8428e52d2
commit edf84fcc8f
7 changed files with 58 additions and 29 deletions

View File

@@ -0,0 +1,26 @@
import 'package:hive/hive.dart';
class SetIntAdapter extends TypeAdapter<Set<int>> {
@override
final int typeId = 11;
@override
Set<int> read(BinaryReader reader) {
return reader.readIntList().toSet();
}
@override
void write(BinaryWriter writer, Set<int> obj) {
writer.writeIntList(obj.toList());
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is SetIntAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}