readJson static method

Future readJson(
  1. String path
)

Implementation

static Future readJson(String path) async {
  if (await File('$path').exists()) {
    final file = await File('$path');
    String content = await file.readAsString();
    var jsonString = json.decode(content);
    return jsonString;
  }
  Scp.getInstance().log('File $path does not exist.');
  return null;
}