1,新增配件区域UI

2,新增网络摄像头的设备
This commit is contained in:
Daisy 2024-03-06 17:19:52 +08:00
parent be4a182397
commit e97b68be00
11 changed files with 87 additions and 72 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -1,8 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/main/accessoriesList/accessoriesList_logic.dart'; import 'package:star_lock/main/accessoriesList/accessoriesList_logic.dart';
import '../../../app_settings/app_colors.dart'; import '../../../app_settings/app_colors.dart';
@ -32,15 +30,17 @@ class _AccessoriesListPageState extends State<AccessoriesListPage>
body: ListView( body: ListView(
children: [ children: [
_accessoriesItem( _accessoriesItem(
'images/mine/icon_mine_selectGatewayType_G2.png', "照明灯具", true), 'images/main/icon_main_attachment_lighting.png', "照明灯具", true),
_accessoriesItem( _accessoriesItem(
'images/mine/icon_mine_selectGatewayType_G4.png', "开门器", false), 'images/main/icon_main_attachment_doorOpener.png', "开门器", false),
_accessoriesItem( _accessoriesItem(
'images/mine/icon_mine_selectGatewayType_G2.png', "电动窗帘", true), 'images/main/icon_main_attachment_ElectricCurtain.png',
"电动窗帘",
true),
_accessoriesItem('images/main/icon_main_attachment_doorSensor.png',
"门窗传感器", false),
_accessoriesItem( _accessoriesItem(
'images/mine/icon_mine_selectGatewayType_G4.png', "门窗传感器", false), 'images/main/icon_main_attachment_sensor.png', "传感器", true),
_accessoriesItem(
'images/mine/icon_mine_selectGatewayType_G2.png', "传感器", true),
], ],
), ),
); );
@ -57,22 +57,18 @@ class _AccessoriesListPageState extends State<AccessoriesListPage>
width: 1.sw, width: 1.sw,
height: 140.h, height: 140.h,
padding: EdgeInsets.all(30.w), padding: EdgeInsets.all(30.w),
child: Center( child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, children: [
children: [ Image.asset(
Image.asset( iconStr,
iconStr, ),
width: 150.w, SizedBox(width: 20.w),
height: 150.w, Text(
), gatewayType,
// SizedBox(width: 20.w), style: TextStyle(fontSize: 22.sp),
Text( )
gatewayType, ],
style: TextStyle(fontSize: 22.sp),
)
],
),
), ),
), ),
); );

View File

