plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Request]: (network_info_plus) Boolean flag to detect if current Wi-Fi is secure

Open affan3699 opened this issue 7 months ago • 3 comments

Plugin

network_info_plus

Use case

Problem:

I want to check whether the currently connected Wi-Fi network is secure or not, for example, if it is open (no password) or protected (e.g. WPA/WPA2/WPA3).

This is useful for showing security warnings to users or preventing sensitive operations on unsecured networks.

Right now, network_info_plus does not offer this, and it’s difficult to do manually in a cross-platform way.

The current network_info_plus plugin provides network info such as SSID, BSSID, and IP, but does not expose the Wi-Fi security protocol being used.

This limitation makes it difficult to:

  • Alert users when they are on unprotected/open networks
  • Comply with VAPT (Vulnerability Assessment and Penetration Testing) security requirements
  • Implement app level logic based on Wi-Fi trust level (e.g. blocking login, warning banners)

Proposal

Add a new method like:

Future<bool?> isSecureWifi();

which returns:

  • false → for open (No Password)
  • true → for WPA/WPA2/WPA3
  • null → if not connected or can't determine

Platform support:

iOS (14+):

  • Use NEHotspotNetwork.fetchCurrent().securityType (available in iOS 14+)
  • Requires proper entitlements (com.apple.developer.networking.wifi-info) and location permission

Android (12+):

  • Use WifiInfo.getCurrentSecurityType()
  • For older versions, fallback to analyzing WifiConfiguration.allowedKeyManagement if possible

Alternatives Tried

  • No Flutter plugin currently provides this.
  • Custom platform code is needed, but it would be better if network_info_plus provided this out-of-the-box.

affan3699 avatar Jun 25 '25 21:06 affan3699

Good feature to have.

obyman98 avatar Jul 03 '25 12:07 obyman98

Much needed feature

Shayanfarooqui avatar Jul 04 '25 18:07 Shayanfarooqui

Speaking for myself, I don’t think this feature should be added directly to network_info_plus. It comes with very strict usage requirements—like needing precise location permission, privacy declarations, and so on. For developers who don’t need it, it’s an unnecessary burden. I suggest writing it as a separate plugin, or conditionally integrating it into network_info_plus. In any case, it shouldn’t be included directly in network_info_plus.

StanleyCocos avatar Jul 09 '25 03:07 StanleyCocos