read method

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

Is called when a value has to be decoded.

Implementation

@override
HiveCacheImage read(BinaryReader reader) {
  final numOfFields = reader.readByte();
  final fields = <int, dynamic>{
    for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
  };
  return HiveCacheImage(
    url: fields[0] as String,
    binaryImage: fields[1] as Uint8List,
  );
}