getPropsInt function
Extracts an int value from props.
Handles both int and String representations.
Implementation
int getPropsInt(
Map<String, dynamic> props,
String key, [
int defaultValue = 0,
]) {
final value = props[key];
if (value is int) return value;
if (value is String) return int.tryParse(value) ?? defaultValue;
if (value is double) return value.toInt();
return defaultValue;
}