8
submitted 1 month ago by Rexios@lemm.ee to c/flutter@programming.dev

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();
}
no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here
this post was submitted on 06 Jul 2024
8 points (100.0% liked)

Flutter

527 readers
3 users here now

Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC

founded 1 year ago
MODERATORS