diff --git a/star_lock/images/main/icon_main_openLockBtn_circle.png b/star_lock/images/main/icon_main_openLockBtn_circle.png index 2da23d77..5f69957d 100644 Binary files a/star_lock/images/main/icon_main_openLockBtn_circle.png and b/star_lock/images/main/icon_main_openLockBtn_circle.png differ diff --git a/star_lock/images/main/unlocked_bg.png b/star_lock/images/main/unlocked_bg.png index 4080c219..fb952c7c 100644 Binary files a/star_lock/images/main/unlocked_bg.png and b/star_lock/images/main/unlocked_bg.png differ diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 0f55bdb7..3c46b66c 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:intl/intl.dart'; import '../../../appRouters.dart'; import '../../../app_settings/app_colors.dart'; @@ -446,7 +447,7 @@ class _LockDetailPageState extends State with TickerProviderStat listeningAnimations() async { await Future.delayed(Duration.zero, () { state.animationController = AnimationController( - duration: const Duration(seconds: 20), vsync: this); + duration: const Duration(seconds: 1), vsync: this); state.animationController.repeat(); //动画开始、结束、向前移动或向后移动时会调用StatusListener state.animationController.addStatusListener((status) { @@ -488,6 +489,70 @@ class _LockDetailPageState extends State with TickerProviderStat } } +//开锁成功弹出的小界面 + void _showFullScreenOverlay(BuildContext context) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (BuildContext context) { + return GestureDetector( + onTap: () { + Navigator.of(context).pop(); // 关闭底部表单 + }, + child: Container( + height: MediaQuery.of(context).size.height, + width: MediaQuery.of(context).size.width, + color: Colors.black.withOpacity(0.5), + child: unlockSuccessWidget(), + ), + ); + }, + ); + } + + Widget unlockSuccessWidget() { + return Stack( + alignment: Alignment.center, + children: [ + Image.asset( + 'images/main/unlocked_bg.png', + width: 358.w, + height: 348.h, + ), + Positioned( + top: ScreenUtil().screenHeight / 2 - 10.h, + child: Column( + children: [ + Text( + widget.lockListInfoItemEntity.lockAlias!, + style: TextStyle( + color: AppColors.placeholderTextColor, fontSize: 26.sp), + ), + SizedBox( + height: 10.h, + ), + Text( + getCurrentFormattedTime(), + style: TextStyle( + color: AppColors.darkGrayTextColor, fontSize: 26.sp), + ) + ], + )) + ], + ); + } + + String getCurrentFormattedTime() { + // 获取当前时间 + DateTime now = DateTime.now(); + + // 格式化日期和时间 + String formattedTime = DateFormat('MM/dd HH:mm').format(now); + + return formattedTime; + } + @override void didChangeDependencies() { // TODO: implement didChangeDependencies diff --git a/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_page.dart b/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_page.dart index fa067dab..1f2f280e 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_page.dart @@ -26,7 +26,7 @@ class _RealTimePicturePageState extends State // listeningAnimations(); state.animationController = - AnimationController(duration: const Duration(seconds: 2), vsync: this); + AnimationController(duration: const Duration(seconds: 1), vsync: this); state.animationController.repeat(); //动画开始、结束、向前移动或向后移动时会调用StatusListener state.animationController.addStatusListener((status) { diff --git a/star_lock/pubspec.yaml b/star_lock/pubspec.yaml index 19bb29a6..c0c5a8d0 100644 --- a/star_lock/pubspec.yaml +++ b/star_lock/pubspec.yaml @@ -129,6 +129,7 @@ dependencies: # ffmpeg_kit_flutter: 5.1.0-LTS fast_gbk: ^1.0.0 flutter_pcm_sound: ^1.1.0 + intl: ^0.18.1 # flutter_audio_capture: <1.1.5 flutter_voice_processor: ^1.1.0