更新wifi强度判定
This commit is contained in:
@@ -58,6 +58,10 @@ class AppConstants {
|
||||
int ent_type = APPPackageType.TH.code; //1.默认太和 2.欢睡 3.眠花糖
|
||||
// int ent_type = APPPackageType.HUANSHUI.code; //1.默认太和 2.欢睡 3.眠花糖
|
||||
int text_length = 8;
|
||||
|
||||
int wifi1 = -45;
|
||||
int wifi2 = -60;
|
||||
int wifi3 = -75;
|
||||
}
|
||||
|
||||
//获取协议地址
|
||||
|
||||
@@ -843,7 +843,7 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
||||
int? rssi = int.tryParse(wifiItem['rssi'].toString());
|
||||
|
||||
if (rssi != null) {
|
||||
if (rssi >= -30) {
|
||||
if (rssi >= AppConstants().wifi1) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
@@ -851,7 +851,7 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
||||
decoration: BoxDecoration(shape: BoxShape.circle),
|
||||
child: Image.asset("assets/img/wifi4.png"),
|
||||
);
|
||||
} else if (rssi >= -45) {
|
||||
} else if (rssi >= AppConstants().wifi2) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
@@ -859,7 +859,7 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
||||
decoration: BoxDecoration(shape: BoxShape.circle),
|
||||
child: Image.asset("assets/img/wifi3.png"),
|
||||
);
|
||||
} else if (rssi >= -60) {
|
||||
} else if (rssi >= AppConstants().wifi3) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
|
||||
@@ -949,7 +949,7 @@ class _WifiPageState extends State<WifiPage> {
|
||||
int? rssi = int.tryParse(wifiItem['rssi'].toString());
|
||||
|
||||
if (rssi != null) {
|
||||
if (rssi >= -30) {
|
||||
if (rssi >= AppConstants().wifi1) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
@@ -957,7 +957,7 @@ class _WifiPageState extends State<WifiPage> {
|
||||
decoration: BoxDecoration(shape: BoxShape.circle),
|
||||
child: Image.asset("assets/img/wifi4.png"),
|
||||
);
|
||||
} else if (rssi >= -45) {
|
||||
} else if (rssi >= AppConstants().wifi2) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
@@ -965,7 +965,7 @@ class _WifiPageState extends State<WifiPage> {
|
||||
decoration: BoxDecoration(shape: BoxShape.circle),
|
||||
child: Image.asset("assets/img/wifi3.png"),
|
||||
);
|
||||
} else if (rssi >= -60) {
|
||||
} else if (rssi >=AppConstants().wifi3) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
|
||||
@@ -843,7 +843,7 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
|
||||
int? rssi = int.tryParse(wifiItem['rssi'].toString());
|
||||
|
||||
if (rssi != null) {
|
||||
if (rssi >= -30) {
|
||||
if (rssi >= AppConstants().wifi1) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
@@ -851,7 +851,7 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
|
||||
decoration: BoxDecoration(shape: BoxShape.circle),
|
||||
child: Image.asset("assets/img/wifi4.png"),
|
||||
);
|
||||
} else if (rssi >= -45) {
|
||||
} else if (rssi >= AppConstants().wifi2) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
@@ -859,7 +859,7 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
|
||||
decoration: BoxDecoration(shape: BoxShape.circle),
|
||||
child: Image.asset("assets/img/wifi3.png"),
|
||||
);
|
||||
} else if (rssi >= -60) {
|
||||
} else if (rssi >= AppConstants().wifi3) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
|
||||
@@ -855,7 +855,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
int? rssi = int.tryParse(wifiItem['rssi'].toString());
|
||||
|
||||
if (rssi != null) {
|
||||
if (rssi >= -30) {
|
||||
if (rssi >= AppConstants().wifi1) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
@@ -863,7 +863,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
decoration: BoxDecoration(shape: BoxShape.circle),
|
||||
child: Image.asset("assets/img/wifi4.png"),
|
||||
);
|
||||
} else if (rssi >= -45) {
|
||||
} else if (rssi >= AppConstants().wifi2) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
@@ -871,7 +871,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
decoration: BoxDecoration(shape: BoxShape.circle),
|
||||
child: Image.asset("assets/img/wifi3.png"),
|
||||
);
|
||||
} else if (rssi >= -60) {
|
||||
} else if (rssi >= AppConstants().wifi3) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
|
||||
@@ -830,7 +830,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
|
||||
int? rssi = int.tryParse(wifiItem['rssi'].toString());
|
||||
|
||||
if (rssi != null) {
|
||||
if (rssi >= -30) {
|
||||
if (rssi >= AppConstants().wifi1) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
@@ -838,7 +838,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
|
||||
decoration: BoxDecoration(shape: BoxShape.circle),
|
||||
child: Image.asset("assets/img/wifi4.png"),
|
||||
);
|
||||
} else if (rssi >= -45) {
|
||||
} else if (rssi >= AppConstants().wifi2) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
@@ -846,7 +846,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
|
||||
decoration: BoxDecoration(shape: BoxShape.circle),
|
||||
child: Image.asset("assets/img/wifi3.png"),
|
||||
);
|
||||
} else if (rssi >= -60) {
|
||||
} else if (rssi >= AppConstants().wifi3) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
|
||||
Reference in New Issue
Block a user