getPropsBool function
Extracts a bool value from props.
Handles bool, int (0/1), and String ('true'/'false') representations.
Implementation
bool getPropsBool(
Map<String, dynamic> props,
String key, [
bool defaultValue = false,
]) {
final value = props[key];
if (value is bool) return value;
if (value is int) return value != 0;
if (value is String) {
return value.toLowerCase() == 'true' || value == '1';
}
return defaultValue;
}