liodali / OSM-Routing-Client-Dart

flutter package for osrm client api and open source routing service
https://pub.dev/packages/routing_client_dart
MIT License
18 stars 12 forks source link

Bugfix - Response parsing when the 'overview' parameter is set to 'none' #23

Closed eshjordan closed 7 months ago

eshjordan commented 7 months ago

Currently the Road.fromOSRMJson() function assumes that the geometry fields of responses is always present, and so throws an error when the overview parameter is set to none in the OSRMManager.getRoad() or OSRMManager.getTrip() functions. This fix is just to do a null check before trying to set the polyline member variable. Also added some unit tests to verify the correct functionality, and updated dependencies to get the unit tests running again, http_mock_adapter was throwing an error.