Showing
22 changed files
with
370 additions
and
112 deletions
... | @@ -147,7 +147,7 @@ class _AccountPageState extends State<AccountPage> { | ... | @@ -147,7 +147,7 @@ class _AccountPageState extends State<AccountPage> { |
147 | ], | 147 | ], |
148 | ); | 148 | ); |
149 | return Scaffold( | 149 | return Scaffold( |
150 | - appBar: const MyAppBar( | 150 | + appBar: MyAppBar( |
151 | ), | 151 | ), |
152 | body: Container( | 152 | body: Container( |
153 | decoration: const BoxDecoration( | 153 | decoration: const BoxDecoration( | ... | ... |
... | @@ -43,7 +43,7 @@ class _CategoriesPageState extends State<CategoriesPage> | ... | @@ -43,7 +43,7 @@ class _CategoriesPageState extends State<CategoriesPage> |
43 | return ChangeNotifierProvider<CategoriesPageProvider>( | 43 | return ChangeNotifierProvider<CategoriesPageProvider>( |
44 | create: (_) => provider, | 44 | create: (_) => provider, |
45 | child: Scaffold( | 45 | child: Scaffold( |
46 | - appBar: const MyAppBar( | 46 | + appBar: MyAppBar( |
47 | ), | 47 | ), |
48 | body: Column( | 48 | body: Column( |
49 | key: _bodyKey, | 49 | key: _bodyKey, | ... | ... |
... | @@ -53,8 +53,8 @@ class _WebViewPageState extends State<WebViewPage> { | ... | @@ -53,8 +53,8 @@ class _WebViewPageState extends State<WebViewPage> { |
53 | return Future.value(true); | 53 | return Future.value(true); |
54 | }, | 54 | }, |
55 | child: Scaffold( | 55 | child: Scaffold( |
56 | - appBar: MyAppBar( | 56 | + appBar: const MyAppBar( |
57 | - centerTitle: widget.title, | 57 | + |
58 | ), | 58 | ), |
59 | body: Stack( | 59 | body: Stack( |
60 | children: [ | 60 | children: [ | ... | ... |
... | @@ -84,7 +84,6 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag | ... | @@ -84,7 +84,6 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag |
84 | return Scaffold( | 84 | return Scaffold( |
85 | appBar: MyAppBar( | 85 | appBar: MyAppBar( |
86 | isBack: false, | 86 | isBack: false, |
87 | - actionName: OnePoemLocalizations.of(context).verificationCodeLogin, | ||
88 | onPressed: () { | 87 | onPressed: () { |
89 | NavigatorUtils.push(context, LoginRouter.smsLoginPage); | 88 | NavigatorUtils.push(context, LoginRouter.smsLoginPage); |
90 | }, | 89 | }, | ... | ... |
... | @@ -73,8 +73,7 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re | ... | @@ -73,8 +73,7 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re |
73 | @override | 73 | @override |
74 | Widget build(BuildContext context) { | 74 | Widget build(BuildContext context) { |
75 | return Scaffold( | 75 | return Scaffold( |
76 | - appBar: MyAppBar( | 76 | + appBar: const MyAppBar( |
77 | - title: OnePoemLocalizations.of(context).register, | ||
78 | ), | 77 | ), |
79 | body: MyScrollView( | 78 | body: MyScrollView( |
80 | keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2, _nodeText3]), | 79 | keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2, _nodeText3]), | ... | ... |
... | @@ -70,8 +70,7 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi | ... | @@ -70,8 +70,7 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi |
70 | @override | 70 | @override |
71 | Widget build(BuildContext context) { | 71 | Widget build(BuildContext context) { |
72 | return Scaffold( | 72 | return Scaffold( |
73 | - appBar: MyAppBar( | 73 | + appBar: const MyAppBar( |
74 | - title: OnePoemLocalizations.of(context).forgotPasswordLink, | ||
75 | ), | 74 | ), |
76 | body: MyScrollView( | 75 | body: MyScrollView( |
77 | keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2, _nodeText3]), | 76 | keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2, _nodeText3]), | ... | ... |
... | @@ -65,7 +65,7 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM | ... | @@ -65,7 +65,7 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM |
65 | @override | 65 | @override |
66 | Widget build(BuildContext context) { | 66 | Widget build(BuildContext context) { |
67 | return Scaffold( | 67 | return Scaffold( |
68 | - appBar: const MyAppBar(), | 68 | + appBar: MyAppBar(), |
69 | body: MyScrollView( | 69 | body: MyScrollView( |
70 | keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2]), | 70 | keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2]), |
71 | padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 20.0), | 71 | padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 20.0), | ... | ... |
... | @@ -64,7 +64,6 @@ class _UpdatePasswordPageState extends State<UpdatePasswordPage> with ChangeNoti | ... | @@ -64,7 +64,6 @@ class _UpdatePasswordPageState extends State<UpdatePasswordPage> with ChangeNoti |
64 | Widget build(BuildContext context) { | 64 | Widget build(BuildContext context) { |
65 | return Scaffold( | 65 | return Scaffold( |
66 | appBar: const MyAppBar( | 66 | appBar: const MyAppBar( |
67 | - title: '修改密码', | ||
68 | ), | 67 | ), |
69 | body: MyScrollView( | 68 | body: MyScrollView( |
70 | keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2]), | 69 | keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2]), | ... | ... |
1 | +import 'dart:ui'; | ||
2 | + | ||
1 | import 'package:flutter/cupertino.dart'; | 3 | import 'package:flutter/cupertino.dart'; |
2 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
3 | import 'package:one_poem/res/gaps.dart'; | 5 | import 'package:one_poem/res/gaps.dart'; |
4 | import 'package:one_poem/util/theme_utils.dart'; | 6 | import 'package:one_poem/util/theme_utils.dart'; |
5 | import 'package:one_poem/util/toast_utils.dart'; | 7 | import 'package:one_poem/util/toast_utils.dart'; |
8 | +import 'package:one_poem/widgets/bars/home_action_bar.dart'; | ||
9 | +import 'package:one_poem/widgets/bars/home_title_bar.dart'; | ||
6 | import 'package:one_poem/widgets/load_image.dart'; | 10 | import 'package:one_poem/widgets/load_image.dart'; |
7 | import 'package:one_poem/widgets/my_app_bar.dart'; | 11 | import 'package:one_poem/widgets/my_app_bar.dart'; |
8 | 12 | ||
... | @@ -24,36 +28,130 @@ class _PoemDetailPageState extends State<PoemDetailPage> { | ... | @@ -24,36 +28,130 @@ class _PoemDetailPageState extends State<PoemDetailPage> { |
24 | @override | 28 | @override |
25 | Widget build(BuildContext context) { | 29 | Widget build(BuildContext context) { |
26 | return Scaffold( | 30 | return Scaffold( |
27 | - // extendBodyBehindAppBar: true,// appbar背景透明 | ||
28 | appBar: MyAppBar( | 31 | appBar: MyAppBar( |
29 | - isShowButtons: true, | 32 | + isTransparent: false, |
30 | - funcLeft: () { | 33 | + homeTitleHeader: HomeTitleHeader( |
31 | - print("xxxxx"); | 34 | + funcLeft: () { |
32 | - }, | 35 | + print("lefltlelfle"); |
36 | + }, | ||
37 | + ), | ||
38 | + homeActionWidgets: HomeActionWidgets( | ||
39 | + funcStar: () { | ||
40 | + print("starrrrrrr"); | ||
41 | + }, | ||
42 | + ), | ||
33 | ), | 43 | ), |
34 | body: Container( | 44 | body: Container( |
45 | + alignment: Alignment.topCenter, | ||
35 | decoration: const BoxDecoration( | 46 | decoration: const BoxDecoration( |
36 | - color: Colors.black, | ||
37 | image: DecorationImage( | 47 | image: DecorationImage( |
38 | image: AssetImage("assets/images/poem/poem_background.png"), | 48 | image: AssetImage("assets/images/poem/poem_background.png"), |
39 | fit: BoxFit.fill, | 49 | fit: BoxFit.fill, |
40 | ), | 50 | ), |
41 | ), | 51 | ), |
42 | - child: Column( | 52 | + child: SafeArea( |
43 | - crossAxisAlignment: CrossAxisAlignment.start, | 53 | + child: Column( |
44 | - children: const [ | 54 | + crossAxisAlignment: CrossAxisAlignment.start, |
45 | - Text("题破山寺后禅院"), | 55 | + children: [ |
46 | - Gaps.vGap24, | 56 | + Container( |
47 | - Text("常建"), | 57 | + margin: const EdgeInsets.symmetric( |
48 | - Text("清晨入古寺,初日照高林。"), | 58 | + vertical: 40.0, horizontal: 25.0), |
49 | - Text("竹径通幽处,禅房花木深。"), | 59 | + height: 240.0, |
50 | - Text("山光悦鸟性,潭影空人心。"), | 60 | + width: double.infinity, |
51 | - Text("万籁此都寂,但余钟磬音。"), | 61 | + decoration: BoxDecoration( |
52 | - Gaps.vGap24, | 62 | + color: Colors.grey.shade200.withOpacity(0.1), |
53 | - Text("100位用户朗读拍摄提交了“临境”"), | 63 | + border: Border.all(color: Colors.grey, width: 0.1), // 边色与边宽度 |
54 | - ], | 64 | + borderRadius: BorderRadius.circular(2.0), |
65 | + ), | ||
66 | + child: ClipRect( | ||
67 | + child: BackdropFilter( | ||
68 | + filter: ImageFilter.blur( | ||
69 | + sigmaX: 10.0, | ||
70 | + sigmaY: 10.0, | ||
71 | + ), | ||
72 | + child: Container( | ||
73 | + decoration: BoxDecoration( | ||
74 | + color: Colors.grey.shade200.withOpacity(0.1), | ||
75 | + ), | ||
76 | + child: Padding( | ||
77 | + padding: const EdgeInsets.all(10.0), | ||
78 | + child: Column( | ||
79 | + children: const [ | ||
80 | + Text( | ||
81 | + "题破山寺后禅院", | ||
82 | + style: TextStyle( | ||
83 | + fontSize: 24.0, | ||
84 | + color: Colors.white, | ||
85 | + ), | ||
86 | + ), | ||
87 | + Gaps.vGap16, | ||
88 | + Text( | ||
89 | + "常建", | ||
90 | + style: TextStyle( | ||
91 | + fontSize: 18.0, | ||
92 | + color: Colors.white, | ||
93 | + ), | ||
94 | + ), | ||
95 | + Gaps.vGap12, | ||
96 | + Text( | ||
97 | + "清晨入古寺,初日照高林。\n竹径通幽处,禅房花木深。\n山光悦鸟性,潭影空人心。\n万籁此都寂,但余钟磬音。", | ||
98 | + style: TextStyle( | ||
99 | + color: Colors.white, | ||
100 | + fontFamily: "ZCOOLXiaoWei", | ||
101 | + fontSize: 24.0), | ||
102 | + ), | ||
103 | + ], | ||
104 | + ), | ||
105 | + ), | ||
106 | + ), | ||
107 | + ), | ||
108 | + ), | ||
109 | + ), | ||
110 | + const Padding( | ||
111 | + padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 25.0), | ||
112 | + child: Text( | ||
113 | + "100位用户朗读录制提交了“临境”", | ||
114 | + style: TextStyle(color: Colors.black, fontSize: 16.0), | ||
115 | + ), | ||
116 | + ), | ||
117 | + Container( | ||
118 | + padding: const EdgeInsets.symmetric( | ||
119 | + vertical: 10.0, horizontal: 25.0), | ||
120 | + width: 400.0, | ||
121 | + height: 160.0, | ||
122 | + child: ListView.builder( | ||
123 | + itemBuilder: (BuildContext context, int index) { | ||
124 | + return Wrap( | ||
125 | + spacing: 5.0, | ||
126 | + crossAxisAlignment: WrapCrossAlignment.center, | ||
127 | + children: const [ | ||
128 | + Icon( | ||
129 | + Icons.play_circle_outline, | ||
130 | + size: 16.0, | ||
131 | + ), | ||
132 | + Text( | ||
133 | + "普通话", | ||
134 | + style: TextStyle(color: Colors.white, fontSize: 16.0), | ||
135 | + ) | ||
136 | + ], | ||
137 | + ); | ||
138 | + }), | ||
139 | + ), | ||
140 | + Row( | ||
141 | + children: [ | ||
142 | + IconButton( | ||
143 | + icon: const Icon(Icons.mic_none), | ||
144 | + onPressed: () {}, | ||
145 | + ), | ||
146 | + IconButton( | ||
147 | + icon: const Icon(Icons.camera_alt_outlined), | ||
148 | + onPressed: () {}, | ||
149 | + ) | ||
150 | + ], | ||
151 | + ), | ||
152 | + ], | ||
153 | + ), | ||
55 | ), | 154 | ), |
56 | - alignment: Alignment.topLeft, | ||
57 | ), | 155 | ), |
58 | ); | 156 | ); |
59 | } | 157 | } | ... | ... |
... | @@ -10,6 +10,7 @@ import 'package:one_poem/tiktok/widgets/tiktok_video.dart'; | ... | @@ -10,6 +10,7 @@ import 'package:one_poem/tiktok/widgets/tiktok_video.dart'; |
10 | import 'package:one_poem/tiktok/widgets/tiktok_video_button_column.dart'; | 10 | import 'package:one_poem/tiktok/widgets/tiktok_video_button_column.dart'; |
11 | import 'package:one_poem/tiktok/widgets/tiktok_video_poem.dart'; | 11 | import 'package:one_poem/tiktok/widgets/tiktok_video_poem.dart'; |
12 | import 'package:one_poem/util/toast_utils.dart'; | 12 | import 'package:one_poem/util/toast_utils.dart'; |
13 | +import 'package:one_poem/widgets/bars/home_action_bar.dart'; | ||
13 | import 'package:one_poem/widgets/my_app_bar.dart'; | 14 | import 'package:one_poem/widgets/my_app_bar.dart'; |
14 | import 'package:video_player/video_player.dart'; | 15 | import 'package:video_player/video_player.dart'; |
15 | 16 | ||
... | @@ -107,6 +108,12 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver { | ... | @@ -107,6 +108,12 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver { |
107 | controller: tkController, | 108 | controller: tkController, |
108 | header: MyAppBar( | 109 | header: MyAppBar( |
109 | isBack: false, | 110 | isBack: false, |
111 | + isTransparent: true, | ||
112 | + homeActionWidgets: HomeActionWidgets( | ||
113 | + funcStar: () { | ||
114 | + print("starrrrrrr"); | ||
115 | + }, | ||
116 | + ), | ||
110 | ), | 117 | ), |
111 | leftPage: searchPage, | 118 | leftPage: searchPage, |
112 | rightPage: detailPage, | 119 | rightPage: detailPage, | ... | ... |
... | @@ -10,7 +10,6 @@ class NotFoundPage extends StatelessWidget { | ... | @@ -10,7 +10,6 @@ class NotFoundPage extends StatelessWidget { |
10 | Widget build(BuildContext context) { | 10 | Widget build(BuildContext context) { |
11 | return const Scaffold( | 11 | return const Scaffold( |
12 | appBar: MyAppBar( | 12 | appBar: MyAppBar( |
13 | - centerTitle: '页面不存在', | ||
14 | ), | 13 | ), |
15 | body: StateLayout( | 14 | body: StateLayout( |
16 | type: StateType.account, | 15 | type: StateType.account, | ... | ... |
... | @@ -69,7 +69,6 @@ class _AboutPageState extends State<AboutPage> { | ... | @@ -69,7 +69,6 @@ class _AboutPageState extends State<AboutPage> { |
69 | Widget build(BuildContext context) { | 69 | Widget build(BuildContext context) { |
70 | return Scaffold( | 70 | return Scaffold( |
71 | appBar: const MyAppBar( | 71 | appBar: const MyAppBar( |
72 | - title: '关于我们', | ||
73 | ), | 72 | ), |
74 | body: Column( | 73 | body: Column( |
75 | children: <Widget>[ | 74 | children: <Widget>[ | ... | ... |
... | @@ -5,10 +5,8 @@ import 'package:one_poem/widgets/click_item.dart'; | ... | @@ -5,10 +5,8 @@ import 'package:one_poem/widgets/click_item.dart'; |
5 | import 'package:one_poem/widgets/load_image.dart'; | 5 | import 'package:one_poem/widgets/load_image.dart'; |
6 | import 'package:one_poem/widgets/my_app_bar.dart'; | 6 | import 'package:one_poem/widgets/my_app_bar.dart'; |
7 | 7 | ||
8 | - | ||
9 | /// design/8设置/index.html#artboard1 | 8 | /// design/8设置/index.html#artboard1 |
10 | class AccountManagerPage extends StatefulWidget { | 9 | class AccountManagerPage extends StatefulWidget { |
11 | - | ||
12 | const AccountManagerPage({Key? key}) : super(key: key); | 10 | const AccountManagerPage({Key? key}) : super(key: key); |
13 | 11 | ||
14 | @override | 12 | @override |
... | @@ -19,16 +17,12 @@ class _AccountManagerPageState extends State<AccountManagerPage> { | ... | @@ -19,16 +17,12 @@ class _AccountManagerPageState extends State<AccountManagerPage> { |
19 | @override | 17 | @override |
20 | Widget build(BuildContext context) { | 18 | Widget build(BuildContext context) { |
21 | return Scaffold( | 19 | return Scaffold( |
22 | - appBar: const MyAppBar( | 20 | + appBar: MyAppBar(), |
23 | - ), | ||
24 | body: Column( | 21 | body: Column( |
25 | children: <Widget>[ | 22 | children: <Widget>[ |
26 | Stack( | 23 | Stack( |
27 | children: <Widget>[ | 24 | children: <Widget>[ |
28 | - ClickItem( | 25 | + ClickItem(title: '店铺logo', onTap: () {}), |
29 | - title: '店铺logo', | ||
30 | - onTap: () {} | ||
31 | - ), | ||
32 | const Positioned( | 26 | const Positioned( |
33 | top: 8.0, | 27 | top: 8.0, |
34 | bottom: 8.0, | 28 | bottom: 8.0, |
... | @@ -38,10 +32,10 @@ class _AccountManagerPageState extends State<AccountManagerPage> { | ... | @@ -38,10 +32,10 @@ class _AccountManagerPageState extends State<AccountManagerPage> { |
38 | ], | 32 | ], |
39 | ), | 33 | ), |
40 | ClickItem( | 34 | ClickItem( |
41 | - title: '修改密码', | 35 | + title: '修改密码', |
42 | - content: '用于密码登录', | 36 | + content: '用于密码登录', |
43 | - onTap: () => NavigatorUtils.push(context, LoginRouter.updatePasswordPage) | 37 | + onTap: () => |
44 | - ), | 38 | + NavigatorUtils.push(context, LoginRouter.updatePasswordPage)), |
45 | const ClickItem( | 39 | const ClickItem( |
46 | title: '绑定账号', | 40 | title: '绑定账号', |
47 | content: '15000000000', | 41 | content: '15000000000', | ... | ... |
... | @@ -7,7 +7,6 @@ import 'package:one_poem/widgets/my_app_bar.dart'; | ... | @@ -7,7 +7,6 @@ import 'package:one_poem/widgets/my_app_bar.dart'; |
7 | import 'package:provider/provider.dart'; | 7 | import 'package:provider/provider.dart'; |
8 | 8 | ||
9 | class LocalePage extends StatefulWidget { | 9 | class LocalePage extends StatefulWidget { |
10 | - | ||
11 | const LocalePage({Key? key}) : super(key: key); | 10 | const LocalePage({Key? key}) : super(key: key); |
12 | 11 | ||
13 | @override | 12 | @override |
... | @@ -15,14 +14,13 @@ class LocalePage extends StatefulWidget { | ... | @@ -15,14 +14,13 @@ class LocalePage extends StatefulWidget { |
15 | } | 14 | } |
16 | 15 | ||
17 | class _LocalePageState extends State<LocalePage> { | 16 | class _LocalePageState extends State<LocalePage> { |
18 | - | ||
19 | final List<String> _list = <String>['跟随系统', '中文', 'English']; | 17 | final List<String> _list = <String>['跟随系统', '中文', 'English']; |
20 | 18 | ||
21 | @override | 19 | @override |
22 | Widget build(BuildContext context) { | 20 | Widget build(BuildContext context) { |
23 | final String? locale = SpUtil.getString(Constant.locale); | 21 | final String? locale = SpUtil.getString(Constant.locale); |
24 | String localeMode; | 22 | String localeMode; |
25 | - switch(locale) { | 23 | + switch (locale) { |
26 | case 'zh': | 24 | case 'zh': |
27 | localeMode = _list[1]; | 25 | localeMode = _list[1]; |
28 | break; | 26 | break; |
... | @@ -35,7 +33,6 @@ class _LocalePageState extends State<LocalePage> { | ... | @@ -35,7 +33,6 @@ class _LocalePageState extends State<LocalePage> { |
35 | } | 33 | } |
36 | return Scaffold( | 34 | return Scaffold( |
37 | appBar: const MyAppBar( | 35 | appBar: const MyAppBar( |
38 | - title: '多语言', | ||
39 | ), | 36 | ), |
40 | body: ListView.separated( | 37 | body: ListView.separated( |
41 | itemCount: _list.length, | 38 | itemCount: _list.length, |
... | @@ -43,7 +40,8 @@ class _LocalePageState extends State<LocalePage> { | ... | @@ -43,7 +40,8 @@ class _LocalePageState extends State<LocalePage> { |
43 | itemBuilder: (_, int index) { | 40 | itemBuilder: (_, int index) { |
44 | return InkWell( | 41 | return InkWell( |
45 | onTap: () { | 42 | onTap: () { |
46 | - final String locale = index == 0 ? '' : (index == 1 ? 'zh' : 'en'); | 43 | + final String locale = |
44 | + index == 0 ? '' : (index == 1 ? 'zh' : 'en'); | ||
47 | context.read<LocaleProvider>().setLocale(locale); | 45 | context.read<LocaleProvider>().setLocale(locale); |
48 | Toast.show('当前功能仅登录模块有效'); | 46 | Toast.show('当前功能仅登录模块有效'); |
49 | setState(() {}); | 47 | setState(() {}); | ... | ... |
... | @@ -25,8 +25,7 @@ class _SettingPageState extends State<SettingPage> { | ... | @@ -25,8 +25,7 @@ class _SettingPageState extends State<SettingPage> { |
25 | @override | 25 | @override |
26 | Widget build(BuildContext context) { | 26 | Widget build(BuildContext context) { |
27 | return Scaffold( | 27 | return Scaffold( |
28 | - appBar: const MyAppBar( | 28 | + appBar: const MyAppBar( |
29 | - centerTitle: '设置', | ||
30 | ), | 29 | ), |
31 | body: Column( | 30 | body: Column( |
32 | children: <Widget>[ | 31 | children: <Widget>[ | ... | ... |
... | @@ -6,7 +6,6 @@ import 'package:one_poem/widgets/my_app_bar.dart'; | ... | @@ -6,7 +6,6 @@ import 'package:one_poem/widgets/my_app_bar.dart'; |
6 | import 'package:provider/provider.dart'; | 6 | import 'package:provider/provider.dart'; |
7 | 7 | ||
8 | class ThemePage extends StatefulWidget { | 8 | class ThemePage extends StatefulWidget { |
9 | - | ||
10 | const ThemePage({Key? key}) : super(key: key); | 9 | const ThemePage({Key? key}) : super(key: key); |
11 | 10 | ||
12 | @override | 11 | @override |
... | @@ -14,14 +13,13 @@ class ThemePage extends StatefulWidget { | ... | @@ -14,14 +13,13 @@ class ThemePage extends StatefulWidget { |
14 | } | 13 | } |
15 | 14 | ||
16 | class _ThemePageState extends State<ThemePage> { | 15 | class _ThemePageState extends State<ThemePage> { |
17 | - | ||
18 | final List<String> _list = <String>['跟随系统', '开启', '关闭']; | 16 | final List<String> _list = <String>['跟随系统', '开启', '关闭']; |
19 | 17 | ||
20 | @override | 18 | @override |
21 | Widget build(BuildContext context) { | 19 | Widget build(BuildContext context) { |
22 | final String? theme = SpUtil.getString(Constant.theme); | 20 | final String? theme = SpUtil.getString(Constant.theme); |
23 | String themeMode; | 21 | String themeMode; |
24 | - switch(theme) { | 22 | + switch (theme) { |
25 | case 'Dark': | 23 | case 'Dark': |
26 | themeMode = _list[1]; | 24 | themeMode = _list[1]; |
27 | break; | 25 | break; |
... | @@ -33,16 +31,16 @@ class _ThemePageState extends State<ThemePage> { | ... | @@ -33,16 +31,16 @@ class _ThemePageState extends State<ThemePage> { |
33 | break; | 31 | break; |
34 | } | 32 | } |
35 | return Scaffold( | 33 | return Scaffold( |
36 | - appBar: const MyAppBar( | 34 | + appBar: const MyAppBar(), |
37 | - title: '夜间模式', | ||
38 | - ), | ||
39 | body: ListView.separated( | 35 | body: ListView.separated( |
40 | itemCount: _list.length, | 36 | itemCount: _list.length, |
41 | separatorBuilder: (_, __) => const Divider(), | 37 | separatorBuilder: (_, __) => const Divider(), |
42 | itemBuilder: (_, int index) { | 38 | itemBuilder: (_, int index) { |
43 | return InkWell( | 39 | return InkWell( |
44 | onTap: () { | 40 | onTap: () { |
45 | - final ThemeMode themeMode = index == 0 ? ThemeMode.system : (index == 1 ? ThemeMode.dark : ThemeMode.light); | 41 | + final ThemeMode themeMode = index == 0 |
42 | + ? ThemeMode.system | ||
43 | + : (index == 1 ? ThemeMode.dark : ThemeMode.light); | ||
46 | // Provider.of<ThemeProvider>(context, listen: false).setTheme(themeMode); | 44 | // Provider.of<ThemeProvider>(context, listen: false).setTheme(themeMode); |
47 | /// 与上方等价,provider 4.1.0添加的拓展方法 | 45 | /// 与上方等价,provider 4.1.0添加的拓展方法 |
48 | context.read<ThemeProvider>().setTheme(themeMode); | 46 | context.read<ThemeProvider>().setTheme(themeMode); | ... | ... |
1 | +import 'dart:ui'; | ||
2 | + | ||
1 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
4 | +import 'package:one_poem/res/resources.dart'; | ||
2 | import 'package:one_poem/tiktok/style/style.dart'; | 5 | import 'package:one_poem/tiktok/style/style.dart'; |
3 | 6 | ||
4 | class TikTokTopInfoColumn extends StatelessWidget { | 7 | class TikTokTopInfoColumn extends StatelessWidget { |
... | @@ -12,28 +15,43 @@ class TikTokTopInfoColumn extends StatelessWidget { | ... | @@ -12,28 +15,43 @@ class TikTokTopInfoColumn extends StatelessWidget { |
12 | 15 | ||
13 | @override | 16 | @override |
14 | Widget build(BuildContext context) { | 17 | Widget build(BuildContext context) { |
15 | - return Container( | 18 | + return SafeArea( |
16 | - margin: const EdgeInsets.all(10.0), | 19 | + child: Container( |
17 | - child: Column( | 20 | + margin: const EdgeInsets.symmetric(vertical: 40.0, horizontal: 25.0), |
18 | - mainAxisAlignment: MainAxisAlignment.end, | 21 | + height: 100.0, |
19 | - crossAxisAlignment: CrossAxisAlignment.end, | 22 | + width: double.infinity, |
20 | - children: <Widget>[ | 23 | + decoration: BoxDecoration( |
21 | - // Tapped( | 24 | + color: Colors.grey.shade200.withOpacity(0.1), |
22 | - // child: const TikTokAvatar(), | 25 | + border: Border.all(color: Colors.grey, width: 0.1), // 边色与边宽度 |
23 | - // onTap: onAvatar, | 26 | + borderRadius: BorderRadius.circular(2.0), |
24 | - // ), | 27 | + ), |
25 | - Text(info ?? "早安"), | 28 | + child: ClipRect( |
26 | - Container( | 29 | + child: BackdropFilter( |
27 | - width: SysSize.avatar, | 30 | + filter: ImageFilter.blur( |
28 | - height: SysSize.avatar, | 31 | + sigmaX: 10.0, |
29 | - margin: const EdgeInsets.only(top: 10), | 32 | + sigmaY: 10.0, |
33 | + ), | ||
34 | + child: Container( | ||
30 | decoration: BoxDecoration( | 35 | decoration: BoxDecoration( |
31 | - borderRadius: BorderRadius.circular(SysSize.avatar / 2.0), | 36 | + color: Colors.grey.shade200.withOpacity(0.1), |
32 | - // color: Colors.black.withOpacity(0.8), | 37 | + ), |
38 | + child: Padding( | ||
39 | + padding: const EdgeInsets.all(10.0), | ||
40 | + child: Column( | ||
41 | + children: const [ | ||
42 | + Text( | ||
43 | + '早安', | ||
44 | + style: TextStyle( | ||
45 | + fontSize: 28.0, | ||
46 | + color: Colors.white, | ||
47 | + ), | ||
48 | + ), | ||
49 | + ], | ||
50 | + ), | ||
33 | ), | 51 | ), |
34 | - ) | 52 | + ), |
35 | - ], | 53 | + ), |
36 | ), | 54 | ), |
37 | - ); | 55 | + )); |
38 | } | 56 | } |
39 | } | 57 | } | ... | ... |
... | @@ -96,7 +96,7 @@ class TikTokVideoPage extends StatelessWidget { | ... | @@ -96,7 +96,7 @@ class TikTokVideoPage extends StatelessWidget { |
96 | Container( | 96 | Container( |
97 | height: double.infinity, | 97 | height: double.infinity, |
98 | width: double.infinity, | 98 | width: double.infinity, |
99 | - alignment: Alignment.bottomLeft, | 99 | + alignment: Alignment.bottomCenter, |
100 | child: leftPoem, | 100 | child: leftPoem, |
101 | ), | 101 | ), |
102 | Container( | 102 | Container( | ... | ... |
... | @@ -23,12 +23,13 @@ class TikTokVidePoem extends StatelessWidget { | ... | @@ -23,12 +23,13 @@ class TikTokVidePoem extends StatelessWidget { |
23 | Widget build(BuildContext context) { | 23 | Widget build(BuildContext context) { |
24 | return Container( | 24 | return Container( |
25 | decoration: BoxDecoration( | 25 | decoration: BoxDecoration( |
26 | - color: Colors.black.withOpacity(.5), | 26 | + color: Colors.grey.shade200.withOpacity(0.1), |
27 | border: Border.all(color: Colors.grey, width: 0.1), // 边色与边宽度 | 27 | border: Border.all(color: Colors.grey, width: 0.1), // 边色与边宽度 |
28 | borderRadius: BorderRadius.circular(2.0), | 28 | borderRadius: BorderRadius.circular(2.0), |
29 | ), | 29 | ), |
30 | height: 220.0, | 30 | height: 220.0, |
31 | - margin: const EdgeInsets.all(10.0), | 31 | + width: double.infinity, |
32 | + margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 25.0), | ||
32 | child: InkWell( | 33 | child: InkWell( |
33 | child: ClipRect( | 34 | child: ClipRect( |
34 | child: BackdropFilter( | 35 | child: BackdropFilter( |
... | @@ -46,8 +47,15 @@ class TikTokVidePoem extends StatelessWidget { | ... | @@ -46,8 +47,15 @@ class TikTokVidePoem extends StatelessWidget { |
46 | children: [ | 47 | children: [ |
47 | Text( | 48 | Text( |
48 | title ?? '每日一言', | 49 | title ?? '每日一言', |
50 | +<<<<<<< HEAD | ||
49 | style: | 51 | style: |
50 | const TextStyle(color: Colors.white, fontSize: 28.0), | 52 | const TextStyle(color: Colors.white, fontSize: 28.0), |
53 | +======= | ||
54 | + style: const TextStyle( | ||
55 | + fontSize: 28.0, | ||
56 | + color: Colors.white, | ||
57 | + ), | ||
58 | +>>>>>>> 9fecb8a6ef8a0360e7ff66980f084c393cc257ed | ||
51 | ), | 59 | ), |
52 | Gaps.vGap10, | 60 | Gaps.vGap10, |
53 | Text( | 61 | Text( |
... | @@ -59,8 +67,15 @@ class TikTokVidePoem extends StatelessWidget { | ... | @@ -59,8 +67,15 @@ class TikTokVidePoem extends StatelessWidget { |
59 | ), | 67 | ), |
60 | Text( | 68 | Text( |
61 | author ?? '诗人', | 69 | author ?? '诗人', |
70 | +<<<<<<< HEAD | ||
62 | style: | 71 | style: |
63 | const TextStyle(color: Colors.white, fontSize: 16.0), | 72 | const TextStyle(color: Colors.white, fontSize: 16.0), |
73 | +======= | ||
74 | + style: const TextStyle( | ||
75 | + fontSize: 16.0, | ||
76 | + color: Colors.white, | ||
77 | + ), | ||
78 | +>>>>>>> 9fecb8a6ef8a0360e7ff66980f084c393cc257ed | ||
64 | ), | 79 | ), |
65 | ], | 80 | ], |
66 | ), | 81 | ), |
... | @@ -69,7 +84,7 @@ class TikTokVidePoem extends StatelessWidget { | ... | @@ -69,7 +84,7 @@ class TikTokVidePoem extends StatelessWidget { |
69 | ), | 84 | ), |
70 | ), | 85 | ), |
71 | onTap: () { | 86 | onTap: () { |
72 | - onShowDetail; | 87 | + onShowDetail!(); |
73 | }, | 88 | }, |
74 | ), | 89 | ), |
75 | ); | 90 | ); | ... | ... |
lib/widgets/bars/home_action_bar.dart
0 → 100644
1 | +import 'package:flutter/material.dart'; | ||
2 | +import 'package:one_poem/res/resources.dart'; | ||
3 | + | ||
4 | +class HomeActionWidgets extends StatelessWidget { | ||
5 | + const HomeActionWidgets({ | ||
6 | + Key? key, | ||
7 | + this.funcStar, | ||
8 | + this.funcShare, | ||
9 | + this.funcMore, | ||
10 | + }) : super(key: key); | ||
11 | + | ||
12 | + final Function? funcStar; | ||
13 | + final Function? funcShare; | ||
14 | + final Function? funcMore; | ||
15 | + | ||
16 | + @override | ||
17 | + Widget build(BuildContext context) { | ||
18 | + const iconHeight = 30.0; | ||
19 | + const iconWidth = 30.0; | ||
20 | + const iconSize = 20.0; | ||
21 | + return Row( | ||
22 | + mainAxisSize: MainAxisSize.min, | ||
23 | + mainAxisAlignment: MainAxisAlignment.center, | ||
24 | + children: [ | ||
25 | + SizedBox( | ||
26 | + height: iconHeight, | ||
27 | + width: iconWidth, | ||
28 | + child: IconButton( | ||
29 | + padding: const EdgeInsets.all(0.0), | ||
30 | + icon: const Icon( | ||
31 | + Icons.star_border, | ||
32 | + size: iconSize, | ||
33 | + ), | ||
34 | + onPressed: () { | ||
35 | + funcStar!(); | ||
36 | + }, | ||
37 | + ), | ||
38 | + ), | ||
39 | + SizedBox( | ||
40 | + height: iconHeight, | ||
41 | + width: iconWidth, | ||
42 | + child: IconButton( | ||
43 | + padding: const EdgeInsets.all(0.0), | ||
44 | + icon: const Icon( | ||
45 | + Icons.ios_share, | ||
46 | + size: iconSize, | ||
47 | + ), | ||
48 | + onPressed: () {}, | ||
49 | + ), | ||
50 | + ), | ||
51 | + SizedBox( | ||
52 | + height: iconHeight, | ||
53 | + width: iconWidth, | ||
54 | + child: IconButton( | ||
55 | + padding: const EdgeInsets.all(0.0), | ||
56 | + onPressed: () {}, | ||
57 | + icon: const Icon( | ||
58 | + Icons.more_horiz, | ||
59 | + size: iconSize, | ||
60 | + ), | ||
61 | + ), | ||
62 | + ), | ||
63 | + ], | ||
64 | + ); | ||
65 | + } | ||
66 | +} |
lib/widgets/bars/home_title_bar.dart
0 → 100644
1 | +import 'package:flutter/material.dart'; | ||
2 | + | ||
3 | +class HomeTitleHeader extends StatelessWidget { | ||
4 | + const HomeTitleHeader({ | ||
5 | + Key? key, | ||
6 | + this.funcLeft, | ||
7 | + this.funcCenter, | ||
8 | + this.funcRight, | ||
9 | + }) : super(key: key); | ||
10 | + | ||
11 | + final Function? funcLeft; | ||
12 | + final Function? funcCenter; | ||
13 | + final Function? funcRight; | ||
14 | + | ||
15 | + @override | ||
16 | + Widget build(BuildContext context) { | ||
17 | + return Container( | ||
18 | + alignment: Alignment.center, | ||
19 | + margin: const EdgeInsets.symmetric(horizontal: 5.0), | ||
20 | + child: Row( | ||
21 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
22 | + mainAxisSize: MainAxisSize.min, | ||
23 | + //交叉轴的布局方式,对于column来说就是水平方向的布局方式 | ||
24 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
25 | + children: <Widget>[ | ||
26 | + SizedBox( | ||
27 | + width: 60.0, | ||
28 | + child: TextButton( | ||
29 | + onPressed: () => funcLeft!(), | ||
30 | + child: const Text( | ||
31 | + "一言", | ||
32 | + style: TextStyle(color: Colors.white), | ||
33 | + ), | ||
34 | + ), | ||
35 | + ), | ||
36 | + const VerticalDivider( | ||
37 | + color: Colors.white, | ||
38 | + width: 1.0, | ||
39 | + thickness: 1.0, | ||
40 | + indent: 15.0, | ||
41 | + endIndent: 15.0, | ||
42 | + ), | ||
43 | + TextButton( | ||
44 | + onPressed: () => funcCenter!(), | ||
45 | + child: const Text( | ||
46 | + "译解", | ||
47 | + style: TextStyle(color: Colors.white), | ||
48 | + ), | ||
49 | + ), | ||
50 | + const VerticalDivider( | ||
51 | + color: Colors.white, | ||
52 | + width: 1.0, | ||
53 | + thickness: 1.0, | ||
54 | + indent: 15.0, | ||
55 | + endIndent: 15.0, | ||
56 | + ), | ||
57 | + TextButton( | ||
58 | + onPressed: () => funcRight!(), | ||
59 | + child: const Text( | ||
60 | + "临境", | ||
61 | + style: TextStyle(color: Colors.white), | ||
62 | + ), | ||
63 | + ), | ||
64 | + ], | ||
65 | + )); | ||
66 | + } | ||
67 | +} |
... | @@ -8,38 +8,20 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { | ... | @@ -8,38 +8,20 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { |
8 | const MyAppBar({ | 8 | const MyAppBar({ |
9 | Key? key, | 9 | Key? key, |
10 | this.backgroundColor, | 10 | this.backgroundColor, |
11 | - this.title = '', | ||
12 | - this.centerTitle = '', | ||
13 | - this.actionName = '', | ||
14 | - this.backImg = 'assets/images/ic_back_black.png', | ||
15 | - this.backImgColor, | ||
16 | this.onPressed, | 11 | this.onPressed, |
17 | this.isBack = true, | 12 | this.isBack = true, |
18 | - this.buttonLeft, | 13 | + this.homeTitleHeader, |
19 | - this.funcLeft, | 14 | + this.homeActionWidgets, |
20 | - this.buttonCenter, | 15 | + this.isTransparent = false, |
21 | - this.funcCenter, | ||
22 | - this.buttonRight, | ||
23 | - this.funcRight, | ||
24 | - this.isShowButtons = false, | ||
25 | }) : super(key: key); | 16 | }) : super(key: key); |
26 | 17 | ||
27 | final Color? backgroundColor; | 18 | final Color? backgroundColor; |
28 | - final String title; | ||
29 | - final String centerTitle; | ||
30 | - final String backImg; | ||
31 | - final Color? backImgColor; | ||
32 | - final String actionName; | ||
33 | final VoidCallback? onPressed; | 19 | final VoidCallback? onPressed; |
34 | final bool isBack; | 20 | final bool isBack; |
35 | - final bool isShowButtons; | 21 | + final bool isTransparent; |
36 | 22 | ||
37 | - final String? buttonLeft; | 23 | + final Widget? homeTitleHeader; |
38 | - final Function? funcLeft; | 24 | + final Widget? homeActionWidgets; |
39 | - final String? buttonCenter; | ||
40 | - final Function? funcCenter; | ||
41 | - final String? buttonRight; | ||
42 | - final Function? funcRight; | ||
43 | 25 | ||
44 | @override | 26 | @override |
45 | Widget build(BuildContext context) { | 27 | Widget build(BuildContext context) { |
... | @@ -51,6 +33,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { | ... | @@ -51,6 +33,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { |
51 | ? SystemUiOverlayStyle.light | 33 | ? SystemUiOverlayStyle.light |
52 | : SystemUiOverlayStyle.dark; | 34 | : SystemUiOverlayStyle.dark; |
53 | 35 | ||
36 | +<<<<<<< HEAD | ||
54 | final Widget action = actionName.isNotEmpty | 37 | final Widget action = actionName.isNotEmpty |
55 | ? Positioned( | 38 | ? Positioned( |
56 | right: 0.0, | 39 | right: 0.0, |
... | @@ -84,6 +67,8 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { | ... | @@ -84,6 +67,8 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { |
84 | ) | 67 | ) |
85 | : Gaps.empty; | 68 | : Gaps.empty; |
86 | 69 | ||
70 | +======= | ||
71 | +>>>>>>> 9fecb8a6ef8a0360e7ff66980f084c393cc257ed | ||
87 | final Widget back = isBack | 72 | final Widget back = isBack |
88 | ? IconButton( | 73 | ? IconButton( |
89 | onPressed: () async { | 74 | onPressed: () async { |
... | @@ -95,13 +80,11 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { | ... | @@ -95,13 +80,11 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { |
95 | }, | 80 | }, |
96 | tooltip: '返回', | 81 | tooltip: '返回', |
97 | padding: const EdgeInsets.all(12.0), | 82 | padding: const EdgeInsets.all(12.0), |
98 | - icon: Image.asset( | 83 | + icon: const Icon(Icons.arrow_back_ios_outlined), |
99 | - backImg, | ||
100 | - color: backImgColor ?? ThemeUtils.getIconColor(context), | ||
101 | - ), | ||
102 | ) | 84 | ) |
103 | : Gaps.empty; | 85 | : Gaps.empty; |
104 | 86 | ||
87 | +<<<<<<< HEAD | ||
105 | // TODO 复用组件 | 88 | // TODO 复用组件 |
106 | final Widget titleWidget = Semantics( | 89 | final Widget titleWidget = Semantics( |
107 | namesRoute: true, | 90 | namesRoute: true, |
... | @@ -145,11 +128,14 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { | ... | @@ -145,11 +128,14 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { |
145 | : Gaps.hGap10, | 128 | : Gaps.hGap10, |
146 | ); | 129 | ); |
147 | 130 | ||
131 | +======= | ||
132 | +>>>>>>> 9fecb8a6ef8a0360e7ff66980f084c393cc257ed | ||
148 | return AnnotatedRegion<SystemUiOverlayStyle>( | 133 | return AnnotatedRegion<SystemUiOverlayStyle>( |
149 | value: _overlayStyle, | 134 | value: _overlayStyle, |
150 | child: Material( | 135 | child: Material( |
151 | - color: Colors.transparent, | 136 | + color: isTransparent ? Colors.transparent : Colors.black, |
152 | child: SafeArea( | 137 | child: SafeArea( |
138 | +<<<<<<< HEAD | ||
153 | child: Flex( | 139 | child: Flex( |
154 | direction: Axis.horizontal, | 140 | direction: Axis.horizontal, |
155 | children: [ | 141 | children: [ |
... | @@ -164,6 +150,24 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { | ... | @@ -164,6 +150,24 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { |
164 | Expanded( | 150 | Expanded( |
165 | child: action, | 151 | child: action, |
166 | flex: 2, | 152 | flex: 2, |
153 | +======= | ||
154 | + child: Stack( | ||
155 | + alignment: Alignment.center, | ||
156 | + children: <Widget>[ | ||
157 | + Positioned( | ||
158 | + left: 5, | ||
159 | + child: back, | ||
160 | + ), | ||
161 | + SizedBox( | ||
162 | + width: MediaQuery.of(context).size.width, | ||
163 | + child: homeTitleHeader, | ||
164 | + ), | ||
165 | + SizedBox( | ||
166 | + child: Container( | ||
167 | + alignment: Alignment.centerRight, | ||
168 | + child: homeActionWidgets, | ||
169 | + ), | ||
170 | +>>>>>>> 9fecb8a6ef8a0360e7ff66980f084c393cc257ed | ||
167 | ), | 171 | ), |
168 | ], | 172 | ], |
169 | ), | 173 | ), | ... | ... |
-
Please register or login to post a comment