Skip to content

Commit

Permalink
Fix for ip address for ethernet connected windows and linux devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
nissmotion committed Feb 21, 2023
1 parent 96b19b7 commit b7329e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frosthaven_assistant/lib/services/network/network_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ class NetworkInformation {
developer.log('Failed to get Wifi IPv4', error: e);
wifiIPv4.value = 'Failed to get Wifi IPv4';
for (var interface in await NetworkInterface.list()) {
if (interface.name == "Ethernet") {
//searching for eth should fix the ethernet ip address issue on ethernet connections on windows and linux
if (interface.name.toLowerCase().contains("eth")) {
for (var address in interface.addresses) {
if (address.type == InternetAddressType.IPv4) {
wifiIPv4.value = address.address; //default to ipv4 ethernet address if no wifi
Expand Down

0 comments on commit b7329e2

Please sign in to comment.