saveGoogleHealthConnectElement method

Future<int> saveGoogleHealthConnectElement(
  1. GoogleHealthConnectElement element
)

Implementation

Future<int> saveGoogleHealthConnectElement(
    GoogleHealthConnectElement element) async {
  final recordedElement =
      await getGoogleHealthConnectElementByDateAndParameter(
    element.type,
    element.dateFrom,
    element.dateTo,
  );

  if (recordedElement == null) {
    return googleHealthConnectElementBox!.add(element);
  }
  return 0;
}