From 5b92317969851df3caac4bc93743d48cc632e2b0 Mon Sep 17 00:00:00 2001 From: wuqifeng <540416539@qq.com> Date: Thu, 16 May 2024 01:35:10 +0800 Subject: [PATCH] feat:导航栏优化 --- lib/pages/practice/widgets/practice_header_widget.dart | 50 +++++++++++++++++++++----------------------------- lib/pages/reading/reading_page.dart | 6 +++--- lib/pages/reading/widgets/reading_header_widget.dart | 6 +++--- lib/pages/video/lookvideo/widgets/video_opera_widget.dart | 4 ++-- 4 files changed, 29 insertions(+), 37 deletions(-) diff --git a/lib/pages/practice/widgets/practice_header_widget.dart b/lib/pages/practice/widgets/practice_header_widget.dart index 1d7a091..08e7d7e 100644 --- a/lib/pages/practice/widgets/practice_header_widget.dart +++ b/lib/pages/practice/widgets/practice_header_widget.dart @@ -3,7 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:wow_english/common/extension/string_extension.dart'; class PracticeHeaderWidget extends StatelessWidget { - const PracticeHeaderWidget({super.key, required this.onTap,this.title = ''}); + const PracticeHeaderWidget({super.key, required this.onTap, this.title = ''}); final Function() onTap; @@ -12,24 +12,23 @@ class PracticeHeaderWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - color: Colors.white, - height: 60.h, - child: AppBar( - leading: IconButton( - icon: Image.asset( - 'back_around'.assetPng, - width: 40, - height: 40, + color: Colors.white, + height: kToolbarHeight, + child: AppBar( + leading: IconButton( + icon: Image.asset( + 'back_around'.assetPng, + width: 40, + height: 40, + ), + onPressed: () { + onTap(); + }, ), - onPressed: () { - onTap(); - }, - ), - centerTitle: true, - title: IntrinsicWidth( - child: Container( + centerTitle: true, + title: Container( height: 40.h, - padding: EdgeInsets.symmetric(horizontal: 27.w), + padding: EdgeInsets.symmetric(horizontal: 27.w, vertical: 6.h), decoration: BoxDecoration( color: const Color(0xFF00B6F1), borderRadius: BorderRadius.circular(20.r), @@ -38,18 +37,11 @@ class PracticeHeaderWidget extends StatelessWidget { color: const Color(0xFF333333), ), ), - child: Center( - child: Text( + child: Text( title, - style: TextStyle( - fontSize: 15.sp, - color: Colors.white - ), + style: TextStyle(fontSize: 15.sp, color: Colors.white), ), - ) - ), - ) - ) - ); + ), + )); } -} \ No newline at end of file +} diff --git a/lib/pages/reading/reading_page.dart b/lib/pages/reading/reading_page.dart index 5947b0d..8e1c60a 100644 --- a/lib/pages/reading/reading_page.dart +++ b/lib/pages/reading/reading_page.dart @@ -77,7 +77,7 @@ class _ReadingPage extends StatelessWidget { }), Container( color: Colors.transparent, - height: 60.h, + height: kToolbarHeight, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -96,8 +96,8 @@ class _ReadingPage extends StatelessWidget { }, icon: Image.asset( 'back_around'.assetPng, - width: 40, - height: 40, + width: 40.w, + height: 40.h, )), ), Container( diff --git a/lib/pages/reading/widgets/reading_header_widget.dart b/lib/pages/reading/widgets/reading_header_widget.dart index 48fe594..2f93315 100644 --- a/lib/pages/reading/widgets/reading_header_widget.dart +++ b/lib/pages/reading/widgets/reading_header_widget.dart @@ -14,7 +14,7 @@ class ReadingHeaderWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( color: Colors.white, - height: 60.h, + height: kToolbarHeight, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -26,8 +26,8 @@ class ReadingHeaderWidget extends StatelessWidget { }, icon: Image.asset( 'back_around'.assetPng, - width: 40, - height: 40, + width: 40.w, + height: 40.h, )), ), Container( diff --git a/lib/pages/video/lookvideo/widgets/video_opera_widget.dart b/lib/pages/video/lookvideo/widgets/video_opera_widget.dart index cea5464..085509e 100644 --- a/lib/pages/video/lookvideo/widgets/video_opera_widget.dart +++ b/lib/pages/video/lookvideo/widgets/video_opera_widget.dart @@ -74,8 +74,8 @@ class _VideoOperaWidgetState extends State { }, child: Image.asset( 'back_around'.assetPng, - height: 40, - width: 40 + height: 40.h, + width: 40.w ), ), 18.horizontalSpace, -- libgit2 0.22.2