You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After merging #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 as null:
caloriesConsumed
carbohydrates
protein
fatTotal
i.e. my code would look something like this:
final wasWriteSuccessful =await health.writeMeal(
time.subtract(constDuration(seconds:1)),
time,
null,
null,
null,
null,
'Caffeine',
caffeineVolumeGram /1000,
MealType.SNACK,
);
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 for caffeine, then no matter what values are being sent for caloriesConsumed, carbohydrates, protein, or fatTotal, the method writeMeal would make attempt to write the caffeine 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
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.3, on macOS 13.6.4 22G513 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] Connected device (4 available)
! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• No issues found!
Additional information
N/A
The text was updated successfully, but these errors were encountered:
Device / Emulator and OS
Describe the bug
After merging #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
The text was updated successfully, but these errors were encountered: