I want to build a step counter widget with flutter but don't know how can I convert the accelerometer sensor data of X, Y and Z axis to the step counter with the help of sensor flutter package.
Asked
Active
Viewed 1,224 times
-1
-
does the plugin implements step data for android sensor api and ios healthkit? – Tree Jun 05 '18 at 04:38
-
@Tree no the plugin does't provides any implementation regarding steps. Have a look at the link https://pub.dartlang.org/packages/sensors – Tushar Rai Jun 05 '18 at 04:42
-
than you would need to fork the plugin to get the data, or write your own. Maybe ask the owner if he wants to do it – Tree Jun 05 '18 at 04:50
-
Can you share any of the plugin link which could work with flutter – Tushar Rai Jun 05 '18 at 05:33
-
there is none. Check the accelerometer plugin and see if you can modify it for flutter – Tree Jun 05 '18 at 15:24
1 Answers
-1
I think trying to do this accurately from accelerometer data may be tricky, so you may be better trying to do it natively in a plugin. For example, Android has a Step Counter sensor type:
https://developer.android.com/reference/android/hardware/Sensor#TYPE_STEP_COUNTER
If you insist on doing it from the accelerometer data, I think you probably want to count the direction changes (count every other one), but I expect making it accurate (eg. trying to ignore things that aren't steps) will be non-trivial.

Danny Tuppeny
- 40,147
- 24
- 151
- 275