Since Hive v2 has been abandoned and v3/v4 are nowhere to be seen I decided to hard fork Hive into Hive Community Edition (hive_ce, hive_ce_fluter, hive_ce_generator). Originally hive_ce was just going to be in maintenance mode to keep up to date with the evolving Flutter/Dart ecosystem (mainly Flutter WASM support right now), but there are some things that bothered me too much to ignore.
First of all… Hive v2 didn’t support Sets. Why? I don’t know but hive_ce does. Hive boxes natively support the Set type and the generator supports classes with Set fields.
One of the main pain points with TypeAdapters was remembering to register them all. Well forget no longer because hive_ce_generator generates an extension method on Hive to register them all in one go:
import 'package:your_package/hive_registrar.g.dart';
void main() {
final path = Directory.current.path;
Hive
..init(path)
..registerAdapters();
}