convertMIList<T> function

List<T> convertMIList<T>(
  1. List data,
  2. T? fromJson(
    1. dynamic
    )
)

for use with MapsIndoors objects

Implementation

List<T> convertMIList<T>(List<dynamic> data, T? Function(dynamic) fromJson) {
  final List<T> list = List.empty(growable: true);
  for (final item in data) {
    final T? convert = fromJson(item);
    if (convert != null) {
      list.add(convert);
    }
  }
  return list;
}