From 0cf5803ac5a4b081a5aeaf46d3d44c69a2926e7c Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Fri, 14 May 2021 17:05:16 +0700 Subject: [PATCH] Fixed and removed the example example_flutter_secure_storage_provider.dart --- CHANGELOG.md | 5 +- ...ample_flutter_secure_storage_provider.dart | 90 ------------------- pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 92 deletions(-) delete mode 100644 example/example_flutter_secure_storage_provider.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index 140e55f..93e1252 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,4 +27,7 @@ ## 1.0.6 - Add async function support - Add functions for set and remove for system config and file functions -- Add TextFormatter for format the string with args \ No newline at end of file +- Add TextFormatter for format the string with args + +## 1.0.7 +- Removed example "example_flutter_secure_storage_provider.dart" \ No newline at end of file diff --git a/example/example_flutter_secure_storage_provider.dart b/example/example_flutter_secure_storage_provider.dart deleted file mode 100644 index 8393952..0000000 --- a/example/example_flutter_secure_storage_provider.dart +++ /dev/null @@ -1,90 +0,0 @@ -import 'package:flutter_secure_storage/flutter_secure_storage.dart'; -import 'package:configurable/mutable_configurable_provider.dart'; - -class LocalStorageProvider - extends MutableConfigurationProvider { - static FlutterSecureStorage _storage; - - FlutterSecureStorage _getStorage() { - if (_storage == null) { - _storage = new FlutterSecureStorage(); - } - - return _storage; - } - - @override - bool containsKey(String key) { - var _hasKey = false; - _getStorage().containsKey(key: key).then((value) => _hasKey = value); - - return _hasKey; - } - - @override - Future containsKeyAsync(String key) async { - return await _getStorage().containsKey(key: key); - } - - @override - String? getOrNull(String key, {String defaultValue}) { - String _value; - _getStorage().read(key: key).then((value) => { - _value = value - }); - - if (_value == null && defaultValue != null) { - return defaultValue; - } else { - return _value; - } - } - - @override - Future getOrNullAsync(String key, {String defaultValue}) async { - String _value = await _getStorage().read(key: key); - - if (_value == null && defaultValue != null) { - return defaultValue; - } else { - return _value; - } - } - - @override - void remove(String key) { - _getStorage().delete(key: key); - } - - @override - Future removeAsync(String key) async { - await _getStorage().delete(key: key); - } - - @override - void removeAll() { - _getStorage().deleteAll(); - } - - @override - Future removeAllAsync() async { - await _getStorage().deleteAll(); - } - - @override - void set(String key, String value) { - _getStorage().write(key: key, value: value); - } - - @override - Future setAsync(String key, String value) async { - await _getStorage().write(key: key, value: value); - } - - @override - Future setAllAsync(Map configs) async { - configs.entries.forEach((element) { - setAsync(element.key, element.value); - }); - } -} diff --git a/pubspec.yaml b/pubspec.yaml index b124cd6..11d459d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: configurable description: System Configuration and Dotenv Environment for Dart and Flutter -version: 1.0.6 +version: 1.0.7 homepage: https://github.com/CUBETIQ/system-config-dart repository: https://github.com/CUBETIQ/system-config-dart.git