Steps
Sets steps listener
Sets the steps change listener stepsChangeEveStm, and the result is saved in the "event" through the data stream return, which is returned as a StepsChangeBean object.
_blePlugin.stepsChangeEveStm.listen(
(StepsChangeBean event) {
/// Do something with new state
});
Callback Description(event):
StepsChangeBean:
callback value | callback value type | callback value description |
---|---|---|
stepInfo | StepsChange | steps information |
timeType | int | days,from StepsTimeType |
StepsChange:
callback value | callback value type | callback value description |
---|---|---|
steps | int | steps |
distance | int | Distance (in meters) |
calories | int | Calories (units of kilocalories) |
time | int | Activity duration, (the default value is 0, which means the watch does not support) |
StepsTimeType:
type | value type | value description |
---|---|---|
todaySteps | 1 | today steps |
yesterdaySteps | 2 | yesterday steps |
dayBeforeYesterdaySteps | 3 | day before yesterday steps |
Gets today's steps
Get today's step count data. The query result will be obtained through the stepsChangeEveStm monitoring stream, and the type is todaySteps.
_blePlugin.querySteps;
Gets historical steps
The watch can save the number of activity steps in the past three days, and can query the number of activity steps in a certain day.
Gets the activity steps data in a certain day. The query result will be obtained through the stepsChangeEveStm listening stream, and the type is yesterdaySteps or dayBeforeYesterdaySteps.
_blePlugin.queryHistorySteps(HistoryTimeType);
Parameter Description :
HistoryTimeType:
Use yesterdaySteps and dayBeforeYesterdaySteps parameters.
value | value type | value description |
---|---|---|
yesterdaySteps | int | 1 |
dayBeforeYesterdaySteps | int | 2 |
yesterdaySleep | int | 3 |
dayBeforeYesterdaySleep | int | 4 |
Sets steps Detail listener
Set a step detail listener stepsDetailEveStm, and the result is saved in the "event" through the data stream return, which is returned as a StepsDetailBean object.
_blePlugin.stepsDetailEveStm.listen(
/// Do something with new state,for example:
(StepsDetailBean event) {
setState(() {
_dateType = event.dateType!;
_timeInterval = event.timeInterval!;
_stepsList = event.stepsList!;
});
},
),
Callback Description(event):
StepsDetailBean:
callback value | callback value type | callback value description |
---|---|---|
dateType | int | Date type, today or yesterday |
timeInterval | int | time interval, in minutes |
stepsList | List< int > | steps list |
Gets steps Detail
Some watches support categorical statistics for the past two days.
Gets classification statistics for the past two days. The query result will be obtained through the stepsDetailEveStm listening stream and saved in "event" as the StepsDetailBean object.
_blePlugin.queryStepsDetail(StepsDetailDateType);
Parameter Description :
StepsDetailDateType:
type | value | value description |
---|---|---|
todayStepsCategory | 0 | today steps category |
yesterdayStepsCategory | 2 | yesterday steps category |