From e1b020095264c108fe84a97ec6a524f0bb6ec327 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Fri, 7 Jul 2023 10:08:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=B3=BB=E7=BB=9F=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E4=BE=A7=E9=9D=A2=E5=BC=B9=E7=AA=97=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/business_home_page.dart | 4 +- .../home/home_view/home_sideslip_dialog.dart | 44 ++++++++++++------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/lib/business_system/home/business_home_page.dart b/lib/business_system/home/business_home_page.dart index 72afe46c..a697f861 100644 --- a/lib/business_system/home/business_home_page.dart +++ b/lib/business_system/home/business_home_page.dart @@ -98,6 +98,8 @@ class _BusinessHomePage extends State behavior: HitTestBehavior.opaque, onTap: (){ showAlertDialog(); + //改变导航栏状态栏颜色 + // SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle(statusBarColor: Colors.white), ); // Navigator.of(context).pushNamed('/router/select_shop'); }, child: Row( @@ -292,7 +294,7 @@ class _BusinessHomePage extends State ///侧面弹窗 showAlertDialog() { - showDialog( + showCupertinoModalPopup( builder: (context) { return HomeSideslipDialog();}, context: context); diff --git a/lib/business_system/home/home_view/home_sideslip_dialog.dart b/lib/business_system/home/home_view/home_sideslip_dialog.dart index a39ac14e..6631666e 100644 --- a/lib/business_system/home/home_view/home_sideslip_dialog.dart +++ b/lib/business_system/home/home_view/home_sideslip_dialog.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/utils/font_weight.dart'; @@ -42,7 +43,11 @@ class _HomeSideslipDialog extends State with SingleTickerPro return SlideTransition(position: _animation, child: WillPopScope( ///点击背景不收起弹窗; - // onWillPop: () async => false, + onWillPop: () async { + SystemChrome.setSystemUIOverlayStyle( + SystemUiOverlayStyle(statusBarColor: Colors.transparent)); + return true; + }, child: Container( width: double.infinity, margin: EdgeInsets.only(right:61.w), @@ -123,21 +128,28 @@ class _HomeSideslipDialog extends State with SingleTickerPro ); }, )), - Container( - alignment: Alignment.center, - width: double.infinity, - padding: EdgeInsets.symmetric(vertical: 9.h), - margin: EdgeInsets.only(left:16.w,right: 16.w,bottom: 103.h,top: 20.h), - decoration: BoxDecoration( - color: Color(0xFF30415B), - borderRadius: BorderRadius.circular(4.w), - ), - child:Text("退出登录", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white - ),),), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + SystemChrome.setSystemUIOverlayStyle( + SystemUiOverlayStyle(statusBarColor: Colors.transparent)); + }, + child: Container( + alignment: Alignment.center, + width: double.infinity, + padding: EdgeInsets.symmetric(vertical: 9.h), + margin: EdgeInsets.only(left:16.w,right: 16.w,bottom: 103.h,top: 20.h), + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(4.w), + ), + child:Text("退出登录", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white + ),),), + ), ], ), ),