mapbox-maps-flutter icon indicating copy to clipboard operation
mapbox-maps-flutter copied to clipboard

ArgumentError when calling _tileStore.setMapboxAPIUrl with Uri

Open tchengck opened this issue 11 months ago • 0 comments

Description: I encountered an issue when calling _tileStore.setMapboxAPIUrl(Uri.parse('https://api.mapbox.com/'));. This results in the following exception:

ArgumentError (Invalid argument: Instance of '_SimpleUri')

Steps to Reproduce:

  1. Call _tileStore.setMapboxAPIUrl(Uri.parse('https://api.mapbox.com'));
  2. Observe the exception being thrown.

Expected Behavior:

The function should accept the parsed URI and not throw an ArgumentError.

Actual Behavior:

The function throws ArgumentError (Invalid argument: Instance of '_SimpleUri').

Possible Cause:

It seems like _tileStore.setMapboxAPIUrl might be expecting a String instead of a Uri object, as described in its documentation: "Accepts a string, or null for resetting to the default value." If this is the case, the method should ensure proper type handling.

Environment:

  • Package Version: 2.5.1
  • Platform: Android and iOS

Additional Context:

Any insights into whether this is an expected behavior or a bug would be appreciated. If _tileStore.setMapboxAPIUrl is meant to accept a Uri, it might need an update to handle this exception properly.

Thanks!

tchengck avatar Jan 29 '25 15:01 tchengck