[Bug]: network_info_plus Linux getWifiSubmask wrong for /22

Open
#3,941 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
64/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
dart
Domain
networking

Research direction

Start at the Linux implementation of NetworkInfo.getWifiSubmask and compare its handling of the prefix reported by ip -4 addr show. Reproduce the issue on a /22 network and verify that the method returns 255.255.252.0 rather than 255.255.63.0; done means the reported subnet mask matches the OS value.

Written by the indexing model from the issue text.

Description

bug triage
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:

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
final info = NetworkInfo();
print(await info.getWifiIP());
print(await info.getWifiSubmask());
Logs
N/A
Flutter Doctor
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
  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
Dominant language
Dart
Stars
1.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fluttercommunity/plus_plugins

All issues in fluttercommunity/plus_plugins

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.