computeSleepScore method

SleepScoreResult? computeSleepScore(
  1. SleepScoreInput input
)

Typed form of sleepScoreComputeJson. Returns null if the engine rejected the input or the JSON couldn't be parsed.

Implementation

SleepScoreResult? computeSleepScore(SleepScoreInput input) {
  final json = sleepScoreComputeJson(input.toJsonString());
  if (json == null) return null;
  try {
    return SleepScoreResult.fromJsonString(json);
  } catch (_) {
    return null;
  }
}