dzocesrce

Untitled

Apr 7th, 2026
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. points: route.polylinePoints
  2. .map((point) {
  3. final lat = point['latitude'];
  4. final lng = point['longitude'];
  5.  
  6. if (lat is num && lng is num) {
  7. final latDouble = lat.toDouble();
  8. final lngDouble = lng.toDouble();
  9.  
  10. if (latDouble >= 41.0 &&
  11. latDouble <= 41.5 &&
  12. lngDouble >= 21.2 &&
  13. lngDouble <= 21.8) {
  14. return LatLng(latDouble, lngDouble);
  15. }
  16. }
  17.  
  18. return null;
  19. })
  20. .whereType<LatLng>() // 🔥 removes nulls safely
  21. .toList(),
Advertisement
Add Comment
Please, Sign In to add comment