getTotalStepsInInterval method

Future<int?> getTotalStepsInInterval(
  1. DateTime startTime,
  2. DateTime endTime
)

Get the total number of steps within a specific time period. Returns null if not successful.

Is a fix according to https://stackoverflow.com/questions/29414386/step-count-retrieved-through-google-fit-api-does-not-match-step-count-displayed/29415091#29415091

Implementation

Future<int?> getTotalStepsInInterval(
  DateTime startTime,
  DateTime endTime,
) async {
  final args = <String, dynamic>{
    'startTime': startTime.millisecondsSinceEpoch,
    'endTime': endTime.millisecondsSinceEpoch
  };
  final stepsCount = await _channel.invokeMethod<int?>(
    'getTotalStepsInInterval',
    args,
  );
  return stepsCount;
}