Some checks failed
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
32 lines
882 B
Dart
32 lines
882 B
Dart
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
|
|
class SecureStorageService {
|
|
static Future<String?> get(String key) async {
|
|
final prefs = await SharedPreferences.getInstance();
|
|
return prefs.getString(key);
|
|
}
|
|
|
|
static Future<void> _setImp(SharedPreferences prefs, String key, String value) async {
|
|
await prefs.setString(key, value);
|
|
}
|
|
|
|
static Future<void> set(String key, String? value) async {
|
|
final prefs = await SharedPreferences.getInstance();
|
|
if (value == null) {
|
|
return delete(key);
|
|
}
|
|
return _setImp(prefs, key, value);
|
|
}
|
|
|
|
static Future<bool> containsKey(String key) async {
|
|
final prefs = await SharedPreferences.getInstance();
|
|
return prefs.containsKey(key);
|
|
}
|
|
|
|
static Future<void> delete(String key) async {
|
|
final prefs = await SharedPreferences.getInstance();
|
|
await prefs.remove(key);
|
|
}
|
|
}
|