hive_ce 2.8.0+2 copy "hive_ce: ^2.8.0+2" to clipboard
hive_ce: ^2.8.0+2 copied to clipboard

Hive Community Edition - A spiritual continuation of Hive v2

example/lib/main.dart

import 'dart:io';

import 'package:example/hive/hive_registrar.g.dart';
import 'package:hive_ce/hive.dart';

class Person {
  Person({required this.name, required this.age, required this.friends});

  String name;
  int age;
  List<String> friends;

  @override
  String toString() {
    return '$name: $age';
  }
}

void main() async {
  final path = Directory.current.path;
  Hive
    ..init(path)
    ..registerAdapters();

  final box = await Hive.openBox('testBox');

  final person = Person(
    name: 'Dave',
    age: 22,
    friends: ['Linda', 'Marc', 'Anne'],
  );

  await box.put('dave', person);

  print(box.get('dave')); // Dave: 22
}
84
likes
160
points
2.54k
downloads

Publisher

verified publisheriodesignteam.com

Weekly Downloads

Hive Community Edition - A spiritual continuation of Hive v2

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

Apache-2.0 (license)

Dependencies

crypto, meta, web

More

Packages that depend on hive_ce