first commit
This commit is contained in:
15
lib/helpers/hive_creator.dart
Normal file
15
lib/helpers/hive_creator.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
// Package imports:
|
||||
|
||||
import 'package:hive_ce_flutter/hive_flutter.dart';
|
||||
|
||||
///
|
||||
/// Вспомогательный класс для открытия [Hive] хранилищ
|
||||
///
|
||||
class HiveCreator<T> {
|
||||
///
|
||||
/// Открывает [Hive] хранилище с типом [T]
|
||||
///
|
||||
Future<Box<T>> open(String name, [HiveCipher? cipher]) {
|
||||
return Hive.openBox<T>(name, encryptionCipher: cipher);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user