readJson static method

Future<Map<String, dynamic>> readJson(
  1. String path
)

从文件中读取JSON格式的数据。

Implementation

static Future<Map<String, dynamic>> readJson(String path) async {
  File file = File(path);
  String jsonString = await file.readAsString();
  return json.decode(jsonString);
}