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