From 7c58c482e4e122ef76e579ade4d96f80f64af127 Mon Sep 17 00:00:00 2001 From: anfe <448468458@qq.com> Date: Fri, 24 May 2024 09:39:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=20xhj=20=E5=BC=80?= =?UTF-8?q?=E9=94=81=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockDetail/lockDetail_page.dart | 52 +++++++++---------- lib/talk/udp/udp_manage.dart | 16 +++--- 2 files changed, 33 insertions(+), 35 deletions(-) diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index f32d72e7..96a038ad 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -250,7 +250,7 @@ class _LockDetailPageState extends State ], ), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ const Spacer(), GestureDetector( @@ -269,8 +269,8 @@ class _LockDetailPageState extends State } }, child: Container( - width: 100.r, - height: 100.r, + width: 200.r, + height: 200.r, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(100.w), @@ -282,51 +282,47 @@ class _LockDetailPageState extends State spreadRadius: 0, ), ]), - margin: EdgeInsets.only(left: 35.w, bottom: 15.h), + margin: EdgeInsets.only(top: 20.h), child: Stack( alignment: AlignmentDirectional.center, children: [ if (state.openDoorBtnisUneable.value == false) Icon( Icons.bluetooth_searching, - size: 48.r, - color: AppColors.mainColor, + size: 78.r, + color: AppColors.mainColor.withOpacity(0.6), ) else Image.asset( state.isOpenPassageMode.value == 1 ? 'images/icon_lock_err.png' : 'images/icon_lock_fill.png', - width: 38.r, - height: 38.r, + width: 68.r, + height: 68.r, color: AppColors.mainColor, ), - if (state.openDoorBtnisUneable.value == false) - Positioned( - child: Icon( - Icons.bluetooth_searching, - size: 96.r, - ), + if (state.openLockBtnState.value == 1) + xhjBuildRotationTransition( + width: 168.r, + height: 168.r, ) else - state.openLockBtnState.value == 1 - ? xhjBuildRotationTransition( - width: 88.r, - height: 88.r, - ) - : Positioned( - child: Image.asset( - 'images/icon_circle_dotted.png', - width: 88.r, - height: 88.r, - color: state.isOpenPassageMode.value == 1 - ? Colors.red - : AppColors.mainColor, - )), + Positioned( + child: Image.asset( + 'images/icon_circle_dotted.png', + width: 168.r, + height: 168.r, + color: state.openDoorBtnisUneable.value == false + ? AppColors.mainColor.withOpacity(0.6) + : state.isOpenPassageMode.value == 1 + ? Colors.red + : AppColors.mainColor, + )), ], ), ), ), + const Spacer(), Padding( padding: EdgeInsets.only(left: 15.w, right: 00.w, bottom: 15.h), child: Row( diff --git a/lib/talk/udp/udp_manage.dart b/lib/talk/udp/udp_manage.dart index 88dc1845..b5231292 100755 --- a/lib/talk/udp/udp_manage.dart +++ b/lib/talk/udp/udp_manage.dart @@ -62,14 +62,16 @@ class UDPManage { // AppLog.log('Udp ----> host:$host port:$port'); var addressIListenFrom = InternetAddress.anyIPv4; int portIListenOn = 62288; - RawDatagramSocket.bind(addressIListenFrom, portIListenOn) - .then((RawDatagramSocket socket) { - _udpSocket = socket; + if(addressIListenFrom.address != '0.0.0.0'){ + RawDatagramSocket.bind(addressIListenFrom, portIListenOn) + .then((RawDatagramSocket socket) { + _udpSocket = socket; - ///广播功能 - _udpSocket!.broadcastEnabled = true; - _onReceiveData(socket); - }); + ///广播功能 + _udpSocket!.broadcastEnabled = true; + _onReceiveData(socket); + }); + } } void _onReceiveData(RawDatagramSocket socket) {