getJsonObject function

Object? getJsonObject(
  1. Data data,
  2. bool debug
)

Extracts JsonObject from Data object

Implementation

Object? getJsonObject(Data data, bool debug) {
  Object obj = data.obj;
  if (obj is String) {
    try {
      return jsonDecode(obj);
    } catch (e) {
      printLog(
        "Error in function getJsonObject: $e",
        debug,
        color: LogColor.red,
      );
      return null;
    }
  }
  return obj;
}