Commit 5b92317969851df3caac4bc93743d48cc632e2b0
1 parent
5b87e560
feat:导航栏优化
Showing
4 changed files
with
29 additions
and
37 deletions
lib/pages/practice/widgets/practice_header_widget.dart
@@ -3,7 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | @@ -3,7 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
3 | import 'package:wow_english/common/extension/string_extension.dart'; | 3 | import 'package:wow_english/common/extension/string_extension.dart'; |
4 | 4 | ||
5 | class PracticeHeaderWidget extends StatelessWidget { | 5 | class PracticeHeaderWidget extends StatelessWidget { |
6 | - const PracticeHeaderWidget({super.key, required this.onTap,this.title = ''}); | 6 | + const PracticeHeaderWidget({super.key, required this.onTap, this.title = ''}); |
7 | 7 | ||
8 | final Function() onTap; | 8 | final Function() onTap; |
9 | 9 | ||
@@ -12,24 +12,23 @@ class PracticeHeaderWidget extends StatelessWidget { | @@ -12,24 +12,23 @@ class PracticeHeaderWidget extends StatelessWidget { | ||
12 | @override | 12 | @override |
13 | Widget build(BuildContext context) { | 13 | Widget build(BuildContext context) { |
14 | return Container( | 14 | return Container( |
15 | - color: Colors.white, | ||
16 | - height: 60.h, | ||
17 | - child: AppBar( | ||
18 | - leading: IconButton( | ||
19 | - icon: Image.asset( | ||
20 | - 'back_around'.assetPng, | ||
21 | - width: 40, | ||
22 | - height: 40, | 15 | + color: Colors.white, |
16 | + height: kToolbarHeight, | ||
17 | + child: AppBar( | ||
18 | + leading: IconButton( | ||
19 | + icon: Image.asset( | ||
20 | + 'back_around'.assetPng, | ||
21 | + width: 40, | ||
22 | + height: 40, | ||
23 | + ), | ||
24 | + onPressed: () { | ||
25 | + onTap(); | ||
26 | + }, | ||
23 | ), | 27 | ), |
24 | - onPressed: () { | ||
25 | - onTap(); | ||
26 | - }, | ||
27 | - ), | ||
28 | - centerTitle: true, | ||
29 | - title: IntrinsicWidth( | ||
30 | - child: Container( | 28 | + centerTitle: true, |
29 | + title: Container( | ||
31 | height: 40.h, | 30 | height: 40.h, |
32 | - padding: EdgeInsets.symmetric(horizontal: 27.w), | 31 | + padding: EdgeInsets.symmetric(horizontal: 27.w, vertical: 6.h), |
33 | decoration: BoxDecoration( | 32 | decoration: BoxDecoration( |
34 | color: const Color(0xFF00B6F1), | 33 | color: const Color(0xFF00B6F1), |
35 | borderRadius: BorderRadius.circular(20.r), | 34 | borderRadius: BorderRadius.circular(20.r), |
@@ -38,18 +37,11 @@ class PracticeHeaderWidget extends StatelessWidget { | @@ -38,18 +37,11 @@ class PracticeHeaderWidget extends StatelessWidget { | ||
38 | color: const Color(0xFF333333), | 37 | color: const Color(0xFF333333), |
39 | ), | 38 | ), |
40 | ), | 39 | ), |
41 | - child: Center( | ||
42 | - child: Text( | 40 | + child: Text( |
43 | title, | 41 | title, |
44 | - style: TextStyle( | ||
45 | - fontSize: 15.sp, | ||
46 | - color: Colors.white | ||
47 | - ), | 42 | + style: TextStyle(fontSize: 15.sp, color: Colors.white), |
48 | ), | 43 | ), |
49 | - ) | ||
50 | - ), | ||
51 | - ) | ||
52 | - ) | ||
53 | - ); | 44 | + ), |
45 | + )); | ||
54 | } | 46 | } |
55 | -} | ||
56 | \ No newline at end of file | 47 | \ No newline at end of file |
48 | +} |
lib/pages/reading/reading_page.dart
@@ -77,7 +77,7 @@ class _ReadingPage extends StatelessWidget { | @@ -77,7 +77,7 @@ class _ReadingPage extends StatelessWidget { | ||
77 | }), | 77 | }), |
78 | Container( | 78 | Container( |
79 | color: Colors.transparent, | 79 | color: Colors.transparent, |
80 | - height: 60.h, | 80 | + height: kToolbarHeight, |
81 | child: Row( | 81 | child: Row( |
82 | mainAxisAlignment: MainAxisAlignment.spaceBetween, | 82 | mainAxisAlignment: MainAxisAlignment.spaceBetween, |
83 | children: [ | 83 | children: [ |
@@ -96,8 +96,8 @@ class _ReadingPage extends StatelessWidget { | @@ -96,8 +96,8 @@ class _ReadingPage extends StatelessWidget { | ||
96 | }, | 96 | }, |
97 | icon: Image.asset( | 97 | icon: Image.asset( |
98 | 'back_around'.assetPng, | 98 | 'back_around'.assetPng, |
99 | - width: 40, | ||
100 | - height: 40, | 99 | + width: 40.w, |
100 | + height: 40.h, | ||
101 | )), | 101 | )), |
102 | ), | 102 | ), |
103 | Container( | 103 | Container( |
lib/pages/reading/widgets/reading_header_widget.dart
@@ -14,7 +14,7 @@ class ReadingHeaderWidget extends StatelessWidget { | @@ -14,7 +14,7 @@ class ReadingHeaderWidget extends StatelessWidget { | ||
14 | Widget build(BuildContext context) { | 14 | Widget build(BuildContext context) { |
15 | return Container( | 15 | return Container( |
16 | color: Colors.white, | 16 | color: Colors.white, |
17 | - height: 60.h, | 17 | + height: kToolbarHeight, |
18 | child: Row( | 18 | child: Row( |
19 | mainAxisAlignment: MainAxisAlignment.spaceBetween, | 19 | mainAxisAlignment: MainAxisAlignment.spaceBetween, |
20 | children: [ | 20 | children: [ |
@@ -26,8 +26,8 @@ class ReadingHeaderWidget extends StatelessWidget { | @@ -26,8 +26,8 @@ class ReadingHeaderWidget extends StatelessWidget { | ||
26 | }, | 26 | }, |
27 | icon: Image.asset( | 27 | icon: Image.asset( |
28 | 'back_around'.assetPng, | 28 | 'back_around'.assetPng, |
29 | - width: 40, | ||
30 | - height: 40, | 29 | + width: 40.w, |
30 | + height: 40.h, | ||
31 | )), | 31 | )), |
32 | ), | 32 | ), |
33 | Container( | 33 | Container( |
lib/pages/video/lookvideo/widgets/video_opera_widget.dart
@@ -74,8 +74,8 @@ class _VideoOperaWidgetState extends State<VideoOperaWidget> { | @@ -74,8 +74,8 @@ class _VideoOperaWidgetState extends State<VideoOperaWidget> { | ||
74 | }, | 74 | }, |
75 | child: Image.asset( | 75 | child: Image.asset( |
76 | 'back_around'.assetPng, | 76 | 'back_around'.assetPng, |
77 | - height: 40, | ||
78 | - width: 40 | 77 | + height: 40.h, |
78 | + width: 40.w | ||
79 | ), | 79 | ), |
80 | ), | 80 | ), |
81 | 18.horizontalSpace, | 81 | 18.horizontalSpace, |