saveAppleHealthElement method

Future<int> saveAppleHealthElement(
  1. AppleHealthElement element
)

Implementation

Future<int> saveAppleHealthElement(AppleHealthElement element) async {
  final recordedElement = await getAppleHealthElementByDateAndParameter(
    element.type,
    element.dateFrom,
    element.dateTo,
  );

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