Closed kyeshmz closed 1 year ago
@kyeshmz what do you mean by:
we don't really use the callback from the future
For calls such as Posthog.capture
you don't really need to await, but for Posthog.isFeatureEnabled
you do otherwise the return is the Future and not the boolean.
I mean that all the exposed methods are Future
They are void
, but Future<void>
instead since it's an async method, this is how the language works, so you have the option to either await
or not, if we make the option to only void
, then the user does not have the option to await if they want to.
I'll close it as not being a bug.
https://dart.dev/tools/linter-rules/unawaited_futures
You can just do unawaited(doSomething());
As most of the library is about exposing the method channels, it seems like we can use unawaited for most of the code, as we don't really use the callback from the future. Should there be an update to the examples?