Skip to content

Instantly share code, notes, and snippets.

@anilcancakir
Created January 23, 2023 23:15
Show Gist options
  • Save anilcancakir/c8fe926242959551df2f33c19eff2299 to your computer and use it in GitHub Desktop.
Save anilcancakir/c8fe926242959551df2f33c19eff2299 to your computer and use it in GitHub Desktop.
class Config {
/// The singleton instance.
static final Config instance = Config();
/// All of the configuration items.
final Map<String, dynamic> _items = <String, dynamic>{};
/// Get the specified configuration value.
dynamic get(String key) {
return _items[key];
}
/// Set a given configuration value.
void set(String key, dynamic value) {
_items[key] = value;
}
/// Determine if the given configuration value exists.
bool has(String key) {
return _items.containsKey(key);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment