Showing
2 changed files
with
25 additions
and
19 deletions
1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
2 | import 'package:one_poem/category/provider/categories_page_provider.dart'; | 2 | import 'package:one_poem/category/provider/categories_page_provider.dart'; |
3 | +import 'package:one_poem/widgets/bars/home_types_bar.dart'; | ||
3 | import 'package:one_poem/widgets/my_app_bar.dart'; | 4 | import 'package:one_poem/widgets/my_app_bar.dart'; |
4 | import 'package:provider/provider.dart'; | 5 | import 'package:provider/provider.dart'; |
5 | 6 | ||
6 | import 'category_list_page.dart'; | 7 | import 'category_list_page.dart'; |
7 | -import 'package:one_poem/extension/int_extension.dart'; | ||
8 | -import 'package:flutter_gen/gen_l10n/one_poem_localizations.dart'; | ||
9 | 8 | ||
10 | class CategoriesPage extends StatefulWidget { | 9 | class CategoriesPage extends StatefulWidget { |
11 | const CategoriesPage({Key? key}) : super(key: key); | 10 | const CategoriesPage({Key? key}) : super(key: key); |
... | @@ -35,21 +34,16 @@ class _CategoriesPageState extends State<CategoriesPage> { | ... | @@ -35,21 +34,16 @@ class _CategoriesPageState extends State<CategoriesPage> { |
35 | create: (_) => provider, | 34 | create: (_) => provider, |
36 | child: Scaffold( | 35 | child: Scaffold( |
37 | appBar: MyAppBar( | 36 | appBar: MyAppBar( |
38 | - isBack: false, | 37 | + isBack: true, |
39 | isTransparent: true, | 38 | isTransparent: true, |
40 | - homeMenuHeader: Container( | 39 | + homeMenuHeader: HomeTypesHeader( |
41 | - alignment: Alignment.center, | 40 | + color: Colors.black45, |
42 | - margin: EdgeInsets.symmetric(horizontal: 5.px), | 41 | + funcCenter: () {}, |
43 | - child: Text( | ||
44 | - OnePoemLocalizations.of(context) | ||
45 | - .categoryBottomNavigationBarItemTitle, | ||
46 | - style: const TextStyle(color: Colors.black54), | ||
47 | - ), | ||
48 | ), | 42 | ), |
49 | homeActionWidgets: IconButton( | 43 | homeActionWidgets: IconButton( |
50 | icon: const Icon( | 44 | icon: const Icon( |
51 | Icons.search, | 45 | Icons.search, |
52 | - color: Colors.black54, | 46 | + color: Colors.white, |
53 | ), | 47 | ), |
54 | onPressed: () {}, | 48 | onPressed: () {}, |
55 | ), | 49 | ), | ... | ... |
... | @@ -7,12 +7,15 @@ class HomeTypesHeader extends StatelessWidget { | ... | @@ -7,12 +7,15 @@ class HomeTypesHeader extends StatelessWidget { |
7 | this.funcLeft, | 7 | this.funcLeft, |
8 | this.funcCenter, | 8 | this.funcCenter, |
9 | this.funcRight, | 9 | this.funcRight, |
10 | + this.color, | ||
10 | }) : super(key: key); | 11 | }) : super(key: key); |
11 | 12 | ||
12 | final Function? funcLeft; | 13 | final Function? funcLeft; |
13 | final Function? funcCenter; | 14 | final Function? funcCenter; |
14 | final Function? funcRight; | 15 | final Function? funcRight; |
15 | 16 | ||
17 | + final Color? color; | ||
18 | + | ||
16 | @override | 19 | @override |
17 | Widget build(BuildContext context) { | 20 | Widget build(BuildContext context) { |
18 | return Container( | 21 | return Container( |
... | @@ -31,12 +34,15 @@ class HomeTypesHeader extends StatelessWidget { | ... | @@ -31,12 +34,15 @@ class HomeTypesHeader extends StatelessWidget { |
31 | onPressed: () => funcLeft!(), | 34 | onPressed: () => funcLeft!(), |
32 | child: Text( | 35 | child: Text( |
33 | "临境", | 36 | "临境", |
34 | - style: TextStyle(color: Colors.white, fontSize: 15.px), | 37 | + style: TextStyle( |
38 | + color: color ?? Colors.white, | ||
39 | + fontSize: 15.px, | ||
40 | + ), | ||
35 | ), | 41 | ), |
36 | ), | 42 | ), |
37 | ), | 43 | ), |
38 | - const VerticalDivider( | 44 | + VerticalDivider( |
39 | - color: Colors.white, | 45 | + color: color ?? Colors.white, |
40 | width: 1.0, | 46 | width: 1.0, |
41 | thickness: 1.0, | 47 | thickness: 1.0, |
42 | indent: 10.0, | 48 | indent: 10.0, |
... | @@ -46,11 +52,14 @@ class HomeTypesHeader extends StatelessWidget { | ... | @@ -46,11 +52,14 @@ class HomeTypesHeader extends StatelessWidget { |
46 | onPressed: () => funcCenter!(), | 52 | onPressed: () => funcCenter!(), |
47 | child: Text( | 53 | child: Text( |
48 | "妙众", | 54 | "妙众", |
49 | - style: TextStyle(color: Colors.white, fontSize: 15.px), | 55 | + style: TextStyle( |
56 | + color: color ?? Colors.white, | ||
57 | + fontSize: 15.px, | ||
50 | ), | 58 | ), |
51 | ), | 59 | ), |
52 | - const VerticalDivider( | 60 | + ), |
53 | - color: Colors.white, | 61 | + VerticalDivider( |
62 | + color: color ?? Colors.white, | ||
54 | width: 1.0, | 63 | width: 1.0, |
55 | thickness: 1.0, | 64 | thickness: 1.0, |
56 | indent: 10.0, | 65 | indent: 10.0, |
... | @@ -60,7 +69,10 @@ class HomeTypesHeader extends StatelessWidget { | ... | @@ -60,7 +69,10 @@ class HomeTypesHeader extends StatelessWidget { |
60 | onPressed: () => funcRight!(), | 69 | onPressed: () => funcRight!(), |
61 | child: Text( | 70 | child: Text( |
62 | "新鲜", | 71 | "新鲜", |
63 | - style: TextStyle(color: Colors.white, fontSize: 15.px), | 72 | + style: TextStyle( |
73 | + color: color ?? Colors.white, | ||
74 | + fontSize: 15.px, | ||
75 | + ), | ||
64 | ), | 76 | ), |
65 | ), | 77 | ), |
66 | ], | 78 | ], | ... | ... |
-
Please register or login to post a comment