getAppleHealthElementByDateAndParameter method

Future<AppleHealthElement?> getAppleHealthElementByDateAndParameter(
  1. String type,
  2. String from,
  3. String to,
  4. String value,
)

Implementation

Future<AppleHealthElement?> getAppleHealthElementByDateAndParameter(
  String type,
  String from,
  String to,
  String value,
) async {
  try {
    return appleHealthElementBox!.values.firstWhere((element) =>
        element.type == type &&
        element.dateFrom == from &&
        element.dateTo == to &&
        element.healthValue == value);
  } catch (_) {}
  return null;
}