Home > Software engineering >  flutter (google_maps_flutter) variable
flutter (google_maps_flutter) variable

Time:04-22

I want to change the coordinates to be taken from the Internet I tried many ways, but it doesn't work enter image description here

enter image description here

  RxDouble locationmap1 = 11.620215.obs ;
  RxDouble locationmap2 = 12.025192.obs ;
  Completer<GoogleMapController> controller = Completer();
  static final CameraPosition kGooglePlex = CameraPosition(
    target: LatLng (hhh,locationmap2.value),
    zoom: 14.4746,
  );

CodePudding user response:

Make the variables static:

static RxDouble locationmap1 = 11.620215.obs ;
static RxDouble locationmap2 = 12.025192.obs ;
  Completer<GoogleMapController> controller = Completer();
  static final CameraPosition kGooglePlex = CameraPosition(
    target: LatLng (locationmap1.value,locationmap2.value),
    zoom: 14.4746,
  );
  • Related