Toggle navigation
Toggle navigation
This project
Loading...
Sign in
OnePoem
/
OnePoem-App
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Reason Pun
2022-01-25 21:15:07 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
884b2639cf771c5154454a9ed6040bfe12350ea8
884b2639
1 parent
ff40c6a8
增加发布状态加载菊花
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
118 additions
and
102 deletions
lib/poem/page/poem_complete_page.dart
lib/poem/page/poem_publish.dart
lib/poem/page/poem_record_video.dart
lib/poem/page/poem_complete_page.dart
View file @
884b263
...
...
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import
'package:one_poem/res/resources.dart'
;
import
'package:one_poem/routers/fluro_navigator.dart'
;
import
'package:one_poem/routers/routers.dart'
;
import
'package:one_poem/util/toast_utils.dart'
;
import
'package:one_poem/widgets/my_app_bar.dart'
;
import
'package:one_poem/extension/int_extension.dart'
;
...
...
lib/poem/page/poem_publish.dart
View file @
884b263
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:one_poem/res/resources.dart'
;
import
'package:one_poem/routers/fluro_navigator.dart'
;
import
'package:one_poem/routers/routers.dart'
;
import
'package:one_poem/util/toast_utils.dart'
;
import
'package:one_poem/widgets/my_app_bar.dart'
;
import
'package:one_poem/extension/int_extension.dart'
;
...
...
@@ -18,6 +18,8 @@ class PoemPublish extends StatefulWidget {
}
class
_PoemPublishState
extends
State
<
PoemPublish
>
{
bool
isPublishing
=
false
;
@override
void
initState
()
{
super
.
initState
();
...
...
@@ -45,120 +47,136 @@ class _PoemPublishState extends State<PoemPublish> {
),
),
),
body:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
Padding
(
padding:
const
EdgeInsets
.
all
(
10.0
,
),
child:
ConstrainedBox
(
constraints:
const
BoxConstraints
(
maxHeight:
200
,
maxWidth:
double
.
infinity
,
),
child:
TextField
(
maxLines:
10
,
decoration:
InputDecoration
(
contentPadding:
const
EdgeInsets
.
all
(
10.0
),
hintText:
'读此一言,仿佛身临其境'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
5
),
borderSide:
BorderSide
.
none
),
filled:
true
,
fillColor:
Colors
.
grey
.
shade100
,
),
),
),
),
Container
(
padding:
EdgeInsets
.
all
(
10
.
px
),
alignment:
Alignment
.
centerLeft
,
width:
double
.
infinity
,
height:
36
.
px
,
child:
Wrap
(
children:
[
Icon
(
Icons
.
room_outlined
,
size:
15
.
px
,
),
Gaps
.
hGap5
,
const
Text
(
"我在此地"
,
style:
TextStyle
(
color:
Colors
.
black45
),
body:
Stack
(
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
Padding
(
padding:
const
EdgeInsets
.
all
(
10.0
,
),
],
),
),
Container
(
padding:
EdgeInsets
.
all
(
10
.
px
),
alignment:
Alignment
.
centerLeft
,
width:
double
.
infinity
,
height:
36
.
px
,
child:
Wrap
(
children:
[
Icon
(
Icons
.
record_voice_over_outlined
,
size:
15
.
px
,
child:
ConstrainedBox
(
constraints:
const
BoxConstraints
(
maxHeight:
200
,
maxWidth:
double
.
infinity
,
),
child:
TextField
(
maxLines:
10
,
decoration:
InputDecoration
(
contentPadding:
const
EdgeInsets
.
all
(
10.0
),
hintText:
'读此一言,仿佛身临其境'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
5
),
borderSide:
BorderSide
.
none
),
filled:
true
,
fillColor:
Colors
.
grey
.
shade100
,
),
),
),
Gaps
.
hGap5
,
const
Text
(
"所用口音"
,
style:
TextStyle
(
color:
Colors
.
black45
),
),
Container
(
padding:
EdgeInsets
.
all
(
10
.
px
),
alignment:
Alignment
.
centerLeft
,
width:
double
.
infinity
,
height:
36
.
px
,
child:
Wrap
(
children:
[
Icon
(
Icons
.
room_outlined
,
size:
15
.
px
,
),
Gaps
.
hGap5
,
const
Text
(
"我在此地"
,
style:
TextStyle
(
color:
Colors
.
black45
),
),
],
),
Gaps
.
hGap10
,
const
Text
(
"普通话"
,
style:
TextStyle
(
color:
Colors
.
black45
),
),
Container
(
padding:
EdgeInsets
.
all
(
10
.
px
),
alignment:
Alignment
.
centerLeft
,
width:
double
.
infinity
,
height:
36
.
px
,
child:
Wrap
(
children:
[
Icon
(
Icons
.
record_voice_over_outlined
,
size:
15
.
px
,
),
Gaps
.
hGap5
,
const
Text
(
"所用口音"
,
style:
TextStyle
(
color:
Colors
.
black45
),
),
Gaps
.
hGap10
,
const
Text
(
"普通话"
,
style:
TextStyle
(
color:
Colors
.
black45
),
),
],
),
],
),
),
const
Spacer
(),
Expanded
(
child:
Center
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
"发布临境,让更多人身临其境"
,
style:
TextStyle
(
fontSize:
14
.
px
),
),
Gaps
.
vGap10
,
TextButton
(
style:
ButtonStyle
(
side:
MaterialStateProperty
.
all
(
BorderSide
(
color:
Colors
.
black54
,
width:
1
.
px
,
),
const
Spacer
(),
Expanded
(
child:
Center
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
"发布临境,让更多人身临其境"
,
style:
TextStyle
(
fontSize:
14
.
px
),
),
Gaps
.
vGap10
,
TextButton
(
style:
ButtonStyle
(
side:
MaterialStateProperty
.
all
(
BorderSide
(
color:
Colors
.
black54
,
width:
1
.
px
,
),
),
),
onPressed:
()
{
publishPoem
(
context
);
},
child:
Text
(
"发布"
,
style:
TextStyle
(
color:
Colors
.
black54
,
fontSize:
15
.
px
),
),
),
),
onPressed:
()
{
publishPoem
(
context
);
},
child:
Text
(
"发布"
,
style:
TextStyle
(
color:
Colors
.
black54
,
fontSize:
15
.
px
),
),
],
),
]
,
)
,
),
)
,
]
,
),
isPublishing
?
const
Center
(
child:
CupertinoActivityIndicator
(
radius:
16.0
,
),
)
:
Container
(),
],
),
),
);
}
void
publishPoem
(
BuildContext
context
)
{
NavigatorUtils
.
push
(
context
,
'
${PoemRouter.poemCompletePage}
?id=100'
,
);
Future
<
void
>
publishPoem
(
BuildContext
context
)
async
{
isPublishing
=
true
;
setState
(()
{});
// TODO 等待套入正式接口发布临境
await
Future
.
delayed
(
const
Duration
(
seconds:
2
),
()
{
NavigatorUtils
.
push
(
context
,
'
${PoemRouter.poemCompletePage}
?id=100'
,
);
});
}
Future
<
bool
>
_isExit
()
async
{
...
...
lib/poem/page/poem_record_video.dart
View file @
884b263
...
...
@@ -47,7 +47,6 @@ class _PoemRecordVideoPageState extends State<PoemRecordVideoPage>
///记录当前的时间
int
currentTimer
=
0
;
int
duration
=
10
*
1000
;
//TODO 60 * 1000;
@override
...
...
Please
register
or
login
to post a comment