isar / isar/hive

Subclasses fall back to base class after box.close if register the base class adapter

Open
#179 2 comments 0 reactions 1 assignee Claimed by @simc View on GitHub
documentation question
Dominant language
Dart
Stars
4.4k
Forks
449
PR merge metrics
No merged PRs in 30d

Description

Example: base class: `Vehicle extends HiveObject`, sub class: `Car extends Vehicle` `Boat extends Vehicle`.

If I do `Hive.registerAdapter(VehicleAdapter());`, then when re-opening the box, all values become of type `Vehicle`.

It took me quite some time to find out, if this is a known feature, better to have it mentioned in the doc.

**Steps to Reproduce**
https://gist.github.com/X-Wei/13e3a009578767945874764187c89d6d#file-main-dart-L19

**Version**
- Platform: Linux
- Flutter version: 1.12
- Hive version: 1.3.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.