This commit is contained in:
wyf
2025-06-06 09:23:23 +08:00
parent bc86cf7d78
commit 54ad7c18e6
7 changed files with 543 additions and 244 deletions

View File

@@ -136,7 +136,6 @@ class _BlueteethDevicePageState extends State<BlueteethDevicePage> {
});
await FlutterBluePlus.startScan(timeout: Duration(seconds: 10));
_scanSubscription = FlutterBluePlus.scanResults.listen((results) {
if (!mounted) return;
@@ -147,7 +146,8 @@ class _BlueteethDevicePageState extends State<BlueteethDevicePage> {
final filteredResults = results.where((r) {
final isTarget = r.rssi > signalThreshold &&
r.advertisementData.localName == "AITH-V2" &&
(r.advertisementData.localName == "AITH-V2" ||
r.advertisementData.localName == "SLAVE") &&
r.advertisementData.manufacturerData.containsKey(0xFFED);
if (!isTarget) return false;
@@ -622,7 +622,7 @@ class _BlueteethDevicePageState extends State<BlueteethDevicePage> {
// '匹配出的外围设备'.tr +
// "${blueteethBindController.model.betDevicelist!.length}",
'匹配出的外围设备'.tr +
"${blueteethBindController.model.blelist!.length}",
"${blueteethBindController.model.betDevicelist!.length}",
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
@@ -647,11 +647,12 @@ class _BlueteethDevicePageState extends State<BlueteethDevicePage> {
mainAxisSize: MainAxisSize.max,
children: [
...blueteethBindController.model.blelist!
.map((device) =>
SingleBlueteethDeviceCompoentWidget(
// device: device,
bleDevice: device,
))
.map((device) {
return SingleBlueteethDeviceCompoentWidget(
// device: device,
bleDevice: device,
);
})
.toList()
.divide(SizedBox(height: 30.rpx))
.addToEnd(SizedBox(height: 30.rpx)),