kvs-coder / health_kit_reporter

A Flutter wrapper for the HealthKitReporter library
https://pub.dev/packages/health_kit_reporter
MIT License
38 stars 38 forks source link

Could the predicate param be optional in some cases? #34

Closed adamzemmoura closed 2 years ago

adamzemmoura commented 2 years ago

Firstly, thanks for creating this library! It's great! I just have a quick question / request...

Is your feature request related to a problem? Please describe.

Our usecase is to register for background updates for a number of QuantityTypes using the observerQuery method, which takes a non-optional predicate. I see from Apple's docs the predicate is optional : A predicate that limits the samples matched by the query. Pass nil if you want to receive updates for every new sample of the specified type. Essentially we don't want to specify an end date to continually get updates.

Describe the solution you'd like

Make the predicates optional wherever possible.

Describe alternatives you've considered

The only work around to the non-optional predicate I can think of is to pick an arbitrary date well into the future.

kvs-coder commented 2 years ago

Hi @adamzemmoura

good point, thank you, I will check this

kvs-coder commented 2 years ago

sorry for the delay, I published version 2.0.0 of the lib, please try it!