I am making my first baby steps with Leaflet in Flutter, so patience and URLs of tutorials, etc, are welcome.
Every piece of sample code that I can find gives me this error:
The method 'LatLng' isn't defined for the type '_MyHomePageState'. Try correcting the name to the name of an existing method, or defining a method named 'LatLng'.
See for instance the answer to How to setCenter() leaflet map in flutter,which has some very straightforward code.
This part of the code
new FlutterMap(
mapController: _mapController,
options: MapOptions(
minZoom: _minzoom,
maxZoom: _maxzoom,
center: LatLng(mylatitude,mylongitude), <=== error here
),
gives me the error.
I have had the same error with several code samples, copied from the internet. Could it be because I am using the latest version of the package, and those are old posts?
I am using
dependencies:
flutter_map: ^0.9.0
As per the install docs, but perhaps all the demos I found used something earlier?
I have the same problem with the code from https://github.com/johnpryan/flutter_map.
It must be something very basic, but, as I said, I am just starting out. Despite familiarity with Leaflet in AngularJs, I am stumped.
What's my problem, and where can I find a good, in-depth, full-featured, tutorial?
[Update] I have completely uninstalled Visual Studio Code (using Revo Uninstaller Pro, which thoroughly scours the registry & file system for left overs. After reinstalling VSC and adding only the Flutter plugin, I still get the problem.
I also installed Android Studio and only the Flutter plugin, with the same result :-(