valueAsBool<T extends bool?> static method
Implementation
static T valueAsBool<T extends bool?>(Object? value) {
if (value is T) return value;
if (value == null && _isNull<T>()) return null as T;
if (value is bool) return value as T;
if (value is String) {
final boolStr = value.toLowerCase();
if (boolStr == 'true') return true as T;
if (boolStr == 'false') return false as T;
}
throw JSONHelperException("Failed to parse value as boolean.");
}