更新wifi强度判定

This commit is contained in:
wyf
2025-08-27 15:24:48 +08:00
parent 9474f61b08
commit 43475c2a8b
7 changed files with 44 additions and 40 deletions

View File

@@ -58,6 +58,10 @@ class AppConstants {
int ent_type = APPPackageType.TH.code; //1.默认太和 2.欢睡 3.眠花糖 int ent_type = APPPackageType.TH.code; //1.默认太和 2.欢睡 3.眠花糖
// int ent_type = APPPackageType.HUANSHUI.code; //1.默认太和 2.欢睡 3.眠花糖 // int ent_type = APPPackageType.HUANSHUI.code; //1.默认太和 2.欢睡 3.眠花糖
int text_length = 8; int text_length = 8;
int wifi1 = -45;
int wifi2 = -60;
int wifi3 = -75;
} }
//获取协议地址 //获取协议地址

View File

@@ -843,7 +843,7 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
int? rssi = int.tryParse(wifiItem['rssi'].toString()); int? rssi = int.tryParse(wifiItem['rssi'].toString());
if (rssi != null) { if (rssi != null) {
if (rssi >= -30) { if (rssi >= AppConstants().wifi1) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,
@@ -851,7 +851,7 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
decoration: BoxDecoration(shape: BoxShape.circle), decoration: BoxDecoration(shape: BoxShape.circle),
child: Image.asset("assets/img/wifi4.png"), child: Image.asset("assets/img/wifi4.png"),
); );
} else if (rssi >= -45) { } else if (rssi >= AppConstants().wifi2) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,
@@ -859,7 +859,7 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
decoration: BoxDecoration(shape: BoxShape.circle), decoration: BoxDecoration(shape: BoxShape.circle),
child: Image.asset("assets/img/wifi3.png"), child: Image.asset("assets/img/wifi3.png"),
); );
} else if (rssi >= -60) { } else if (rssi >= AppConstants().wifi3) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,

View File

@@ -949,7 +949,7 @@ class _WifiPageState extends State<WifiPage> {
int? rssi = int.tryParse(wifiItem['rssi'].toString()); int? rssi = int.tryParse(wifiItem['rssi'].toString());
if (rssi != null) { if (rssi != null) {
if (rssi >= -30) { if (rssi >= AppConstants().wifi1) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,
@@ -957,7 +957,7 @@ class _WifiPageState extends State<WifiPage> {
decoration: BoxDecoration(shape: BoxShape.circle), decoration: BoxDecoration(shape: BoxShape.circle),
child: Image.asset("assets/img/wifi4.png"), child: Image.asset("assets/img/wifi4.png"),
); );
} else if (rssi >= -45) { } else if (rssi >= AppConstants().wifi2) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,
@@ -965,7 +965,7 @@ class _WifiPageState extends State<WifiPage> {
decoration: BoxDecoration(shape: BoxShape.circle), decoration: BoxDecoration(shape: BoxShape.circle),
child: Image.asset("assets/img/wifi3.png"), child: Image.asset("assets/img/wifi3.png"),
); );
} else if (rssi >= -60) { } else if (rssi >=AppConstants().wifi3) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,

View File

@@ -843,7 +843,7 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
int? rssi = int.tryParse(wifiItem['rssi'].toString()); int? rssi = int.tryParse(wifiItem['rssi'].toString());
if (rssi != null) { if (rssi != null) {
if (rssi >= -30) { if (rssi >= AppConstants().wifi1) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,
@@ -851,7 +851,7 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
decoration: BoxDecoration(shape: BoxShape.circle), decoration: BoxDecoration(shape: BoxShape.circle),
child: Image.asset("assets/img/wifi4.png"), child: Image.asset("assets/img/wifi4.png"),
); );
} else if (rssi >= -45) { } else if (rssi >= AppConstants().wifi2) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,
@@ -859,7 +859,7 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
decoration: BoxDecoration(shape: BoxShape.circle), decoration: BoxDecoration(shape: BoxShape.circle),
child: Image.asset("assets/img/wifi3.png"), child: Image.asset("assets/img/wifi3.png"),
); );
} else if (rssi >= -60) { } else if (rssi >= AppConstants().wifi3) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,

View File

@@ -855,7 +855,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
int? rssi = int.tryParse(wifiItem['rssi'].toString()); int? rssi = int.tryParse(wifiItem['rssi'].toString());
if (rssi != null) { if (rssi != null) {
if (rssi >= -30) { if (rssi >= AppConstants().wifi1) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,
@@ -863,7 +863,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
decoration: BoxDecoration(shape: BoxShape.circle), decoration: BoxDecoration(shape: BoxShape.circle),
child: Image.asset("assets/img/wifi4.png"), child: Image.asset("assets/img/wifi4.png"),
); );
} else if (rssi >= -45) { } else if (rssi >= AppConstants().wifi2) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,
@@ -871,7 +871,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
decoration: BoxDecoration(shape: BoxShape.circle), decoration: BoxDecoration(shape: BoxShape.circle),
child: Image.asset("assets/img/wifi3.png"), child: Image.asset("assets/img/wifi3.png"),
); );
} else if (rssi >= -60) { } else if (rssi >= AppConstants().wifi3) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,

View File

