flutter-geocoding icon indicating copy to clipboard operation
flutter-geocoding copied to clipboard

getting Platform Exception

Open shihabmi7 opened this issue 3 years ago • 0 comments

🐛 Bug Report

I am getting an error when moving camera on Google Map & calling placemarkFromCoordinates api in onCameraMove callback in GoogleMap widget. I got data successfully at beginning & getting error after 5-6 times successful api calling. I saw related issues posted here that mentioned that google & apple has limit daily quota limit to get address details in each apps i guess. But it is highly appreciated that share your opinion about the error what i am getting.

Error Details

2022-05-31 07:26:52.997234+0600 Runner[807:224485] flutter: PlatformException(IO_ERROR, Error Domain=kCLErrorDomain Code=2 "(null)", null, null)

Reproduction steps

Future<void> onCameraMove(CameraPosition position) async {
    printData("onCameraMove: " +
        position.target.latitude.toString() +
        " " +
        position.target.longitude.toString());
    initialPosition = position.target;
    try {
      if (initialPosition != null) {
        List<Placemark> placeMark = await placemarkFromCoordinates(
            initialPosition.latitude, initialPosition.longitude,
            localeIdentifier: "en_US");

        if (placeMark.isNotEmpty) {
          pMark.value = placeMark[0];
          locationText.value = initialPosition.latitude.toString() +
              "," +
              initialPosition.longitude.toString();
          printData("Location text: " + locationText.value);
        }
      }
    } on PlatformException catch (e) {
      printData(e.toString());
    }
  }
GoogleMap(
              onCameraMove: controller.onCameraMove,
              zoomControlsEnabled: false,
              myLocationEnabled: true,
              onMapCreated: (GoogleMapController pController) {
                controller.mapController.complete(pController);
              },
              markers: {},
              mapType: MapType.normal,
              initialCameraPosition: controller.currentCameraPosition,
            ),

Configuration

Version: 2.0.4

Platform:

  • [*] :iphone 6 Plus: iOS 12.5.5
  • [ ] :robot: Android

shihabmi7 avatar May 31 '22 01:05 shihabmi7