feat: remove unused network mask

This commit is contained in:
Tien Do Nam
2023-01-10 01:52:49 +01:00
parent 5a8b3f96d3
commit 977d575072
5 changed files with 1 additions and 14 deletions
-1
View File
@@ -40,7 +40,6 @@
"infoBox": {
"ip": "IP:",
"port": "Port:",
"subnetMask": "Subnet mask:",
"alias": "Alias:"
}
},
-1
View File
@@ -40,7 +40,6 @@
"infoBox": {
"ip": "IP:",
"port": "Port:",
"subnetMask": "Subnetzmaske:",
"alias": "Alias:"
}
},
-1
View File
@@ -6,6 +6,5 @@ part 'network_info.freezed.dart';
class NetworkInfo with _$NetworkInfo {
const factory NetworkInfo({
required List<String> localIps,
required String? netMask, // not used
}) = _NetworkInfo;
}
-7
View File
@@ -153,13 +153,6 @@ class _ReceiveTagState extends ConsumerState<ReceiveTab> with AutomaticKeepAlive
Text(serverState?.port.toString() ?? '-'),
],
),
TableRow(
children: [
Text(t.receiveTab.infoBox.subnetMask),
const SizedBox(width: 10),
Text(networkInfo?.netMask ?? t.general.unknown),
],
),
],
),
),
+1 -4
View File
@@ -40,10 +40,8 @@ class NetworkInfoNotifier extends StateNotifier<NetworkInfo?> {
Future<NetworkInfo> _getInfo() async {
final info = plugin.NetworkInfo();
String? ip;
String? mask;
try {
ip = await info.getWifiIP();
mask = await info.getWifiSubmask();
} catch (e) {
print(e);
}
@@ -60,11 +58,10 @@ class NetworkInfoNotifier extends StateNotifier<NetworkInfo?> {
}
}
print('New network state: $ip ($mask)');
print('New network state: $ip');
return NetworkInfo(
localIps: rankIpAddresses(nativeResult, ip),
netMask: mask,
);
}
}