setUpTestHive function Null safety

Future<void> setUpTestHive()

Initializes a Hive in a temporary directory.

Be sure to run tearDownTestHive once your test has completed.

Implementation

Future<void> setUpTestHive() async {
  final tempDir = await getTempDir();
  Hive.init(tempDir.path);
}