fluttercommunity / fluttercommunity/plus_plugins
[Request]: Return if the connection uses a VPN instead of returning VPN as a result
- Dominant language
- Dart
- Stars
- 1.9k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
### Plugin
connectivity_plus
### Use case
When using the plugin to detect if the user is on mobile data, vs non metered networks currently there is no way to tell if a user is connected when using a VPN. Because only VPN is returned we can't know if it's actually connected to the internet, or if it's a metered connection.
### Proposal
I would propose a breaking change. Instead of returning an enum, return an object similar to this:
```dart
class ConnectivityResult {
final ConnectivityType type; // An enum with the current enum values except vpn
final bool vpnConnection;
}
```
This allows actually checking the connectivity type when using a VPN. Currently there is no way to do that, at least on Android. On iOS since the VPN information is not exposed the flag could be false.
Contributor guide
Assessment
This issue has not been assessed yet.