diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 8cbf5404..b6a6629d 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -506,43 +506,45 @@ class _LockDetailPageState extends State with TickerProviderStat height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, color: Colors.black.withOpacity(0.5), - child: 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), - ) - ], - )) - ], - ), + 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();