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 20:49:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ff40c6a878c81bb438e5ffed51ebb4f252f3178a
ff40c6a8
1 parent
f36854eb
完善跳转发布成功页面
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
134 additions
and
5 deletions
lib/home/home_page.dart
lib/poem/page/poem_complete_page.dart
lib/poem/page/poem_publish.dart
lib/poem/poem_router.dart
lib/home/home_page.dart
View file @
ff40c6a
...
...
@@ -68,8 +68,11 @@ class _HomeState extends State<Home> with RestorationMixin {
children:
<
Widget
>[
InkWell
(
onTap:
()
{
_pageController
.
animateToPage
(
0
,
duration:
const
Duration
(
milliseconds:
100
),
curve:
Curves
.
easeOutSine
);
_pageController
.
animateToPage
(
0
,
duration:
const
Duration
(
milliseconds:
100
),
curve:
Curves
.
easeOutSine
,
);
},
child:
Container
(
alignment:
Alignment
.
center
,
...
...
@@ -86,8 +89,11 @@ class _HomeState extends State<Home> with RestorationMixin {
),
InkWell
(
onTap:
()
{
_pageController
.
animateToPage
(
1
,
duration:
const
Duration
(
milliseconds:
100
),
curve:
Curves
.
easeOutSine
);
_pageController
.
animateToPage
(
1
,
duration:
const
Duration
(
milliseconds:
100
),
curve:
Curves
.
easeOutSine
,
);
},
child:
Container
(
alignment:
Alignment
.
center
,
...
...
lib/poem/page/poem_complete_page.dart
0 → 100644
View file @
ff40c6a
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'
;
class
PoemCompletePage
extends
StatefulWidget
{
const
PoemCompletePage
({
Key
?
key
,
required
this
.
data
})
:
super
(
key:
key
);
final
String
data
;
@override
_PoemCompletePageState
createState
()
=>
_PoemCompletePageState
();
}
class
_PoemCompletePageState
extends
State
<
PoemCompletePage
>
{
@override
void
initState
()
{
super
.
initState
();
}
@override
void
dispose
()
{
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
_isExit
,
child:
Scaffold
(
appBar:
const
MyAppBar
(
isBack:
false
,
isTransparent:
true
,
),
body:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
<
Widget
>[
Gaps
.
vGap24
,
Container
(
width:
120
,
height:
120
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
),
image:
const
DecorationImage
(
image:
AssetImage
(
'assets/images/logo.png'
),
),
),
),
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:
()
{
NavigatorUtils
.
push
(
context
,
Routes
.
home
,
clearStack:
true
,
);
},
child:
Text
(
"完成"
,
style:
TextStyle
(
color:
Colors
.
black54
,
fontSize:
15
.
px
),
),
),
],
),
),
),
],
),
),
);
}
Future
<
bool
>
_isExit
()
async
{
NavigatorUtils
.
push
(
context
,
Routes
.
home
,
clearStack:
true
);
return
Future
.
value
(
false
);
}
}
lib/poem/page/poem_publish.dart
View file @
ff40c6a
...
...
@@ -7,6 +7,8 @@ import 'package:one_poem/widgets/my_app_bar.dart';
import
'package:one_poem/extension/int_extension.dart'
;
import
'../poem_router.dart'
;
class
PoemPublish
extends
StatefulWidget
{
const
PoemPublish
({
Key
?
key
,
required
this
.
data
})
:
super
(
key:
key
);
...
...
@@ -134,7 +136,7 @@ class _PoemPublishState extends State<PoemPublish> {
),
),
onPressed:
()
{
Toast
.
show
(
"先不发布了吧。。。。"
);
publishPoem
(
context
);
},
child:
Text
(
"发布"
,
...
...
@@ -152,6 +154,13 @@ class _PoemPublishState extends State<PoemPublish> {
);
}
void
publishPoem
(
BuildContext
context
)
{
NavigatorUtils
.
push
(
context
,
'
${PoemRouter.poemCompletePage}
?id=100'
,
);
}
Future
<
bool
>
_isExit
()
async
{
showDialog
(
context:
context
,
...
...
lib/poem/poem_router.dart
View file @
ff40c6a
import
'package:fluro/fluro.dart'
;
import
'package:one_poem/poem/page/poem_record_audio.dart'
;
import
'package:one_poem/routers/i_router.dart'
;
import
'page/poem_complete_page.dart'
;
import
'page/poem_detail.dart'
;
import
'page/poem_page.dart'
;
import
'page/poem_publish.dart'
;
...
...
@@ -14,6 +15,7 @@ class PoemRouter implements IRouterProvider {
static
String
poemRecordVideoPage
=
'/poem/record/video'
;
static
String
poemVideoPlayer
=
'/poem/video/player'
;
static
String
poemPublish
=
'/poem/publish'
;
static
String
poemCompletePage
=
'/poem/complete'
;
@override
void
initRouter
(
FluroRouter
router
)
{
...
...
@@ -81,5 +83,17 @@ class PoemRouter implements IRouterProvider {
},
),
);
router
.
define
(
poemCompletePage
,
handler:
Handler
(
handlerFunc:
(
_
,
Map
<
String
,
List
<
String
>>
params
)
{
String
?
data
=
params
[
'id'
]?.
first
;
return
PoemCompletePage
(
data:
data
!,
);
},
),
);
}
}
...
...
Please
register
or
login
to post a comment