readInt method
Reads key as an integer, or null.
Implementation
int? readInt(String key) {
final value = raw[key];
if (value is int) return value;
if (value is num) return value.toInt();
if (value is String) return int.tryParse(value);
return null;
}