hive_built_value 2.0.6 copy "hive_built_value: ^2.0.6" to clipboard
hive_built_value: ^2.0.6 copied to clipboard

outdated

Lightweight and blazing fast key-value database written in pure Dart. Strongly encrypted using AES-256.

example/lib/main.dart

import 'dart:io';

import 'package:hive_built_value/hive_built_value.dart';

part 'main.g.dart';

@HiveType(typeId: 1)
class Person {
  Person({required this.name, required this.age, required this.friends});

  @HiveField(0)
  String name;

  @HiveField(1)
  int age;

  @HiveField(2)
  List<String> friends;

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

void main() async {
  var path = Directory.current.path;
  Hive
    ..init(path)
    ..registerAdapter(PersonAdapter());

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

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

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

  print(box.get('dave')); // Dave: 22
}
3
likes
0
points
161
downloads

Publisher

verified publishersealstudios.co.uk

Weekly Downloads

Lightweight and blazing fast key-value database written in pure Dart. Strongly encrypted using AES-256.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

crypto, meta

More

Packages that depend on hive_built_value