hydrated_state_notifier_hive 1.0.0 copy "hydrated_state_notifier_hive: ^1.0.0" to clipboard
hydrated_state_notifier_hive: ^1.0.0 copied to clipboard

An implementation of HydratedStorage from hydrated_state_notifier library which automatically persists and restores states built on top of hive.

example/lib/example.dart

import 'dart:io';

import 'package:hydrated_state_notifier/hydrated_state_notifier.dart';
import 'package:hydrated_state_notifier_hive/hydrated_state_notifier_hive.dart';
import 'package:path/path.dart' as path;

int calculate() {
  return 6 * 7;
}

const kIsWeb = identical(0, 0.0);

Future<void> setupStorage() async {
  HydratedStorage.storage = await HiveHydratedStorage.build(
    storageDirectoryPath: kIsWeb
        ? ''
        : (await Directory(path.join(Directory.current.path, '.cache'))
                .create())
            .path,
  );
}
2
likes
160
pub points
25%
popularity

Publisher

verified publishermagnificsoftware.com

An implementation of HydratedStorage from hydrated_state_notifier library which automatically persists and restores states built on top of hive.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

hive, hydrated_state_notifier, meta, synchronized

More

Packages that depend on hydrated_state_notifier_hive