Flutter : map dependencie crashes the app

Issue

I’m trying to use google map with flutter so i’m using the dependencie “google_maps_flutter”
version: “0.5.18”
The problem is when I add the line below (in my pubsec.yaml)–>

google_maps_flutter: ^0.5.16
dependecies img

the app crashes.

Below is the picture of the error. I’ve tried to look what 15.0.1 and 16.0.1 were refering to but I have no idea.
error img

Good to know :
When I add the above line the following code is automatically added.
changes in the pubsec.lock file after adding above line

Solution

Apparently the error was in my dependencie (pubsec.yaml file) It seems location and google_maps_flutter aren’t compatible. Either I had to remove one to make the other work.

Edit :

The plugin “geocoder: ^0.1.2” does work. I can successfully display location (lat & long) from typing addresses or by passing lat & long as parameters.
geocoder docs : https://pub.dev/packages/geocoder

Answered By – ItsNotMyFault

Answer Checked By – Katrina (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.