configurable/lib/configurable.dart
Sambo Chea 649f25b265 - Add mutable configuration provider
- Split tests file
- Fixed and nullable functions
- Able to set or remove config from system config
2021-03-24 16:39:10 +07:00

18 lines
619 B
Dart

library configurable;
import 'package:configurable/system_config.dart';
/// get config or null from system config
String? getConfigOrNull(String key, {String? defaultValue}) =>
SystemConfig.getOrNull(key, defaultValue: defaultValue);
/// get config with non-null from system config
String getConfig(String key, {String? defaultValue}) =>
SystemConfig.get(key, defaultValue: defaultValue);
/// check has config key or not from system config
bool hasConfigkey(String key) => SystemConfig.containsKey(key);
/// set config into memory
void setConfig(String key, String? value) => SystemConfig.set(key, value);