2021-03-24 14:10:25 +07:00
|
|
|
library configurable;
|
|
|
|
|
|
|
|
import 'package:configurable/system_config.dart';
|
|
|
|
|
2021-03-24 16:39:10 +07:00
|
|
|
/// get config or null from system config
|
2021-03-24 14:10:25 +07:00
|
|
|
String? getConfigOrNull(String key, {String? defaultValue}) =>
|
|
|
|
SystemConfig.getOrNull(key, defaultValue: defaultValue);
|
2021-03-24 16:39:10 +07:00
|
|
|
|
|
|
|
/// get config with non-null from system config
|
2021-03-24 14:10:25 +07:00
|
|
|
String getConfig(String key, {String? defaultValue}) =>
|
|
|
|
SystemConfig.get(key, defaultValue: defaultValue);
|
2021-03-24 16:39:10 +07:00
|
|
|
|
|
|
|
/// check has config key or not from system config
|
2021-03-24 14:10:25 +07:00
|
|
|
bool hasConfigkey(String key) => SystemConfig.containsKey(key);
|
2021-03-24 16:39:10 +07:00
|
|
|
|
|
|
|
/// set config into memory
|
|
|
|
void setConfig(String key, String? value) => SystemConfig.set(key, value);
|