Created
January 23, 2023 23:15
-
-
Save anilcancakir/c8fe926242959551df2f33c19eff2299 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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