Open Vera-Spoettl opened 3 months ago
Hi @Vera-Spoettl
The plugin exposes the interface used in the connections using NWPathMonitor
method usesInterfaceType
, documented here: https://developer.apple.com/documentation/network/nwpath/2998729-usesinterfacetype
I expect that it will only report on the actual connection used (in this case ethernet) rather than on all the available connections.
If listing all the available interfaces is a use case you need, you would have to use instead availableInterfaces
, which I think would list them all: https://developer.apple.com/documentation/network/nwpath/2998720-availableinterfaces
Adding this is not on our plans, but we could make this a feature request, or you are also welcome to submit a PR with an idea for it.
Adding this is not on our plans
In fact I wanted to take a look at it as have an adapter to connect Ethernet to USB-C in MacBook. Also did this research for available API features and curios about how availableInterfaces
would work here.
Recently I wanted to complete my PR with adding a new API to get all available types as it was suggested in the review, but had a second thought on the reasoning to expand the API this way. It doesn't make much sense to have all these types listed as the OS uses only one for network activity anyway.
@Vera-Spoettl Would you mind sharing use cases when having all types listed is beneficial?
Platform
MacOS 14.4.1
Plugin
connectivity_plus
Version
6.0.3
Flutter SDK
Flutter 3.22.0 • channel stable
Steps to reproduce
Run https://github.com/fluttercommunity/plus_plugins/blob/main/packages/connectivity_plus/connectivity_plus/example/lib/main.dart
Even while my Mac is connected to ethernet and Wifi, only the ethernet connection is shown. As a list of ConnectivityResult is returned,
Code Sample
Logs
Flutter Doctor
Checklist before submitting a bug
flutter pub upgrade
flutter clean