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
2022-01-01 21:36:51 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
20d218cab0d9bb5013cf688bcb4adf99a994b316
20d218ca
1 parent
a9c3ef0d
页面样式优化
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
159 additions
and
9 deletions
assets/images/poem/poem_background.png
lib/poem/page/poem_detail.dart
lib/poem/page/poem_record_audio.dart
lib/poem/page/poem_record_video.dart
lib/poem/poem_router.dart
lib/poem/widgets/poem_content.dart
lib/poem/widgets/poem_user_audio.dart
assets/images/poem/poem_background.png
View file @
20d218c
287 KB
|
W:
|
H:
888 KB
|
W:
|
H:
2-up
Swipe
Onion skin
lib/poem/page/poem_detail.dart
View file @
20d218c
...
...
@@ -6,10 +6,13 @@ import 'package:one_poem/poem/widgets/poem_content.dart';
import
'package:one_poem/poem/widgets/poem_user_audio.dart'
;
import
'package:one_poem/poem/widgets/poem_user_comments.dart'
;
import
'package:one_poem/res/gaps.dart'
;
import
'package:one_poem/routers/fluro_navigator.dart'
;
import
'package:one_poem/widgets/bars/home_action_bar.dart'
;
import
'package:one_poem/widgets/bars/home_menu_bar.dart'
;
import
'package:one_poem/widgets/my_app_bar.dart'
;
import
'../poem_router.dart'
;
enum
PoemContentSwitch
{
audio
,
comment
,
...
...
@@ -49,6 +52,9 @@ class _PoemDetailPageState extends State<PoemDetailPage> {
contentSwitch
=
PoemContentSwitch
.
comment
;
setState
(()
{});
},
funcRight:
(){
NavigatorUtils
.
push
(
context
,
'
${PoemRouter.poemRecordAudioPage}
?id=100'
);
},
),
homeActionWidgets:
HomeActionWidgets
(
funcStar:
()
{
...
...
lib/poem/page/poem_record_audio.dart
0 → 100644
View file @
20d218c
import
'dart:ui'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:one_poem/poem/widgets/poem_content.dart'
;
import
'package:one_poem/res/resources.dart'
;
import
'package:one_poem/widgets/bars/home_action_bar.dart'
;
import
'package:one_poem/widgets/bars/home_menu_bar.dart'
;
import
'package:one_poem/widgets/my_app_bar.dart'
;
class
PoemRecordAudioPage
extends
StatefulWidget
{
@override
State
<
StatefulWidget
>
createState
()
=>
_PoemRecordAudioPageState
();
const
PoemRecordAudioPage
({
Key
?
key
,
required
this
.
poemId
,
this
.
poemPanelHeight
=
0
,
})
:
super
(
key:
key
);
final
int
poemPanelHeight
;
final
int
poemId
;
}
class
_PoemRecordAudioPageState
extends
State
<
PoemRecordAudioPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
const
poemStr
=
"qīng chén rù gǔ sì
\n
清晨入古寺,
\n
chū rì zhào gāo lín
\n
初日照高林。
\n
zhú jìng tōng yōu chù
\n
竹径通幽处,
\n
chán fáng huā mù shēn
\n
禅房花木深。
\n
shān guāng yuè niǎo xìng
\n
山光悦鸟性,
\n
tán yǐng kōng rén xīn
\n
潭影空人心。
\n
wàn lài cǐ dōu jì
\n
万籁此都寂,
\n
dàn yú zhōng qìng yīn
\n
但余钟磬音。"
;
return
Scaffold
(
appBar:
MyAppBar
(
isBack:
true
,
isTransparent:
false
,
homeMenuHeader:
HomeMenuHeader
(
funcLeft:
()
{
setState
(()
{});
},
funcCenter:
()
{
setState
(()
{});
},
funcRight:
()
{},
),
homeActionWidgets:
HomeActionWidgets
(
funcStar:
()
{
print
(
"starrrrrrr"
);
},
),
),
body:
Container
(
alignment:
Alignment
.
topCenter
,
decoration:
const
BoxDecoration
(
image:
DecorationImage
(
image:
AssetImage
(
"assets/images/poem/poem_background.png"
),
fit:
BoxFit
.
fill
,
),
),
child:
SafeArea
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
const
EdgeInsets
.
symmetric
(
vertical:
30.0
,
horizontal:
20.0
),
height:
MediaQuery
.
of
(
context
).
size
.
height
-
140
-
widget
.
poemPanelHeight
,
width:
double
.
infinity
,
decoration:
BoxDecoration
(
color:
Colors
.
grey
.
shade200
.
withOpacity
(
0.1
),
border:
Border
.
all
(
color:
Colors
.
grey
.
shade50
,
width:
0.5
),
// 边色与边宽度
),
child:
ClipRect
(
child:
BackdropFilter
(
filter:
ImageFilter
.
blur
(
sigmaX:
10.0
,
sigmaY:
10.0
,
),
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
grey
.
shade200
.
withOpacity
(
0.1
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
10.0
),
child:
Flex
(
direction:
Axis
.
vertical
,
children:
[
const
PoemContent
(
title:
"题破山寺后禅院"
,
author:
"常建"
,
poemStr:
poemStr
,
fontSize:
22.0
,
),
Stack
(
alignment:
Alignment
.
center
,
children:
[
Positioned
(
left:
10.0
,
child:
IconButton
(
icon:
const
Icon
(
Icons
.
camera_alt_outlined
,
size:
28.0
,
),
onPressed:
()
{},
),
),
SizedBox
(
width:
double
.
infinity
,
height:
90.0
,
child:
IconButton
(
icon:
const
Icon
(
Icons
.
mic_none
,
size:
70.0
,
color:
Colors
.
green
,
),
onPressed:
()
{},
),
),
],
),
],
),
),
),
),
),
),
],
),
),
),
);
}
}
lib/poem/page/poem_record_video.dart
0 → 100644
View file @
20d218c
File mode changed
lib/poem/poem_router.dart
View file @
20d218c
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_detail.dart'
;
import
'page/poem_page.dart'
;
class
PoemRouter
implements
IRouterProvider
{
static
String
poemPage
=
'/poem'
;
static
String
poemDetailPage
=
'/detail'
;
static
String
poemRecordAudioPage
=
'/poem_record_audio'
;
@override
void
initRouter
(
FluroRouter
router
)
{
...
...
@@ -19,5 +20,12 @@ class PoemRouter implements IRouterProvider {
poemId:
int
.
parse
(
id
!),
);
}));
router
.
define
(
poemRecordAudioPage
,
handler:
Handler
(
handlerFunc:
(
_
,
Map
<
String
,
List
<
String
>>
params
)
{
String
?
id
=
params
[
'id'
]?.
first
;
return
PoemRecordAudioPage
(
poemId:
int
.
parse
(
id
!),
);
}));
}
}
...
...
lib/poem/widgets/poem_content.dart
View file @
20d218c
...
...
@@ -8,11 +8,13 @@ class PoemContent extends StatelessWidget {
required
this
.
poemStr
,
required
this
.
title
,
required
this
.
author
,
this
.
fontSize
=
24
,
})
:
super
(
key:
key
);
final
String
poemStr
;
final
String
title
;
final
String
author
;
final
double
fontSize
;
@override
Widget
build
(
BuildContext
context
)
{
return
Column
(
...
...
@@ -25,7 +27,7 @@ class PoemContent extends StatelessWidget {
color:
Colors
.
black54
,
),
),
Gaps
.
vGap1
6
,
Gaps
.
vGap1
0
,
Text
(
author
,
style:
const
TextStyle
(
...
...
@@ -33,7 +35,7 @@ class PoemContent extends StatelessWidget {
color:
Colors
.
black54
,
),
),
Gaps
.
vGap
12
,
Gaps
.
vGap
5
,
Stack
(
alignment:
Alignment
.
center
,
children:
[
...
...
@@ -51,15 +53,15 @@ class PoemContent extends StatelessWidget {
// ),
Text
(
poemStr
,
style:
const
TextStyle
(
style:
TextStyle
(
color:
Colors
.
black54
,
fontFamily:
"ZCOOLXiaoWei"
,
fontSize:
24.0
,
fontSize:
fontSize
,
),
),
],
),
Gaps
.
vGap
24
,
Gaps
.
vGap
10
,
],
);
}
...
...
lib/poem/widgets/poem_user_audio.dart
View file @
20d218c
...
...
@@ -20,7 +20,7 @@ class PoemUserAudio extends StatelessWidget {
ListTile
(
title:
Text
(
desc
??
"一大波用户朗读录制提交了“临境”"
,
style:
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
15.0
),
style:
const
TextStyle
(
color:
Colors
.
black54
,
fontSize:
15.0
),
),
),
SizedBox
(
...
...
@@ -35,11 +35,11 @@ class PoemUserAudio extends StatelessWidget {
Icon
(
Icons
.
play_circle_outline
,
size:
16.0
,
color:
Colors
.
white
,
color:
Colors
.
black45
,
),
Text
(
"普通话"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
16.0
),
style:
TextStyle
(
color:
Colors
.
black45
,
fontSize:
16.0
),
)
],
);
...
...
Please
register
or
login
to post a comment