AliatiSoftware / nominatim_location_picker

Nominatim has a Completely free geocoding ! Now we have MapBox Support as well
https://aliatisoftware.com/
Apache License 2.0
16 stars 20 forks source link

Error when pressing the selection floating action button #5

Open shashoug opened 4 years ago

shashoug commented 4 years ago

hi developers! when i select the location the app crashes with error: The following NoSuchMethodError was thrown while finalizing the widget tree:

The method 'cancel' was called on null.
Receiver: null
Tried calling: cancel()

// When the exception was thrown, this was the stack:

0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)

1 _MapBoxLocationPickerState.dispose (package:nominatim_location_picker/src/widget/mapBoxLocationPicker.dart:114:20)

2 StatefulElement.unmount (package:flutter/src/widgets/framework.dart:4729:12)

3 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1922:13)

4 _InactiveElements._unmount. (package:flutter/src/widgets/framework.dart:1920:7)

...

My code snippet:

`Widget getLocationWithMapBox() {
    return MapBoxLocationPicker(
      popOnSelect: true,
      context: context,
      apiKey: "API_KEY",
      limit: 10,
      customMapLayer: TileLayerOptions(
        urlTemplate:
        "URL_TEMPLATE",
        additionalOptions: {
          'accessToken':
          'ACCESS_TOKEN',
          'id': 'mapbox.mapbox-streets-v7'
        },
      ),
      language: 'ar',
      country: 'sd',

      searchHint: 'Search',
      awaitingForLocation: "Fetchning coordinates...",
      onSelected: (place) async{
        _formKey.currentState.reset();

//        setState(() async {
//          _pickedLocationText = place.geometry
//              .coordinates; //
//          // Example of how to call the coordinates after using the Mapbox Location Picker
//
//        });
      _pickedLocationText = place.geometry.coordinates;
print(_pickedLocationText);
//        _submitOrderToFireStore();
      },

    );`
Loopex2019 commented 4 years ago

Any updates ?

shashoug commented 4 years ago

Yep, i got this fixed. I did a little of costumaizations

On Mon, Aug 3, 2020, 4:47 PM Loopex2020 notifications@github.com wrote:

Any updates ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AliatiSoftware/nominatim_location_picker/issues/5#issuecomment-668063772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZ52AXPCAP4DQUNKZ35M3LR63EWPANCNFSM4N7PHQLA .