decodeJson function
Implementation
Map<String, Object?> decodeJson(dynamic data) {
if (data is String) {
return json.decode(data) as Map<String, Object?>;
}
if (data is Map && data.isEmpty) {
return <String, Object?>{};
}
return data as Map<String, Object?>;
}