No implementation found for method camera animate on channel map recenter button

Viewed 811

Flutter map recenter button not working

dependency version = google_maps_flutter: ^2.1.6

Implement code

Future<void> _goToTheLake() async {
LatLng lat = LatLng(ctrl.getLat().value, ctrl.getLang().value);
print(lat);
final GoogleMapController controller = await _controller.future;
controller.animateCamera(
    CameraUpdate.newCameraPosition(
    CameraPosition(target: lat, zoom: 15.0)));
setState(() {});

}

E/flutter (15144): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method camera#animate on channel plugins.flutter.io/google_maps_0) E/flutter (15144): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7) E/flutter (15144):

enter image description here

if anyone have solution please drop comment

Thanks

1 Answers
dependency version = google_maps_flutter:

Leave your dependency like this. Then save it if it's still not working go through these steps:

In terminal:

flutter clean

flutter pub get

flutter run
Related