Showing
3 changed files
with
171 additions
and
0 deletions
... | @@ -2,6 +2,8 @@ import 'package:flutter/cupertino.dart'; | ... | @@ -2,6 +2,8 @@ import 'package:flutter/cupertino.dart'; |
2 | import 'package:flutter/material.dart'; | 2 | import 'package:flutter/material.dart'; |
3 | import 'package:one_poem/tiktok/controller/tiktok_video_list_controller.dart'; | 3 | import 'package:one_poem/tiktok/controller/tiktok_video_list_controller.dart'; |
4 | import 'package:one_poem/tiktok/mock/video.dart'; | 4 | import 'package:one_poem/tiktok/mock/video.dart'; |
5 | +import 'package:one_poem/tiktok/pages/search_page.dart'; | ||
6 | +import 'package:one_poem/tiktok/pages/user_page.dart'; | ||
5 | import 'package:one_poem/tiktok/style/physics.dart'; | 7 | import 'package:one_poem/tiktok/style/physics.dart'; |
6 | import 'package:one_poem/tiktok/views/tiktok_header.dart'; | 8 | import 'package:one_poem/tiktok/views/tiktok_header.dart'; |
7 | import 'package:one_poem/tiktok/views/tiktok_scaffold.dart'; | 9 | import 'package:one_poem/tiktok/views/tiktok_scaffold.dart'; |
... | @@ -96,10 +98,23 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver { | ... | @@ -96,10 +98,23 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver { |
96 | }, | 98 | }, |
97 | ); | 99 | ); |
98 | 100 | ||
101 | + var userPage = UserPage( | ||
102 | + isSelfPage: false, | ||
103 | + canPop: true, | ||
104 | + onPop: () { | ||
105 | + tkController.animateToMiddle(); | ||
106 | + }, | ||
107 | + ); | ||
108 | + var searchPage = SearchPage( | ||
109 | + onPop: tkController.animateToMiddle, | ||
110 | + ); | ||
111 | + | ||
99 | // 组合 | 112 | // 组合 |
100 | return TikTokScaffold( | 113 | return TikTokScaffold( |
101 | controller: tkController, | 114 | controller: tkController, |
102 | header: header, | 115 | header: header, |
116 | + leftPage: searchPage, | ||
117 | + rightPage: userPage, | ||
103 | enableGesture: true, | 118 | enableGesture: true, |
104 | page: Stack( | 119 | page: Stack( |
105 | // index: currentPage == null ? 0 : 1, | 120 | // index: currentPage == null ? 0 : 1, | ... | ... |
lib/tiktok/pages/search_page.dart
0 → 100644
1 | +import 'package:flutter/material.dart'; | ||
2 | +import 'package:one_poem/tiktok/style/style.dart'; | ||
3 | +import 'package:tapped/tapped.dart'; | ||
4 | + | ||
5 | +class SearchPage extends StatefulWidget { | ||
6 | + final Function? onPop; | ||
7 | + | ||
8 | + const SearchPage({ | ||
9 | + Key? key, | ||
10 | + this.onPop, | ||
11 | + }) : super(key: key); | ||
12 | + @override | ||
13 | + _SearchPageState createState() => _SearchPageState(); | ||
14 | +} | ||
15 | + | ||
16 | +class _SearchPageState extends State<SearchPage> { | ||
17 | + @override | ||
18 | + Widget build(BuildContext context) { | ||
19 | + Widget head = Container( | ||
20 | + padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), | ||
21 | + color: ColorPlate.back2, | ||
22 | + width: double.infinity, | ||
23 | + alignment: Alignment.center, | ||
24 | + child: Container( | ||
25 | + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), | ||
26 | + child: Row( | ||
27 | + children: <Widget>[ | ||
28 | + const Icon( | ||
29 | + Icons.fullscreen, | ||
30 | + size: 24, | ||
31 | + ), | ||
32 | + Expanded( | ||
33 | + child: Container( | ||
34 | + height: 32, | ||
35 | + margin: const EdgeInsets.only(right: 20, left: 12), | ||
36 | + decoration: BoxDecoration( | ||
37 | + color: Colors.white.withOpacity(0.2), | ||
38 | + borderRadius: BorderRadius.circular(4), | ||
39 | + ), | ||
40 | + padding: const EdgeInsets.only(left: 12), | ||
41 | + child: Opacity( | ||
42 | + opacity: 0.3, | ||
43 | + child: Row( | ||
44 | + children: <Widget>[ | ||
45 | + const Icon( | ||
46 | + Icons.search, | ||
47 | + size: 20, | ||
48 | + ), | ||
49 | + Container( | ||
50 | + padding: const EdgeInsets.only(left: 2, bottom: 2), | ||
51 | + child: const Text( | ||
52 | + '搜索内容', | ||
53 | + style: StandardTextStyle.normal, | ||
54 | + ), | ||
55 | + ) | ||
56 | + ], | ||
57 | + ), | ||
58 | + ), | ||
59 | + ), | ||
60 | + ), | ||
61 | + Tapped( | ||
62 | + child: Text( | ||
63 | + '取消', | ||
64 | + style: StandardTextStyle.normal.apply(color: ColorPlate.orange), | ||
65 | + ), | ||
66 | + onTap: widget.onPop, | ||
67 | + ), | ||
68 | + ], | ||
69 | + ), | ||
70 | + ), | ||
71 | + ); | ||
72 | + Widget body = ListView( | ||
73 | + padding: EdgeInsets.zero, | ||
74 | + children: <Widget>[ | ||
75 | + const _SearchSelectRow(), | ||
76 | + const _SearchSelectRow(), | ||
77 | + const Opacity( | ||
78 | + opacity: 0.6, | ||
79 | + child: SizedBox( | ||
80 | + height: 46, | ||
81 | + child: Center(child: Text('全部搜索记录')), | ||
82 | + ), | ||
83 | + ), | ||
84 | + Container( | ||
85 | + margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 16), | ||
86 | + child: AspectRatio( | ||
87 | + aspectRatio: 4.0, | ||
88 | + child: Container( | ||
89 | + decoration: BoxDecoration( | ||
90 | + color: ColorPlate.darkGray, | ||
91 | + border: Border.all(color: Colors.black), | ||
92 | + borderRadius: BorderRadius.circular(8), | ||
93 | + ), | ||
94 | + alignment: Alignment.center, | ||
95 | + child: Text( | ||
96 | + '预留轮播图', | ||
97 | + style: TextStyle( | ||
98 | + color: Colors.white.withOpacity(0.1), | ||
99 | + fontSize: 18, | ||
100 | + fontWeight: FontWeight.w900, | ||
101 | + ), | ||
102 | + ), | ||
103 | + ), | ||
104 | + ), | ||
105 | + ), | ||
106 | + ], | ||
107 | + ); | ||
108 | + return Scaffold( | ||
109 | + body: Container( | ||
110 | + color: ColorPlate.back1, | ||
111 | + height: double.infinity, | ||
112 | + width: double.infinity, | ||
113 | + child: Column( | ||
114 | + children: <Widget>[ | ||
115 | + head, | ||
116 | + Expanded(child: body), | ||
117 | + ], | ||
118 | + ), | ||
119 | + ), | ||
120 | + ); | ||
121 | + } | ||
122 | +} | ||
123 | + | ||
124 | +class _SearchSelectRow extends StatelessWidget { | ||
125 | + const _SearchSelectRow({ | ||
126 | + Key? key, | ||
127 | + }) : super(key: key); | ||
128 | + | ||
129 | + @override | ||
130 | + Widget build(BuildContext context) { | ||
131 | + return Container( | ||
132 | + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), | ||
133 | + child: Row( | ||
134 | + children: <Widget>[ | ||
135 | + const Icon( | ||
136 | + Icons.timelapse, | ||
137 | + size: 20, | ||
138 | + ), | ||
139 | + Expanded( | ||
140 | + child: Container( | ||
141 | + padding: const EdgeInsets.only(left: 8, bottom: 1), | ||
142 | + child: const Text( | ||
143 | + '搜索唐诗宋词元曲3000首', | ||
144 | + style: StandardTextStyle.normal, | ||
145 | + ), | ||
146 | + ), | ||
147 | + ), | ||
148 | + const Icon( | ||
149 | + Icons.clear, | ||
150 | + size: 20, | ||
151 | + ), | ||
152 | + ], | ||
153 | + ), | ||
154 | + ); | ||
155 | + } | ||
156 | +} |
lib/tiktok/pages/user_page.dart
0 → 100644
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment