decodeJson function

Map<String, dynamic> decodeJson({
  1. required String data,
})

Implementation

Map<String, dynamic> decodeJson({required String data}) {
  Map<String, dynamic> map = {};
  if (Platform.isAndroid) {
    map = jsonDecode(data);
  } else if (Platform.isIOS) {
    map = jsonDecode(jsonDecode(data));
  }
  return map;
}