getAssetJsonList static method

Future<List> getAssetJsonList(
  1. String path
)

获取asset中的jsonMap数据

Implementation

static Future<List<dynamic>> getAssetJsonList(String path) async {
  try {
    final js = await getAssetJson(path);
    if (js is List) {
      return js;
    }
    return [];
  } catch (e) {
    debugPrint('json文件不存在: $path');
    return [];
  }
}