cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
527 stars 625 forks source link

[Health 10.2.0] Unable to set useHealthConnectIfAvailable to false after setting it to true. #969

Open sezer-healthlogix opened 4 weeks ago

sezer-healthlogix commented 4 weeks ago

Device / Emulator and OS

Android

Describe the bug

There's an issue where when useHealthConnectIfAvailable is set to true it is unable to be set back to false. This locks the user into health connect even after setting back to false.

To Reproduce

Set:

      final health = Health();
      await health.configure(
        useHealthConnectIfAvailable: true,
      );

Then try to set it back to false:

      final health = Health();
      await health.configure(
        useHealthConnectIfAvailable: false,
      );

It will still attempt to use Google fit as useHealthConnectIfAvailable does not get updated.

Expected behavior

Expected to be able to retrieve Google fit data after setting useHealthConnectIfAvailable to false.

Actual behavior

As useHealthConnectIfAvailable is stuck on true it still tries to retrieve health connect data instead of google fit