getBoolOrNull method

bool? getBoolOrNull(
  1. String path, [
  2. bool? defaultValue
])

Implementation

bool? getBoolOrNull(String path, [bool? defaultValue]) {
  final value = get(path);
  if (value == null) return defaultValue;
  if (value is bool) return value;
  if (value is String) return value.toLowerCase().trim() == 'true';
  return defaultValue;
}