Im writing a flutter program to receive the data from the google fit using the Health package,Im able to fetch weekly data as
weeklyStepData = await health.getTotalStepsInInterval(
now.subtract(const Duration(days: 7)), now);
But when i try to fetch the monthly data as
final yesterday = now.subtract(Duration(days: 30));
// var newDate = new DateTime(now.year, now.month, now.day - 29);
monthlyStepData =
await health.getTotalStepsInInterval(yesterday, now) ?? 0;
Its giving me exception "Caught exception in getTotalStepsInInterval: PlatformException(error, Must specify a valid minimum duration: -2134967296, null, java.lang.IllegalArgumentException: Must specify a valid minimum duration: -2134967296"
How to get the monthly steps data