bpillon / google_maps_cluster_manager

Simple Flutter clustering library for Google Maps
https://pub.dev/packages/google_maps_cluster_manager
MIT License
121 stars 94 forks source link

The sample code in README doesn't work #50

Closed ninoko1995 closed 1 year ago

ninoko1995 commented 1 year ago

The sample code in README does not work at all.

import "package:latlng/latlng.dart";
import 'package:google_maps_cluster_manager/google_maps_cluster_manager.dart';

class Place with ClusterItem {
  final String name;
  final LatLng latLng;

  Place({required this.name, required this.latLng});

  @override
  LatLng get location => latLng;
}

The below is the problem text

'Place.location' ('LatLng Function()') isn't a valid override of 'ClusterItem.location' ('LatLng Function()').dart[invalid_override](https://dart.dev/diagnostics/invalid_override)

cluster_item.dart(5, 14): The member being overridden.

So I cannot use this package. Please fix this problem!

ninoko1995 commented 1 year ago

To use LatLng class, we should import not latlng but google_maps_flutter. By replacing, this problem is fixed.