@ -379,24 +379,24 @@ class _LockDetailPageState extends State<LockDetailPage>
List<Widget> getAttachmentWidget() { List<Widget> getAttachmentWidget() {
var showWidgetArr = <Widget>[]; var showWidgetArr = <Widget>[];
// 线 // 线
if (state.isAttendance.value == 1) { // if (state.isAttendance.value == 1) {
showWidgetArr.add(bottomItem( // showWidgetArr.add(bottomItem(
'images/main/icon_lockDetail_WirelessKeyboard.png', // 'images/main/icon_lockDetail_WirelessKeyboard.png',
'无线键盘', // '无线键盘',
state.bottomBtnisUneable.value, // state.bottomBtnisUneable.value,
() {})); // () {}));
} // }
// // //
showWidgetArr.add(bottomItem('images/main/icon_lockDetail_illuminator.png', // showWidgetArr.add(bottomItem('images/main/icon_lockDetail_illuminator.png',
'照明', state.bottomBtnisUneable.value, () {})); // '照明', state.bottomBtnisUneable.value, () {}));
// // //
showWidgetArr.add(bottomItem('images/main/icon_lockDetail_illuminator.png', // showWidgetArr.add(bottomItem('images/main/icon_lockDetail_illuminator.png',
'门磁', state.bottomBtnisUneable.value, () {})); // '门磁', state.bottomBtnisUneable.value, () {}));
// // //
showWidgetArr.add(bottomItem('images/main/icon_lockDetail_illuminator.png', // showWidgetArr.add(bottomItem('images/main/icon_lockDetail_illuminator.png',
'开门器', state.bottomBtnisUneable.value, () {})); // '开门器', state.bottomBtnisUneable.value, () {}));
// //
showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件', showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件',

View File

@ -79,31 +79,30 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
Obx( Obx(
() => () => state.listData.value.isEmpty || state.listData.value.isEmpty
state.listData.value.isEmpty || state.listData.value.length == 0 ? Image.asset(
? Image.asset( 'images/main/monitorBg.png',
'images/main/monitorBg.png', width: ScreenUtil().screenWidth,
width: ScreenUtil().screenWidth, height: ScreenUtil().screenHeight,
height: ScreenUtil().screenHeight, fit: BoxFit.cover,
fit: BoxFit.cover, )
) : Builder(
: Builder( builder: (BuildContext context) {
builder: (BuildContext context) { try {
try { return Image.memory(
return Image.memory( state.listData.value,
state.listData.value, gaplessPlayback: true,
gaplessPlayback: true, width: 1.sw,
width: 1.sw, height: 1.sh,
height: 1.sh, fit: BoxFit.cover,
fit: BoxFit.cover, );
); } catch (e, stackTrace) {
} catch (e, stackTrace) { print('Error loading image: $e');
print('Error loading image: $e'); print('Stack trace: $stackTrace');
print('Stack trace: $stackTrace'); return Container();
return Container(); }
} },
}, ),
),
), ),
Obx(() => state.listData.value.isEmpty Obx(() => state.listData.value.isEmpty
? Positioned( ? Positioned(
@ -161,7 +160,7 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
"images/main/icon_lockDetail_monitoringOpenVoice.png"))), "images/main/icon_lockDetail_monitoringOpenVoice.png"))),
), ),
), ),
SizedBox(width: 60.w), SizedBox(width: 30.w),
// //
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -178,7 +177,7 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
"images/main/icon_lockDetail_monitoringScreenshot.png")), "images/main/icon_lockDetail_monitoringScreenshot.png")),
), ),
), ),
SizedBox(width: 60.w), SizedBox(width: 30.w),
// //
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -191,10 +190,34 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
child: Image( child: Image(
width: 40.w, width: 40.w,
height: 40.w, height: 40.w,
fit: BoxFit.fill,
image: const AssetImage( image: const AssetImage(
"images/main/icon_lockDetail_monitoringScreenRecording.png")), "images/main/icon_lockDetail_monitoringScreenRecording.png")),
), ),
), ),
SizedBox(width: 30.w),
GestureDetector(
onTap: () {
logic.showToast('该功能暂未开放');
},
child: Image(
width: 28.w,
height: 28.w,
fit: BoxFit.fill,
image:
const AssetImage("images/main/icon_lockDetail_rectangle.png"))
// child: Container(
// width: 50.w,
// height: 50.w,
// padding: EdgeInsets.all(5.w),
// child: Image(
// width: 40.w,
// height: 40.w,
// fit: BoxFit.fill,
// image: const AssetImage(
// "images/main/icon_lockDetail_rectangle.png")),
// ),
)
]); ]);
} }

View File

@ -53,7 +53,7 @@ class UdpHelp {
} }
void closeUDP() { void closeUDP() {
if(udpHeartTimer != null){ if (udpHeartTimer != null) {
udpHeartTimer!.cancel(); udpHeartTimer!.cancel();
} }
} }

View File

@ -1,12 +1,8 @@
import 'dart:async'; import 'dart:async';
import 'package:audioplayers/audioplayers.dart'; import 'package:audioplayers/audioplayers.dart';
import 'package:fast_gbk/fast_gbk.dart'; import 'package:fast_gbk/fast_gbk.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/tools/eventBusEventManage.dart';
import '../../appRouters.dart'; import '../../appRouters.dart';
import '../../main/lockDetail/monitoring/monitoring/lockMonitoring_page.dart';
import '../../tools/storage.dart'; import '../../tools/storage.dart';
import 'udp_manage.dart'; import 'udp_manage.dart';