configDouble function
Reads a double value from json at key. Accepts both int and double.
Returns null if missing or wrong type.
Implementation
double? configDouble(Map<String, Object?> json, String key) {
final value = json[key];
return value is num ? value.toDouble() : null;
}