readMap function
Implementation
Map<String, Object?> readMap(Object? value) {
if (value is! Map<Object?, Object?>) {
throw const FormatException('Expected a map.');
}
return value.map((Object? key, Object? item) {
if (key is! String) {
throw const FormatException('Expected string map keys.');
}
return MapEntry<String, Object?>(key, item);
});
}