map method

  1. @override
List<GeofenceModel> map(
  1. List<Map<String, dynamic>?> input
)
override

Implementation

@override
List<GeofenceModel> map(List<Map<String, dynamic>?> input) {
  return input
      .where((element) => element != null && element.isNotEmpty)
      .map((geofenceMap) => GeofenceModel(
          id: geofenceMap!["id"] as String,
          lat: geofenceMap["lat"] as double,
          lon: geofenceMap["lon"] as double,
          radius: geofenceMap["radius"] as double,
          waitInterval: geofenceMap["waitInterval"] as double?,
          triggers: mapTriggers(geofenceMap["triggers"])))
      .toList();
}