I am currently writing an app where the user needs to know the IP address of their phone/tablet. Where would I find this information?
I only want to know what the local
I guess you mean the local IP of the currently connected Wifi network, right?
EDITED
In this answer, I used to suggest using the NetworkInterface in 'dart:io', however NetworkInterface.list
is not supported in Android (as pointed out by Mahesh). The wifi package provides that, but later this was incorporated to the flutter's connectivity
plugin. In Oct/2020 the methods for that were moved from the connectivity
to the wifi_info_flutter plugin.
So just go for wifi_info_flutter
and call await WifiFlutter().getWifiIP()
.
By the way, you may also want to check if Wifi is available using the connectivity plugin in flutter/plugins. Here's an example of how to check if wifi is available.