@@ -830,7 +830,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
int? rssi = int.tryParse(wifiItem['rssi'].toString()); int? rssi = int.tryParse(wifiItem['rssi'].toString());
if (rssi != null) { if (rssi != null) {
if (rssi >= -30) { if (rssi >= AppConstants().wifi1) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,
@@ -838,7 +838,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
decoration: BoxDecoration(shape: BoxShape.circle), decoration: BoxDecoration(shape: BoxShape.circle),
child: Image.asset("assets/img/wifi4.png"), child: Image.asset("assets/img/wifi4.png"),
); );
} else if (rssi >= -45) { } else if (rssi >= AppConstants().wifi2) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,
@@ -846,7 +846,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
decoration: BoxDecoration(shape: BoxShape.circle), decoration: BoxDecoration(shape: BoxShape.circle),
child: Image.asset("assets/img/wifi3.png"), child: Image.asset("assets/img/wifi3.png"),
); );
} else if (rssi >= -60) { } else if (rssi >= AppConstants().wifi3) {
return Container( return Container(
width: 40.rpx, width: 40.rpx,
height: 40.rpx, height: 40.rpx,

View File

@@ -211,10 +211,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: built_value name: built_value
sha256: "0b1b12a0a549605e5f04476031cd0bc91ead1d7c8e830773a18ee54179b3cb62" sha256: ba95c961bafcd8686d1cf63be864eb59447e795e124d98d6a27d91fcd13602fb
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "8.11.0" version: "8.11.1"
cached_network_image: cached_network_image:
dependency: transitive dependency: transitive
description: description:
@@ -315,10 +315,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: connectivity_plus name: connectivity_plus
sha256: "051849e2bd7c7b3bc5844ea0d096609ddc3a859890ec3a9ac4a65a2620cc1f99" sha256: b5e72753cf63becce2c61fd04dfe0f1c430cc5278b53a1342dc5ad839eab29ec
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "6.1.4" version: "6.1.5"
connectivity_plus_platform_interface: connectivity_plus_platform_interface:
dependency: transitive dependency: transitive
description: description:
@@ -411,10 +411,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: dio name: dio
sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9" sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "5.8.0+1" version: "5.9.0"
dio_web_adapter: dio_web_adapter:
dependency: transitive dependency: transitive
description: description:
@@ -444,7 +444,7 @@ packages:
description: description:
path: "." path: "."
ref: main ref: main
resolved-ref: d2ed03c1b1ca4db4a0bdbdc443d3c86d08048003 resolved-ref: "9a4baafc40913f48d707dbe2ed6a9590f35f809a"
url: "https://gitea.wslpc.real.he-info.cn:94/flutter/easydevice.git" url: "https://gitea.wslpc.real.he-info.cn:94/flutter/easydevice.git"
source: git source: git
version: "0.0.1" version: "0.0.1"
@@ -453,7 +453,7 @@ packages:
description: description:
path: "." path: "."
ref: main ref: main
resolved-ref: "9c4390c05d87832531a94aa8d02059a1e26eb354" resolved-ref: a1173d7a01589144d32ca33c300464646274b8fe
url: "https://gitea.wslpc.real.he-info.cn:94/flutter/easyweb.git" url: "https://gitea.wslpc.real.he-info.cn:94/flutter/easyweb.git"
source: git source: git
version: "0.0.1" version: "0.0.1"
@@ -470,7 +470,7 @@ packages:
description: description:
path: "." path: "."
ref: main ref: main
resolved-ref: "6b0a08903ae91ae57deaa783b2649858867d5eba" resolved-ref: c95c04d502b867e1b3da1257a68493609c645ce7
url: "https://gitea.wslpc.real.he-info.cn:94/flutter/ef.git" url: "https://gitea.wslpc.real.he-info.cn:94/flutter/ef.git"
source: git source: git
version: "0.0.1" version: "0.0.1"
@@ -931,10 +931,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: google_fonts name: google_fonts
sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82 sha256: df9763500dadba0155373e9cb44e202ce21bd9ed5de6bdbd05c5854e86839cb8
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "6.2.1" version: "6.3.0"
google_identity_services_web: google_identity_services_web:
dependency: transitive dependency: transitive
description: description:
@@ -995,10 +995,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: http name: http
sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b" sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.4.0" version: "1.5.0"
http2: http2:
dependency: transitive dependency: transitive
description: description:
@@ -1203,10 +1203,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: mapbox_search name: mapbox_search
sha256: "5e1237301a5485443a675eb65fb709e319f25fbf91fb1de4dcdb5ac5d59a33a5" sha256: "1ff2f2ac4471ff59a00d55371bbb82f337e588fcefd4019f66aec372bb4901fc"
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.3.1" version: "4.3.2"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
@@ -1259,10 +1259,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: minio name: minio
sha256: "9fa3d041237d3a0dabfd14c11f6adbefe71f6973d64192f6f1fc3e174013001e" sha256: ee2ce47766e46c7d164f960f2f5ed6a9a82844d877f6b82574f6876ec50c56d1
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "3.5.7" version: "3.5.8"
mobile_scanner: mobile_scanner:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -1339,18 +1339,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: package_info_plus name: package_info_plus
sha256: "7976bfe4c583170d6cdc7077e3237560b364149fcd268b5f53d95a991963b191" sha256: "16eee997588c60225bda0488b6dcfac69280a6b7a3cf02c741895dd370a02968"
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "8.3.0" version: "8.3.1"
package_info_plus_platform_interface: package_info_plus_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: package_info_plus_platform_interface name: package_info_plus_platform_interface
sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c" sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086"
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "3.2.0" version: "3.2.1"
packages_extensions: packages_extensions:
dependency: transitive dependency: transitive
description: description:
@@ -1595,10 +1595,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: provider name: provider
sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84" sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272"
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "6.1.5" version: "6.1.5+1"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
@@ -2208,10 +2208,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: watcher name: watcher
sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" sha256: "5bf046f41320ac97a469d506261797f35254fa61c641741ef32dacda98b7d39c"
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.2" version: "1.1.3"
weather: weather:
dependency: "direct main" dependency: "direct main"
description: description: