How do I get Geolocation API to work in Dartium?


I’m trying to test in Dartium browser using the Geolocation API. In particular I try doing the following

    ..then((pos) {

    ..catchError((PositionError error) {
      window.alert("Error code: ${error.code}, Error message: ${error.message}");
    ..whenComplete(() => window.alert("complete"))

Ignoring the fact I’m using window.alert here, All I get is an error with the following message “Error code: 2, Error message: Network location provider at ‘‘ : Returned error code 400.”

However the same code works in Google Chrome when I use “pub serve”. It also works with Firefox. How do I overcome this error, and get it to work in Dartium? Is it even possible?


I took a look at the 403 bug and tried using the fix specified on this page, and when I first tried this, I got my credentials and setting wrong, I was getting a 403 error, but once that was resolved, and all the APIs enabled, plus the environment settings of


I was back to “Network location provider at ‘‘ : Returned error code 400.”, so I conclude it isn’t the same issue. Though if someone can prove me wrong, I’d be happy.


This is a bug. I’ve answered my own question below.


This is a bug.

I posted this question on!topic/web/UMJHJlQH7wc, where Seth Ladd asked me to open a bug.

I’ve opened a bug for this, So hopefully this will be resolved soon.

Answered By – James Hurford

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *