decodeJSON function

dynamic decodeJSON(
  1. String rawJson
)

Implementation

dynamic decodeJSON(String rawJson) {
  try {
    return convert.json.decode(rawJson);
  } on FormatException catch (e) {
    LogService.error('invalid json format: '
        '\n${e.toString().split("FormatException:").last}');
    if (!Platform.isWindows) exit(0);
  } on Exception catch (e) {
    LogService.error('Unexpected error $e');
    if (!Platform.isWindows) exit(0);
  }
}