Closed erguncengiz closed 3 years ago
Can anyone please help me?
The solution that i found at below:
void stepCount() async {
final now = DateTime.now();
final results = await FitKit.read(
DataType.STEP_COUNT,
dateFrom: DateTime(now.year, now.month, now.day),
dateTo: DateTime.now(),
);
int steps = 0;
results.forEach((element) {
print(element);
steps += element.value;
});
print(steps);
}
Thx for that, awesome package! I copied the code that in example page to my app. When i tap to read button, i see values in my screen. The value like:
[FitData(value : 45, dateFrom: 2021-01-28 13:45:23.174, dateTo: ....)]
i just want to count only values like '45'.
How can i do that?