getObjectList<T> static method

Future<List<T>> getObjectList<T>(
  1. String filePath
)

Implementation

static Future<List<T>> getObjectList<T>(String filePath) async {
  final string = await getJsonString(filePath);
  final json = jsonDecode(string);
  if (json is List) {
    return json.map<T>((e) => _tryConverting(e)).toList();
  }
  return [];
}