hive_multiisolate 1.3.2 copy "hive_multiisolate: ^1.3.2" to clipboard
hive_multiisolate: ^1.3.2 copied to clipboard

A class allowing the use of Hive across isolates. It opens the box, execute the operation and closes it immediately.

example/main.dart

import 'package:hive_multiisolate/hive_multiisolate.dart';

void main() async {
  var myBox = HiveMultiIsolateBox<String>('boxName', isMultiIsolate: true);

  // Just use the box as you would a normal Hive box, except it's async for all operations.
  await myBox.put('key', 'value');
  print(await myBox.get('key'));

  // You can have sync boxes by leaving isMultiIsolate as false.
  var syncBox = HiveMultiIsolateBox<String>('syncBox');
  await syncBox.open();
  await syncBox.put('key', 'value');
  print(syncBox.getSync('key'));
}
4
likes
160
points
79
downloads

Publisher

unverified uploader

Weekly Downloads

A class allowing the use of Hive across isolates. It opens the box, execute the operation and closes it immediately.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

hive

More

Packages that depend on hive_multiisolate