Showing
4 changed files
with
234 additions
and
25 deletions
... | @@ -7,6 +7,7 @@ import 'package:one_poem/poem/widgets/poem_user_audio.dart'; | ... | @@ -7,6 +7,7 @@ import 'package:one_poem/poem/widgets/poem_user_audio.dart'; |
7 | import 'package:one_poem/poem/widgets/poem_user_comments.dart'; | 7 | import 'package:one_poem/poem/widgets/poem_user_comments.dart'; |
8 | import 'package:one_poem/res/gaps.dart'; | 8 | import 'package:one_poem/res/gaps.dart'; |
9 | import 'package:one_poem/routers/fluro_navigator.dart'; | 9 | import 'package:one_poem/routers/fluro_navigator.dart'; |
10 | +import 'package:one_poem/util/toast_utils.dart'; | ||
10 | import 'package:one_poem/widgets/bars/home_action_bar.dart'; | 11 | import 'package:one_poem/widgets/bars/home_action_bar.dart'; |
11 | import 'package:one_poem/widgets/bars/home_menu_bar.dart'; | 12 | import 'package:one_poem/widgets/bars/home_menu_bar.dart'; |
12 | import 'package:one_poem/widgets/my_app_bar.dart'; | 13 | import 'package:one_poem/widgets/my_app_bar.dart'; |
... | @@ -148,7 +149,9 @@ class _PoemDetailPageState extends State<PoemDetailPage> { | ... | @@ -148,7 +149,9 @@ class _PoemDetailPageState extends State<PoemDetailPage> { |
148 | Icons.camera_alt_outlined, | 149 | Icons.camera_alt_outlined, |
149 | size: 36.px, | 150 | size: 36.px, |
150 | ), | 151 | ), |
151 | - onPressed: () {}, | 152 | + onPressed: () { |
153 | + Toast.show("不要着急吖,正在开发ing...."); | ||
154 | + }, | ||
152 | ) | 155 | ) |
153 | ], | 156 | ], |
154 | ), | 157 | ), | ... | ... |
lib/poem/page/poem_publish.dart
0 → 100644
1 | +import 'package:flutter/material.dart'; | ||
2 | +import 'package:one_poem/res/resources.dart'; | ||
3 | +import 'package:one_poem/util/toast_utils.dart'; | ||
4 | +import 'package:one_poem/widgets/my_app_bar.dart'; | ||
5 | + | ||
6 | +class PoemPublish extends StatefulWidget { | ||
7 | + const PoemPublish({Key? key, required this.data}) : super(key: key); | ||
8 | + | ||
9 | + final String data; | ||
10 | + @override | ||
11 | + _PoemPublishState createState() => _PoemPublishState(); | ||
12 | +} | ||
13 | + | ||
14 | +class _PoemPublishState extends State<PoemPublish> { | ||
15 | + @override | ||
16 | + void initState() { | ||
17 | + super.initState(); | ||
18 | + } | ||
19 | + | ||
20 | + @override | ||
21 | + void dispose() { | ||
22 | + super.dispose(); | ||
23 | + } | ||
24 | + | ||
25 | + @override | ||
26 | + Widget build(BuildContext context) { | ||
27 | + return Scaffold( | ||
28 | + appBar: MyAppBar( | ||
29 | + homeMenuHeader: Container( | ||
30 | + alignment: Alignment.center, | ||
31 | + width: double.infinity, | ||
32 | + child: const Text( | ||
33 | + "发布临境", | ||
34 | + style: TextStyle( | ||
35 | + color: Colors.white, | ||
36 | + ), | ||
37 | + ), | ||
38 | + ), | ||
39 | + ), | ||
40 | + body: Column( | ||
41 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
42 | + children: <Widget>[ | ||
43 | + Padding( | ||
44 | + padding: const EdgeInsets.all( | ||
45 | + 10.0, | ||
46 | + ), | ||
47 | + child: ConstrainedBox( | ||
48 | + constraints: const BoxConstraints( | ||
49 | + maxHeight: 200, | ||
50 | + maxWidth: double.infinity, | ||
51 | + ), | ||
52 | + child: TextField( | ||
53 | + maxLines: 10, | ||
54 | + decoration: InputDecoration( | ||
55 | + contentPadding: const EdgeInsets.all(10.0), | ||
56 | + hintText: '读此一言,仿佛身临其境', | ||
57 | + border: OutlineInputBorder( | ||
58 | + borderRadius: BorderRadius.circular(5), | ||
59 | + borderSide: BorderSide.none), | ||
60 | + filled: true, | ||
61 | + fillColor: Colors.grey.shade100, | ||
62 | + ), | ||
63 | + ), | ||
64 | + ), | ||
65 | + ), | ||
66 | + Container( | ||
67 | + padding: const EdgeInsets.all(10.0), | ||
68 | + alignment: Alignment.centerLeft, | ||
69 | + width: double.infinity, | ||
70 | + height: 36.0, | ||
71 | + child: Wrap( | ||
72 | + children: const [ | ||
73 | + Icon( | ||
74 | + Icons.room_outlined, | ||
75 | + size: 15, | ||
76 | + ), | ||
77 | + Text( | ||
78 | + "我在此地", | ||
79 | + style: TextStyle(color: Colors.black45), | ||
80 | + ), | ||
81 | + ], | ||
82 | + ), | ||
83 | + ), | ||
84 | + Container( | ||
85 | + padding: const EdgeInsets.all(10.0), | ||
86 | + alignment: Alignment.centerLeft, | ||
87 | + width: double.infinity, | ||
88 | + height: 36.0, | ||
89 | + child: Wrap( | ||
90 | + children: const [ | ||
91 | + Icon( | ||
92 | + Icons.room_outlined, | ||
93 | + size: 15, | ||
94 | + ), | ||
95 | + Text( | ||
96 | + "所用口音", | ||
97 | + style: TextStyle(color: Colors.black45), | ||
98 | + ), | ||
99 | + Gaps.hGap10, | ||
100 | + Text( | ||
101 | + "普通话", | ||
102 | + style: TextStyle(color: Colors.black45), | ||
103 | + ), | ||
104 | + ], | ||
105 | + ), | ||
106 | + ), | ||
107 | + Gaps.vGap24, | ||
108 | + Expanded( | ||
109 | + child: Column( | ||
110 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
111 | + children: [ | ||
112 | + Container( | ||
113 | + height: 36.0, | ||
114 | + alignment: Alignment.center, | ||
115 | + width: double.infinity, | ||
116 | + child: const Text( | ||
117 | + "发布临境,让更多人身临其境", | ||
118 | + style: TextStyle(fontSize: 12.0), | ||
119 | + ), | ||
120 | + ), | ||
121 | + Container( | ||
122 | + height: 48.0, | ||
123 | + alignment: Alignment.center, | ||
124 | + width: double.infinity, | ||
125 | + child: TextButton( | ||
126 | + style: ButtonStyle( | ||
127 | + side: MaterialStateProperty.all( | ||
128 | + const BorderSide(color: Colors.black54, width: 1), | ||
129 | + ), | ||
130 | + ), | ||
131 | + onPressed: () { | ||
132 | + Toast.show("先不发布了吧。。。。"); | ||
133 | + }, | ||
134 | + child: const Text( | ||
135 | + "发布", | ||
136 | + style: TextStyle(color: Colors.black54, fontSize: 15.0), | ||
137 | + ), | ||
138 | + ), | ||
139 | + ), | ||
140 | + ], | ||
141 | + ), | ||
142 | + ), | ||
143 | + ], | ||
144 | + ), | ||
145 | + ); | ||
146 | + } | ||
147 | +} |
... | @@ -4,12 +4,16 @@ import 'package:flutter/cupertino.dart'; | ... | @@ -4,12 +4,16 @@ import 'package:flutter/cupertino.dart'; |
4 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
5 | import 'package:one_poem/poem/widgets/poem_content.dart'; | 5 | import 'package:one_poem/poem/widgets/poem_content.dart'; |
6 | import 'package:one_poem/recorder/widgets/poem_voice_widget.dart'; | 6 | import 'package:one_poem/recorder/widgets/poem_voice_widget.dart'; |
7 | +import 'package:one_poem/routers/fluro_navigator.dart'; | ||
8 | +import 'package:one_poem/util/toast_utils.dart'; | ||
7 | import 'package:one_poem/widgets/bars/home_action_bar.dart'; | 9 | import 'package:one_poem/widgets/bars/home_action_bar.dart'; |
8 | import 'package:one_poem/widgets/bars/home_menu_bar.dart'; | 10 | import 'package:one_poem/widgets/bars/home_menu_bar.dart'; |
9 | import 'package:one_poem/widgets/my_app_bar.dart'; | 11 | import 'package:one_poem/widgets/my_app_bar.dart'; |
10 | 12 | ||
11 | import 'package:one_poem/extension/int_extension.dart'; | 13 | import 'package:one_poem/extension/int_extension.dart'; |
12 | 14 | ||
15 | +import '../poem_router.dart'; | ||
16 | + | ||
13 | class PoemRecordAudioPage extends StatefulWidget { | 17 | class PoemRecordAudioPage extends StatefulWidget { |
14 | @override | 18 | @override |
15 | State<StatefulWidget> createState() => _PoemRecordAudioPageState(); | 19 | State<StatefulWidget> createState() => _PoemRecordAudioPageState(); |
... | @@ -114,7 +118,9 @@ class _PoemRecordAudioPageState extends State<PoemRecordAudioPage> { | ... | @@ -114,7 +118,9 @@ class _PoemRecordAudioPageState extends State<PoemRecordAudioPage> { |
114 | Icons.camera_alt_outlined, | 118 | Icons.camera_alt_outlined, |
115 | size: 28.px, | 119 | size: 28.px, |
116 | ), | 120 | ), |
117 | - onPressed: () {}, | 121 | + onPressed: () { |
122 | + Toast.show("不要着急吖,正在开发ing...."); | ||
123 | + }, | ||
118 | ), | 124 | ), |
119 | ), | 125 | ), |
120 | SizedBox( | 126 | SizedBox( |
... | @@ -129,6 +135,30 @@ class _PoemRecordAudioPageState extends State<PoemRecordAudioPage> { | ... | @@ -129,6 +135,30 @@ class _PoemRecordAudioPageState extends State<PoemRecordAudioPage> { |
129 | ), | 135 | ), |
130 | ], | 136 | ], |
131 | ), | 137 | ), |
138 | + Container( | ||
139 | + padding: const EdgeInsets.all(10.0), | ||
140 | + alignment: Alignment.centerRight, | ||
141 | + height: 54.0, | ||
142 | + width: double.infinity, | ||
143 | + child: TextButton( | ||
144 | + style: ButtonStyle( | ||
145 | + side: MaterialStateProperty.all( | ||
146 | + const BorderSide( | ||
147 | + color: Colors.black54, width: 1), | ||
148 | + ), | ||
149 | + ), | ||
150 | + onPressed: () { | ||
151 | + NavigatorUtils.push( | ||
152 | + context, | ||
153 | + '${PoemRouter.poemPublish}?data=100', | ||
154 | + ); | ||
155 | + }, | ||
156 | + child: const Text( | ||
157 | + "下一步", | ||
158 | + style: TextStyle(color: Colors.white), | ||
159 | + ), | ||
160 | + ), | ||
161 | + ), | ||
132 | ], | 162 | ], |
133 | ), | 163 | ), |
134 | ), | 164 | ), | ... | ... |
... | @@ -3,6 +3,7 @@ import 'package:one_poem/poem/page/poem_record_audio.dart'; | ... | @@ -3,6 +3,7 @@ import 'package:one_poem/poem/page/poem_record_audio.dart'; |
3 | import 'package:one_poem/routers/i_router.dart'; | 3 | import 'package:one_poem/routers/i_router.dart'; |
4 | import 'page/poem_detail.dart'; | 4 | import 'page/poem_detail.dart'; |
5 | import 'page/poem_page.dart'; | 5 | import 'page/poem_page.dart'; |
6 | +import 'page/poem_publish.dart'; | ||
6 | import 'page/poem_video_player.dart'; | 7 | import 'page/poem_video_player.dart'; |
7 | 8 | ||
8 | class PoemRouter implements IRouterProvider { | 9 | class PoemRouter implements IRouterProvider { |
... | @@ -10,31 +11,59 @@ class PoemRouter implements IRouterProvider { | ... | @@ -10,31 +11,59 @@ class PoemRouter implements IRouterProvider { |
10 | static String poemDetailPage = '/detail'; | 11 | static String poemDetailPage = '/detail'; |
11 | static String poemRecordAudioPage = '/poem/record/audio'; | 12 | static String poemRecordAudioPage = '/poem/record/audio'; |
12 | static String poemVidePlayer = '/poem/video/player'; | 13 | static String poemVidePlayer = '/poem/video/player'; |
14 | + static String poemPublish = '/poem/publish'; | ||
13 | 15 | ||
14 | @override | 16 | @override |
15 | void initRouter(FluroRouter router) { | 17 | void initRouter(FluroRouter router) { |
16 | - router.define(poemPage, | 18 | + router.define( |
17 | - handler: Handler(handlerFunc: (_, __) => const PoemPage())); | 19 | + poemPage, |
18 | - router.define(poemDetailPage, | 20 | + handler: Handler( |
19 | - handler: Handler(handlerFunc: (_, Map<String, List<String>> params) { | 21 | + handlerFunc: (_, __) => const PoemPage(), |
20 | - String? id = params['id']?.first; | 22 | + ), |
21 | - return PoemDetailPage( | 23 | + ); |
22 | - poemId: int.parse(id!), | 24 | + router.define( |
23 | - ); | 25 | + poemDetailPage, |
24 | - })); | 26 | + handler: Handler( |
25 | - router.define(poemRecordAudioPage, | 27 | + handlerFunc: (_, Map<String, List<String>> params) { |
26 | - handler: Handler(handlerFunc: (_, Map<String, List<String>> params) { | 28 | + String? id = params['id']?.first; |
27 | - String? id = params['id']?.first; | 29 | + return PoemDetailPage( |
28 | - return PoemRecordAudioPage( | 30 | + poemId: int.parse(id!), |
29 | - poemId: int.parse(id!), | 31 | + ); |
30 | - ); | 32 | + }, |
31 | - })); | 33 | + ), |
32 | - router.define(poemVidePlayer, | 34 | + ); |
33 | - handler: Handler(handlerFunc: (_, Map<String, List<String>> params) { | 35 | + router.define( |
34 | - String? url = params['url']?.first; | 36 | + poemRecordAudioPage, |
35 | - return PoemVideoPlayer( | 37 | + handler: Handler( |
36 | - url: url!, | 38 | + handlerFunc: (_, Map<String, List<String>> params) { |
37 | - ); | 39 | + String? id = params['id']?.first; |
38 | - })); | 40 | + return PoemRecordAudioPage( |
41 | + poemId: int.parse(id!), | ||
42 | + ); | ||
43 | + }, | ||
44 | + ), | ||
45 | + ); | ||
46 | + router.define( | ||
47 | + poemVidePlayer, | ||
48 | + handler: Handler( | ||
49 | + handlerFunc: (_, Map<String, List<String>> params) { | ||
50 | + String? url = params['url']?.first; | ||
51 | + return PoemVideoPlayer( | ||
52 | + url: url!, | ||
53 | + ); | ||
54 | + }, | ||
55 | + ), | ||
56 | + ); | ||
57 | + router.define( | ||
58 | + poemPublish, | ||
59 | + handler: Handler( | ||
60 | + handlerFunc: (_, Map<String, List<String>> params) { | ||
61 | + String? data = params['data']?.first; | ||
62 | + return PoemPublish( | ||
63 | + data: data!, | ||
64 | + ); | ||
65 | + }, | ||
66 | + ), | ||
67 | + ); | ||
39 | } | 68 | } |
40 | } | 69 | } | ... | ... |
-
Please register or login to post a comment