readJsonAs<T> static method
读取JSON文件(泛型)
Implementation
static Future<T> readJsonAs<T>(
String filePath, T Function(Map<String, dynamic>) fromJson) async {
try {
final json = await readJson(filePath);
return fromJson(json);
} catch (e) {
throw Exception('Failed to read JSON as type: $e');
}
}