parseItem function Null safety

Map<String, dynamic> parseItem(
  1. dynamic item
)

Implementation

Map<String, dynamic> parseItem(dynamic item){
  Map<String, dynamic> res = {};
  if(item is String){
    dynamic rawItem = jsonDecode(item);
    return rawItem as Map<String, dynamic>;
  }else if(item is Map<String, dynamic>){
    return item;
  }
  return res;
}