decodeJson function

Map<String, Object?> decodeJson(
  1. dynamic data
)

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?>;
}