clearToken static method

Future<void> clearToken({
  1. required String key,
})

Clear the token from memory and Hive. Call this on logout.

Implementation

static Future<void> clearToken({required String key}) async {
  _memoryToken = null;
  final box = await Hive.openBox<String>('server_auth');
  await box.delete(key);
}