Closed nongtiny closed 3 years ago
@nongtiny Thank you for using the Fitness plugin. Let's try it under the same conditions and see how we can fix the problem.
Thanks for your fast response.
It seems like if the GoogleFit doesn't have data from the start parameter it will fail.
I tried lastMidnight.subtract(const Duration(days: 2))
. It also fail.
Now, I'm using timeUnit: TimeUnit.minutes
. If I change to TimeUnit.days
, it works fine.
@nongtiny Thank you for continuing to share the situation. Are you having the same problem when using "TimeUnit.minutes"?
Yes, I am.
Now, I have to fetch 2 times to make it works correctly. The first-time fetching is for past step data, it uses timeUnit : TimeUnit.days
. The second time for today step. It uses timeUnit: TimeUnit.minutes
Hello.
First of all, Thanks for creating this library.
I found an issue. I can't catch errors in
Fitness.read
function. This makes the app stop.I tried to get the Step start from
2021-06-02 23:05:00.000
toDateTime.now()
I already wrapped this function with
try-catch
, but it still can't catch the error.When I tried to get the step from last midnight by using
final DateTime lastMidnight = new DateTime(now.year, now.month, now.day);
It works fine and returns an empty array.
Thanks in advance.