rekabhq / background_locator

A Flutter plugin for updating location in background.
MIT License
288 stars 328 forks source link

Getter not found: 'LocationCallbackHandler'. #224

Open thekavak opened 3 years ago

thekavak commented 3 years ago

Hi again :),

I am trying to implement your package at new flutter project. Before that I used your project on github. in startLocator method LocationCallbackHandler gives an error. I could not find what I need to call in to solve it.


      lib/main.dart:150:44: Error: Getter not found: 'LocationCallbackHandler'.
      BackgroundLocator.registerLocationUpdate(LocationCallbackHandler.callback,
                                               ^^^^^^^^^^^^^^^^^^^^^^^
    lib/main.dart:151:21: Error: Getter not found: 'LocationCallbackHandler'.
          initCallback: LocationCallbackHandler.initCallback,
                        ^^^^^^^^^^^^^^^^^^^^^^^
    lib/main.dart:157:24: Error: Getter not found: 'LocationCallbackHandler'.
          disposeCallback: LocationCallbackHandler.disposeCallback,
                           ^^^^^^^^^^^^^^^^^^^^^^^
    lib/main.dart:175:15: Error: Getter not found: 'LocationCallbackHandler'.
                  LocationCallbackHandler.notificationCallback)));
                  ^^^^^^^^^^^^^^^^^^^^^^^

    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.

                  ^^^^^^^^^^^^^^^^^^^^^^^

Also, when the location changes in the github project itself, the notification drops out. Where can I turn it off? And I want to write api here.

I wrote api into port.listen ((dynamic data), but it did not log, I would be glad if you could help me write the exact api to which part.

WilliBobadilla commented 3 years ago

I have the same problem, what can it can be?

jocelyngriselle commented 3 years ago

Hello,

i guess your are trying the code from the Wiki which is slightly incomplete, LocationCallbackHandler is just a Class containing all callbacks ( you have to create it yourself ) as you can see in the example here https://github.com/rekab-app/background_locator/blob/master/example/lib/location_callback_handler.dart

Cheers