更新
This commit is contained in:
@@ -226,7 +226,8 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
||||
text: response.msg!);
|
||||
if (response.code == HttpStatusCodes.ok) {
|
||||
//更新设备绑定流程
|
||||
Get.toNamed("/mHTwifiPage",arguments: widget.bleDevice);
|
||||
Get.toNamed("/mHTwifiPage",
|
||||
arguments: widget.bleDevice);
|
||||
THapp bledevice = THapp(
|
||||
device: widget.bleDevice.scanResult.device);
|
||||
blueteethBindController.currentDevice = bledevice;
|
||||
@@ -322,12 +323,12 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
||||
children: [
|
||||
Text(
|
||||
device.name ?? '蓝牙绑定.默认设备名称'.tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFF6FAFD),
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFF6FAFD),
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Obx(() {
|
||||
if (blueteethBindController.currentDeviceMac.value ==
|
||||
@@ -350,77 +351,77 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
||||
children: [
|
||||
Text(
|
||||
"蓝牙绑定.信号强度".tr + ':${device.rssi ?? '-'}dBm',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFEBF2F8),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFEBF2F8),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 40.rpx),
|
||||
Text(
|
||||
"蓝牙绑定.SN".tr + ':${device.sn ?? '-'}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFF5F9FD),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFF5F9FD),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
"蓝牙绑定.蓝牙地址".tr + ':${device.deviceId ?? '-'}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFF6FAFD),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFF6FAFD),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"蓝牙绑定.mac".tr + ':${device.mac ?? '-'}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFF6FAFD),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFF6FAFD),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"蓝牙绑定.网络".tr +
|
||||
':${device.isOnline == true ? '蓝牙绑定.在线'.tr : '蓝牙绑定.离线'.tr}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFEBF2F8),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFEBF2F8),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 145.rpx),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"蓝牙绑定.传感器".tr + ":",
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFEBF2F8),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFEBF2F8),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
device.bind == false ? '蓝牙绑定.可绑定'.tr : '蓝牙绑定.已被绑定'.tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: device.bind == false
|
||||
? const Color(0xFF1AD2B5)
|
||||
: themeController.currentColor.sc9,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: device.bind == false
|
||||
? const Color(0xFF1AD2B5)
|
||||
: themeController.currentColor.sc9,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -428,12 +429,12 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
||||
),
|
||||
Text(
|
||||
"版本".tr + '${device.version ?? '-'}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFF6FAFD),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: const Color(0xFFF6FAFD),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(
|
||||
height: 37.rpx,
|
||||
|
||||
@@ -55,12 +55,12 @@ class DeviceInfoWidget extends GetView {
|
||||
Text(
|
||||
deviceListController.model.deviceList[index]['name'] ??
|
||||
'SWES系列 01号智能一键入眠床',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
maxLines: 1, // 限制显示一行
|
||||
overflow: TextOverflow.ellipsis, // 超出部分显示省略号
|
||||
),
|
||||
@@ -108,40 +108,31 @@ class DeviceInfoWidget extends GetView {
|
||||
.deviceList[
|
||||
index]['_id'] ??
|
||||
''),
|
||||
style: FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
'Readex Pro',
|
||||
color:
|
||||
Color(0xFFC8CBD2),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
lineHeight: 1),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFFC8CBD2),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
height: 1),
|
||||
),
|
||||
TextSpan(
|
||||
text:
|
||||
' (${deviceListController.model.deviceList[index]['status'] ?? ''})',
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
'Readex Pro',
|
||||
color: deviceListController
|
||||
.model
|
||||
.deviceList[index]
|
||||
[
|
||||
'status'] ==
|
||||
'在线'
|
||||
? Color(
|
||||
0xFF07C160) // 在线的颜色
|
||||
: Color(
|
||||
0xFFEA7CA7), // 离线的颜色
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: deviceListController
|
||||
.model
|
||||
.deviceList[
|
||||
index]
|
||||
['status'] ==
|
||||
'在线'
|
||||
? Color(
|
||||
0xFF07C160) // 在线的颜色
|
||||
: Color(
|
||||
0xFFEA7CA7), // 离线的颜色
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -160,14 +151,12 @@ class DeviceInfoWidget extends GetView {
|
||||
.model.deviceList[index]
|
||||
['roomName'] ??
|
||||
''),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFFC8CBD2),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
lineHeight: 1),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFFC8CBD2),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
height: 1),
|
||||
),
|
||||
),
|
||||
Align(
|
||||
@@ -180,14 +169,12 @@ class DeviceInfoWidget extends GetView {
|
||||
?["status"]
|
||||
?.toString() ??
|
||||
''),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFFC8CBD2),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
lineHeight: 1),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFFC8CBD2),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
height: 1),
|
||||
),
|
||||
)
|
||||
].divide(SizedBox(height: 36.rpx)),
|
||||
@@ -207,14 +194,12 @@ class DeviceInfoWidget extends GetView {
|
||||
text: '控制',
|
||||
options: FFButtonOptions(
|
||||
color: Color(0XFF85F5FF),
|
||||
textStyle: FlutterFlowTheme.of(context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 28.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
textStyle: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 28.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
elevation: 0,
|
||||
borderSide: BorderSide(
|
||||
color: Colors.transparent,
|
||||
@@ -282,15 +267,13 @@ class DeviceInfoWidget extends GetView {
|
||||
if (device['bind_type'] == 1)
|
||||
Text(
|
||||
'已分享:',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
fontSize: AppFontsize
|
||||
.normal_text_size,
|
||||
letterSpacing: 0,
|
||||
color: Colors.white,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
fontSize:
|
||||
AppFontsize.normal_text_size,
|
||||
letterSpacing: 0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
if (device['bind_type'] == 1)
|
||||
Padding(
|
||||
@@ -303,42 +286,36 @@ class DeviceInfoWidget extends GetView {
|
||||
['shareNum'] ??
|
||||
0)
|
||||
.toString(),
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF85F5FF),
|
||||
fontSize: AppFontsize
|
||||
.normal_text_size,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF85F5FF),
|
||||
fontSize:
|
||||
AppFontsize.normal_text_size,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (device['bind_type'] == 1)
|
||||
Text(
|
||||
'人',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
fontSize: AppFontsize
|
||||
.normal_text_size,
|
||||
letterSpacing: 0,
|
||||
color: Colors.white,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
fontSize:
|
||||
AppFontsize.normal_text_size,
|
||||
letterSpacing: 0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
if (device['bind_type'] == 2)
|
||||
Text(
|
||||
'来自',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
fontSize: AppFontsize
|
||||
.normal_text_size,
|
||||
letterSpacing: 0,
|
||||
color: Colors.white,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
fontSize:
|
||||
AppFontsize.normal_text_size,
|
||||
letterSpacing: 0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
if (device['bind_type'] == 2)
|
||||
Padding(
|
||||
@@ -347,28 +324,24 @@ class DeviceInfoWidget extends GetView {
|
||||
5, 0, 5, 0),
|
||||
child: Text(
|
||||
'${device['suname']?.length > 5 ? device['suname'].substring(0, 5) + '...' : device['suname']}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF85F5FF),
|
||||
fontSize: AppFontsize
|
||||
.normal_text_size,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF85F5FF),
|
||||
fontSize:
|
||||
AppFontsize.normal_text_size,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (device['bind_type'] == 2)
|
||||
Text(
|
||||
'的分享',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
fontSize: 21.rpx,
|
||||
letterSpacing: 0,
|
||||
color: Colors.white,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
fontSize: 21.rpx,
|
||||
letterSpacing: 0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -407,14 +380,12 @@ class DeviceInfoWidget extends GetView {
|
||||
SizedBox(width: 5),
|
||||
Text(
|
||||
'睡眠报告',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 21.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 21.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -67,12 +67,12 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
|
||||
/// 居中标题
|
||||
Text(
|
||||
'绑定成功.标题'.tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
|
||||
/// 左边返回按钮
|
||||
@@ -185,14 +185,12 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
|
||||
alignment: AlignmentDirectional(0, 0),
|
||||
child: Text(
|
||||
'绑定成功.绑定成功'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 48.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 48.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -206,14 +204,12 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
|
||||
alignment: AlignmentDirectional(0, 0),
|
||||
child: Text(
|
||||
'绑定成功.分享标题'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -227,14 +223,12 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Text(
|
||||
'绑定成功.分享内容'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -299,15 +293,13 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
|
||||
),
|
||||
Text(
|
||||
'绑定成功.立即分享'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: stringToColor("#003058"),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize, // 自定义字体大小
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: stringToColor("#003058"),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize, // 自定义字体大小
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
),
|
||||
@@ -384,15 +376,13 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
|
||||
children: [
|
||||
Text(
|
||||
'绑定成功.返回'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: stringToColor("#003058"),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize, // 自定义字体大小
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: stringToColor("#003058"),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize, // 自定义字体大小
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
),
|
||||
|
||||
@@ -76,12 +76,12 @@ class _MHTBindDeviceTypePageState extends State<MHTBindDeviceTypePage> {
|
||||
/// 居中标题
|
||||
Text(
|
||||
'添加设备'.tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
|
||||
/// 左边返回按钮
|
||||
|
||||
@@ -111,13 +111,14 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
}
|
||||
|
||||
void _startScanning() async {
|
||||
if (!mounted || isScanning || !mhtBlueToothController.shouldScan.value) return;
|
||||
if (!mounted || isScanning || !mhtBlueToothController.shouldScan.value)
|
||||
return;
|
||||
|
||||
_scanSubscription?.cancel();
|
||||
var bluetoothState = await FlutterBluePlus.isOn;
|
||||
mhtBlueToothController.model.bluetooth = bluetoothState;
|
||||
mhtBlueToothController.updateAll();
|
||||
|
||||
|
||||
if (!bluetoothState && !_isDialogShowing) {
|
||||
_isDialogShowing = true;
|
||||
mhtBlueToothController.model.blueRawData = [];
|
||||
@@ -139,7 +140,8 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
if (!mounted) return;
|
||||
|
||||
final signalThreshold = mhtBlueToothController.model.singal!;
|
||||
final searchKey = mhtBlueToothController.search.value.trim().toLowerCase();
|
||||
final searchKey =
|
||||
mhtBlueToothController.search.value.trim().toLowerCase();
|
||||
|
||||
final filteredResults = results.where((r) {
|
||||
final localName = r.advertisementData.localName;
|
||||
@@ -280,12 +282,12 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
children: [
|
||||
Text(
|
||||
'添加设备'.tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
@@ -337,14 +339,12 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
false)
|
||||
? "等待扫描".tr
|
||||
: '扫描中'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
color: stringToColor("#003058"),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: stringToColor("#003058"),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
@@ -372,22 +372,18 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
children: [
|
||||
Text(
|
||||
'最小信号强度'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
color: stringToColor("#003058"),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: stringToColor("#003058"),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Obx(() {
|
||||
return Slider(
|
||||
activeColor: Color(0xFF1FCC9B),
|
||||
inactiveColor:
|
||||
FlutterFlowTheme.of(context)
|
||||
.alternate,
|
||||
inactiveColor: Colors.white,
|
||||
min: -100,
|
||||
max: 50,
|
||||
value:
|
||||
@@ -406,14 +402,12 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
Obx(() {
|
||||
return Text(
|
||||
'${mhtBlueToothController.model.singal!.toInt()}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
color: stringToColor("#003058"),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: stringToColor("#003058"),
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
);
|
||||
}),
|
||||
].divide(SizedBox(width: 30.rpx)),
|
||||
@@ -456,8 +450,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
width: 100.rpx,
|
||||
height: 90.rpx,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.secondaryBackground,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Align(
|
||||
alignment:
|
||||
@@ -474,23 +467,17 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelStyle:
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
hintText: '检索设备'.tr,
|
||||
hintStyle:
|
||||
FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
hintStyle: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
enabledBorder:
|
||||
OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
@@ -513,9 +500,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(
|
||||
context)
|
||||
.error,
|
||||
color: Colors.red,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius:
|
||||
@@ -525,9 +510,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
focusedErrorBorder:
|
||||
OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(
|
||||
context)
|
||||
.error,
|
||||
color: Colors.red,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius:
|
||||
@@ -538,14 +521,11 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
fillColor: themeController
|
||||
.currentColor.sc22,
|
||||
),
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
cursorColor:
|
||||
stringToColor("#003058"),
|
||||
),
|
||||
@@ -579,14 +559,12 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
},
|
||||
child: Text(
|
||||
'搜索'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: stringToColor("#333333"),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: stringToColor("#333333"),
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 26.rpx)),
|
||||
@@ -609,14 +587,12 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
return Text(
|
||||
'匹配出的外围设备'.tr +
|
||||
"(${mhtBlueToothController.model.deviceDataStatus!.length})",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
@@ -690,14 +666,12 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
Expanded(
|
||||
child: Text(
|
||||
'蓝牙绑定提示'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
color: themeController.currentColor.sc4,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: themeController.currentColor.sc4,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 23.rpx)),
|
||||
@@ -714,4 +688,4 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -593,8 +593,8 @@ class _MHTCalibrationPageCopyState extends State<MHTCalibrationPageCopy> {
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
100.rpx, 0.rpx, 100.rpx, 60.rpx),
|
||||
child: CustomCard(
|
||||
borderRadius: AppConstants()
|
||||
.normal_container_radius,
|
||||
borderRadius:
|
||||
AppConstants().normal_container_radius,
|
||||
onTap: () async {
|
||||
if (deviceCalibrationController.flag.value ==
|
||||
2) {
|
||||
@@ -763,16 +763,13 @@ class _MHTCalibrationPageCopyState extends State<MHTCalibrationPageCopy> {
|
||||
0) {
|
||||
return Text(
|
||||
'开始校准'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color:
|
||||
stringToColor("#003058"),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: stringToColor("#003058"),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (deviceCalibrationController
|
||||
@@ -782,16 +779,14 @@ class _MHTCalibrationPageCopyState extends State<MHTCalibrationPageCopy> {
|
||||
.statusContext.value = "";
|
||||
return Text(
|
||||
'开始校准'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (deviceCalibrationController
|
||||
@@ -799,16 +794,14 @@ class _MHTCalibrationPageCopyState extends State<MHTCalibrationPageCopy> {
|
||||
2) {
|
||||
return Text(
|
||||
'重新校准'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
|
||||
@@ -645,29 +645,24 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
currentCalibrationStep.value == 2) {
|
||||
return Text(
|
||||
'开始另外一侧校准'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color:
|
||||
stringToColor("#003058"),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: stringToColor("#003058"),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
);
|
||||
}
|
||||
return Text(
|
||||
'开始校准'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: stringToColor("#003058"),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: stringToColor("#003058"),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (deviceCalibrationController
|
||||
@@ -677,16 +672,14 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
.statusContext.value = "";
|
||||
return Text(
|
||||
'校准中...'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (deviceCalibrationController
|
||||
@@ -694,15 +687,13 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
2) {
|
||||
return Text(
|
||||
'重新校准'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: stringToColor("#003058"),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: stringToColor("#003058"),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
|
||||
@@ -144,13 +144,12 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
children: [
|
||||
Text(
|
||||
'wifi配置'.tr,
|
||||
style:
|
||||
FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 14.rpx,
|
||||
@@ -217,13 +216,11 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
16.rpx, 0, 16.rpx, 0),
|
||||
child: Text(
|
||||
'下一步'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.titleSmall
|
||||
.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
color: stringToColor("#003058"),
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter Tight',
|
||||
color: stringToColor("#003058"),
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -355,15 +352,13 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
children: [
|
||||
Text(
|
||||
'可用WLAN'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color:
|
||||
themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -429,21 +424,19 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
InputDecoration(
|
||||
isDense:
|
||||
true,
|
||||
labelStyle: FlutterFlowTheme.of(
|
||||
context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
'Inter',
|
||||
fontSize:
|
||||
26.rpx,
|
||||
letterSpacing:
|
||||
0.0,
|
||||
),
|
||||
labelStyle:
|
||||
TextStyle(
|
||||
fontFamily:
|
||||
'Inter',
|
||||
fontSize:
|
||||
26.rpx,
|
||||
letterSpacing:
|
||||
0.0,
|
||||
),
|
||||
hintText:
|
||||
'输入wifi密码'
|
||||
.tr,
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
hintStyle: TextStyle(
|
||||
fontFamily:
|
||||
'Inter',
|
||||
fontSize: 26
|
||||
@@ -483,8 +476,6 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.error,
|
||||
width: 1
|
||||
.rpx,
|
||||
),
|
||||
@@ -496,8 +487,6 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.error,
|
||||
width: 1
|
||||
.rpx,
|
||||
),
|
||||
@@ -533,7 +522,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
'Inter',
|
||||
fontSize: 26
|
||||
@@ -630,18 +619,13 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
children: [
|
||||
Text(
|
||||
wifiItem['ssid'] ?? '',
|
||||
style: FlutterFlowTheme
|
||||
.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color:
|
||||
themeController
|
||||
.currentColor
|
||||
.sc3,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
if (blueteethBindController
|
||||
.selectWifi.value ==
|
||||
@@ -767,15 +751,13 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
),
|
||||
Text(
|
||||
'刷新'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 26.rpx)),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user