Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Flutterでヘルスケアデータへアクセスする

 Flutterでヘルスケアデータへアクセスする

Asakura Shinsuke

September 10, 2021
Tweet

More Decks by Asakura Shinsuke

Other Decks in Programming

Transcript

  1. ࢖͍ํ JNQPSUQBDLBHFIFBMUIIFBMUIEBSU w Πϯϙʔτ List<HealthDataType> types = [ HealthDataType.STEPS, ];

    HealthFactory health = HealthFactory(); bool accessWasGranted = await health.requestAuthorization(types); w ΞΫηεڐՄ
  2. ࢖͍ํ List<HealthDataType> types = [ HealthDataType.STEPS, ]; try { List<HealthDataPoint>

    healthData = await health.getHealthDataFromTypes(startDate, endDate, types); _healthDataList.addAll(healthData); } catch (e) { print("Caught exception in getHealthDataFromTypes: $e"); } _healthDataList = HealthFactory.removeDuplicates(_healthDataList); _healthDataList.forEach((x) { steps += x.value.round(); }); setState(() { _state = _healthDataList.isEmpty ? AppState.NO_DATA : AppState.DATA_READY; }); w σʔλͷऔಘ