hive icon indicating copy to clipboard operation
hive copied to clipboard

Support for record types

Open alexobviously opened this issue 1 year ago • 0 comments

Since Dart 3 we have had records. They're great and I use them extensively. I just ran into a problem though - Hive doesn't seem to support them yet, and whenever trying to save objects that include them, you get an error like this:

HiveError (HiveError: Cannot write, unknown type: (int, int). Did you forget to register an adapter?)

It's also not possible to generate type adapters like this:

@HiveType(typeId: 3)
typedef IntVec = (int, int);

(although this solution would not be great anyway)

alexobviously avatar Dec 16 '23 18:12 alexobviously