readMap method
Reads a JSON object by key, returning an empty map when absent.
Implementation
Map<String, dynamic> readMap(String key) {
final decoded = readJson(key);
if (decoded is Map<String, dynamic>) return decoded;
if (decoded is Map) {
return decoded.map((key, value) => MapEntry(key.toString(), value));
}
return const {};
}