Closed shubhamsinghmutualmobile closed 7 months ago
@bardram I have added a very quick (1-liner) fix for this issue here
Could you please review it?
Apologies that I have to bother you like this. This should be the last time I do so.
This is fixed with version 10.1.0
👍
Device / Emulator and OS
Describe the bug
After merging https://github.com/cph-cachet/flutter-plugins/pull/924, I realised that if I want to just write the
caffeine
value to the health store, I would still need to pass the following values asnull
:i.e. my code would look something like this:
which in itself is not a problem, but in order to make this
write
operation successful, I would need to ask the user to provide write permissions for all data types mentioned above which is not ideal.Ideally, if I just want to write the caffeine value, I should only need to ask for its specific permission from the user.
I would expect the API to behave in either of the following two ways:
The existing
writeMeal
method should only consider writing values to the health store for which the user has actually granted permission(s). For example, if the user has only granted permission forcaffeine
, then no matter what values are being sent forcaloriesConsumed
,carbohydrates
,protein
, orfatTotal
, the methodwriteMeal
would make attempt to write thecaffeine
ONLY.Along with having a method that clubs all nutrition values together (like
writeMeal
), we could also have separate methods for individual writing (e.g.writeCaffeine
,writeProtein
, etc).To Reproduce
The description should suffice
Expected behavior
Expected that the library would allow writing single nutrition values.
Actual behavior
The library clubs all nutrition values together and forces the user to grant permissions for even the values that he does NOT want to write.
Screenshots
N/A
Flutter doctor
Additional information
N/A