dimanche 21 février 2021

Flutter google map how to instanciate a GoogleMapController outside of the GoogleMap's widget onCreated function for testings?

I'm using plugin google_maps_flutter 1.2.0, and i want to instanciate a GoogleMapController for testing some bloc's event, where the controller's value can't be null. Unfortunalty, i don't know how to do it, because to my knows, GoogleMapController can't be instanciate outside of the function 'OnCreated' of the GoogleMap() Widget.

 GoogleMap(onMapCreated: (GoogleMapController controller) {
                         // Can only be instanciate here
                        },
          );

It's impossible to do something like this :

  GoogleMapController controller = new GoogleMapsController();

I can only do this, and controller is null :

 GoogleMapController controller;

I tried multiple thing but nothing is working, can someone help me ?

Aucun commentaire:

Enregistrer un commentaire