更新控制跳转
This commit is contained in:
@@ -19,8 +19,8 @@ import 'package:vbvs_app/pages/mh_page/device/controller/mht_bluetooth_controlle
|
||||
import 'package:vbvs_app/pages/mh_page/device/model/BlueToothDataModel.dart';
|
||||
|
||||
class MHTBlueteethDevicePage extends StatefulWidget {
|
||||
var data;
|
||||
MHTBlueteethDevicePage({super.key, required this.data});
|
||||
var deviceType;
|
||||
MHTBlueteethDevicePage({super.key, required this.deviceType});
|
||||
|
||||
@override
|
||||
State<MHTBlueteethDevicePage> createState() => _MHTBlueteethDevicePageState();
|
||||
@@ -146,10 +146,8 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
final filteredResults = results.where((r) {
|
||||
final localName = r.advertisementData.localName;
|
||||
final isTarget = r.rssi > signalThreshold &&
|
||||
isTargetDevice(localName, widget.data['reg'].cast<String>());
|
||||
|
||||
isTargetDevice(localName, widget.deviceType['reg'].cast<String>());
|
||||
if (!isTarget) return false;
|
||||
|
||||
final name = r.advertisementData.advName.toLowerCase();
|
||||
String macAddress = r.device.remoteId.str;
|
||||
final mac = macAddress.replaceAll(':', '');
|
||||
@@ -164,7 +162,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
return true;
|
||||
}).map((r) {
|
||||
return BlueToothDataModel.fromScanResult(
|
||||
r, widget.data['type']?.toInt(),
|
||||
r, widget.deviceType['type']?.toInt(),
|
||||
bind: false,
|
||||
name: r.advertisementData.localName,
|
||||
mac: r.device.remoteId.str.replaceAll(':', ''));
|
||||
@@ -638,6 +636,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
.map((device) {
|
||||
return DeviceComponentWidget(
|
||||
bleDevice: device,
|
||||
deviceType: widget.deviceType,
|
||||
);
|
||||
})
|
||||
.toList()
|
||||
|
||||
Reference in New Issue
Block a user