kamus-kesehatan/lib/services/my_storage.dart

26 lines
387 B
Dart
Raw Normal View History

2024-02-04 12:57:23 +00:00
import 'package:get_storage/get_storage.dart';
class MyStorage {
final box = GetStorage();
init() async {
await GetStorage.init();
}
write(String key, dynamic value) async {
await box.write(key, value);
}
read(String key) {
return box.read(key);
}
remove(String key) async {
await box.remove(key);
}
clear() async {
await box.erase();
}
}