I want to develop a attendance flutter app in which want to restrict the user to access the app ,only when he/she connect with organization wi-fi network the user can access app. And if user try to connect with mobile data or another network the app should not open
Asked
Active
Viewed 441 times
1 Answers
1
You need to use this plugin first
https://pub.dev/packages/network_info_plus
after that get the connected SSID, name IP, and ipv6 whatever you like, using this
var wifiName = await info.getWifiName(); // "FooNetwork"
var wifiBSSID = await info.getWifiBSSID(); // 11:22:33:44:55:66
var wifiIP = await info.getWifiIP(); // 192.168.1.43
var wifiIPv6 = await info.getWifiIPv6(); // 2001:0db8:85a3:0000:0000:8a2e:0370:7334
var wifiSubmask = await info.getWifiSubmask(); // 255.255.255.0
var wifiBroadcast = await info.getWifiBroadcast(); // 192.168.1.255
var wifiGateway = await info.getWifiGatewayIP();
after that save the data and every time when you need to log in check the user is connected to the same SSID, or IP (below-selected item) that you already defined

MrShakila
- 874
- 1
- 4
- 19