deven98 / shake

A flutter package for detecting phone shakes.
BSD 2-Clause "Simplified" License
92 stars 52 forks source link

Getting error setting listener in initState #1

Closed gijsbeijer closed 2 years ago

gijsbeijer commented 4 years ago

Hi,

I'm pretty new to flutter so forgive me if this is a noob question but my problem is as follows:

I've added the code exactly as in the example, so I've added it to the initState of my State. when I run the application however i get the following error(s):

E/SensorManager(25422): unregisterListenerImpl callingApp: co.appbrewery.magic8ball,callingPid:25422,callingUid:10261
E/SensorManager(25422): registerListenerImpl sensorName:lsm6ds3c Accelerometer Non-wakeup,isWakeUpSensor:false,callingApp: co.appbrewery.magic8ball,callingPid:25422,callingUid:10261

and my implementation

@override
  void initState() {

    super.initState();

    ShakeDetector detector = ShakeDetector.waitForStart(
        onPhoneShake: () {
          print('shake shake shake');
        }
    );

    detector.startListening();
  }

Do I have to add anything to the AndroidManifest.xml or am I missing anything else? Hope you can help me out!

Regards Gijs

deven98 commented 2 years ago

Hi,

Apologies for the late reply - fixing everything on the repo now. I'm unable to replicate this issue after testing.

I'm closing this issue since this is very old - if you happen to still have the same issue please feel free to reopen it and let me know any additional details about the error so I can replicate it.

Thanks.