fluttercommunity / fluttercommunity/plus_plugins
[Bug]: network_info_plus Linux getWifiSubmask wrong for /22
- Langage dominant
- Dart
- Étoiles
- 1.9k
- Forks
- 1.3k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
### Platform
Linux Ubuntu
### Plugin
network_info_plus
### Version
8.2.1
### Flutter SDK
3.44.2
### Steps to reproduce
### Preconditions
1. Linux Desktop
2. Wi-Fi on a network whose prefix is not /8, /16 or /24 (I.e. Deco /22 -> mask `255.255.252.0`)
### Steps
1. Confirm the real mask from the OS:
```
ip -4 addr show
```
Expect something like: `inet 192.168.68.x/22 `→ mask `255.255.252.0`.
Run a Flutter Linux app that calls:
```dart
final info = NetworkInfo();
print(await info.getWifiIP());
print(await info.getWifiSubmask());
```
### Expected
getWifiSubmask() → 255.255.252.0 (same as /22)
### Actual
getWifiSubmask() → 255.255.63.0
### Code Sample
```dart
final info = NetworkInfo();
print(await info.getWifiIP());
print(await info.getWifiSubmask());
```
### Logs
```shell
N/A
```
### Flutter Doctor
```shell
flutter doctor -v
[✓] Flutter (Channel stable, 3.44.2, on Ubuntu 26.04 LTS 7.0.0-28-generic, locale en_US.UTF-8) [54ms]
• Flutter version 3.44.2 on channel stable at /home/redge/fvm/versions/3.44.2
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c9a6c48423 (7 weeks ago), 2026-06-10 15:52:41 -0700
• Engine revision 77e2e94772
• Dart version 3.12.2
• DevTools version 2.57.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
enable-uiscene-migration
[✗] Android toolchain - develop for Android devices [71ms]
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) [20ms]
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop [407ms]
• Ubuntu clang version 21.1.8 (6ubuntu1)
• cmake version 4.2.3
• ninja version 1.13.2
• pkg-config version 2.5.1
! Unable to access driver information using 'eglinfo'.
It is likely available from your distribution (e.g.: apt install mesa-utils)
[✓] Connected device (1 available) [187ms]
• Linux (desktop) • linux • linux-x64 • Ubuntu 26.04 LTS 7.0.0-28-generic
[✓] Network resources [823ms]
• All expected network resources are available.
```
### Checklist before submitting a bug
- [x] I searched issues in this repository and couldn't find such bug/problem
- [x] I Google'd a solution and I couldn't find it
- [x] I searched on StackOverflow for a solution and I couldn't find it
- [x] I read the README.md file of the plugin
- [x] I'm using the latest version of the plugin
- [x] All dependencies are up to date with `flutter pub upgrade`
- [x] I did a `flutter clean`
- [x] I tried running the example project
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par l’implémentation Linux de NetworkInfo.getWifiSubmask et comparez la manière dont elle traite le préfixe indiqué par `ip -4 addr show`. Reproduisez le problème sur un réseau /22 et vérifiez que la méthode renvoie 255.255.252.0 au lieu de 255.255.63.0 ; le travail est terminé lorsque le masque de sous-réseau indiqué correspond à la valeur du système d’exploitation.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- dart
- Domaine
- networking
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 64/100