initialize method

Future<GraphNotifier> initialize()

Initializes Hive local storage and box it depends on

Implementation

Future<GraphNotifier> initialize() async {
  if (isInitialized) return this;
  await _hiveLocalStorage.initialize();
  if (_hiveLocalStorage.clear) {
    await _hiveLocalStorage.deleteBox(_kGraphBoxName);
  }
  box = await _hiveLocalStorage.openBox(_kGraphBoxName);

  return this;
}