title: How to dispose Flutter google map's controller
body: <p>I was using <a href="https://pub.dev/packages/google_maps_flutter" rel="nofollow noreferrer">google_maps_flutter</a> library in my project. While i hot reload the map or back to map from another view then it crashes with message :</p>
  
  <pre><code>Exception has occurred.
  PlatformException (PlatformException(error, java.lang.IllegalStateException: Trying to create an already created platform view, view id: 0
      at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:85)
      at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:96)
  </code></pre>
  
  <p>So i was trying to dispose the map and its controller. i got a code snippet to dispose <a href="https://medium.com/pharos-production/using-google-maps-on-flutter-for-android-d62b724d86b9" rel="nofollow noreferrer">in this article</a> 
  So i added this code snippet:</p>
  
  <pre><code>@override
    void dispose() {
      _disposeController();
      super.dispose();
    }
  
    Future&lt;void&gt; _disposeController() async{
      final GoogleMapController controller = await _controller.future;
      //controller.dispose();
    }
  </code></pre>
  
  <p>but uncommenting last line was giving this error:</p>
  
  <pre><code> The method 'dispose' isn't defined for the class 'GoogleMapController'.
  Try correcting the name to the name of an existing method, or defining a method named 'dispose'.
  </code></pre>
  
  <p>then how can i dispose the controller?</p>