zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.25k stars 622 forks source link

Make `connectivity_plus` optional. #1415

Open doawoo opened 8 months ago

doawoo commented 8 months ago

Is your feature request related to a problem? Please describe. connectivity_plus should be an optional dependency -- We're currently using Flutter in a very slimmed down embedded Linux environment that does not have dbus, or NetworkManager. The issue is, this package uses connectivity_plus to check if the client is "online" in generated Flutter Hooks with subscriptions. We're connecting to a local GQL server, on the same device, so this check isn't useful, and is instead creating very noisy stack traces as the plugin tries to connect to NetworkManager's dbus. (Which obviously does not exist.)

Describe the solution you'd like I think a good solution would be to allow either a flag to disable this connectivity check in the useSubscription hook, or allow us to override that connectivity check function with a custom one.

Describe alternatives you've considered Installing dbus, and NetworkManager is obviously a solution, but that bloats our Firmware up by a huge amount, and adds even more dependancies we need to maintain in our Linux distribution.

Additional context Using:

vincenzopalazzo commented 5 months ago

This would be really nice to have

doawoo commented 1 month ago

I'll eventually get to building a PR for this, but, for those who are running into this: just override connectivity_plus in your pubspec.yaml to a local package, and return a sane list and stream for the two functions required.