convertListToModelWithErrorCount<T> method
- List<
Bs4Element> data, - T fromJson(
- Bs4Element map
inherited
Implementation
ConversionResult<T> convertListToModelWithErrorCount<T>(
List<Bs4Element> data,
T Function(Bs4Element map) fromJson,
) {
final results = <T>[];
var errorCount = 0;
for (final e in data) {
try {
results.add(fromJson(e));
} catch (e) {
errorCount++;
}
}
return ConversionResult<T>(results, errorCount);
}