I'm using 0.10.1 version with example code:
FlutterMap(
options: new MapOptions(
center: new LatLng(51.5, -0.09),
zoom: 13.0,
),
layers: [
new TileLayerOptions(
urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
subdomains: ['a', 'b', 'c']
),
new MarkerLayerOptions(
markers: [
new Marker(
width: 80.0,
height: 80.0,
point: LatLng(51.5, -0.09),
builder: (ctx) =>
new Container(
child: new FlutterLogo(),
),
),
],
),
],
)
And getting this error on new LatLng(51.5, -0.09) line:
The constructor returns type 'dynamic' that isn't of expected type 'LatLng'.
Undefined class 'LatLng'. Try changing the name to the name of an existing class, or creating a class with the name 'LatLng'.
Resolved by importing it:
import 'package:latlong/latlong.dart';
This is how the package was originally designed, since those types are defined in a separate package, we expect users to import that package.
Alternatively, package:latlong/latlong.dart could be exported from package:flutter_map/flutter_map.dart, if that makes more sense.
Most helpful comment
Resolved by importing it: