readSpecifiedDateSteps static method

Future<List> readSpecifiedDateSteps(
  1. DataType type,
  2. DateTime dateFrom,
  3. DateTime dateTo
)

Implementation

static Future<List<dynamic>> readSpecifiedDateSteps(
    DataType type, DateTime dateFrom, DateTime dateTo) async {
  return await (_channel
      .invokeMethod('readSteps', {
        "type": _dataTypeToString(type),
        "date_from": dateFrom.millisecondsSinceEpoch,
        "date_to": (dateTo).millisecondsSinceEpoch,
      })
      .then((value) => value)
      .catchError((_) => throw UnsupportedException(type), test: (e) {
        if (e is PlatformException) return e.code == 'unsupported';
        return false;
      }) as FutureOr<List<dynamic>>);
}