dispose method

Future<void> dispose()

Close all boxes and cleanup

Implementation

Future<void> dispose() async {
  if (_isInitialized) {
    await _userBox?.close();
    await _analyticsBox?.close();
    await _engagementBox?.close();
    await _settingsBox?.close();

    _userBox = null;
    _analyticsBox = null;
    _engagementBox = null;
    _settingsBox = null;

    _isInitialized = false;
    debugPrint('HiveStorageService disposed');
  }
}