getBool method
- String path
Reads a boolean or a case-insensitive true / false string.
Implementation
bool getBool(String path) {
final value = _required(path);
if (value is bool) return value;
if (value is String) {
if (value.toLowerCase() == 'true') return true;
if (value.toLowerCase() == 'false') return false;
}
throw const ConfigTypeException('Expected a boolean.');
}