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 17:10:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a9c3ef0d26cf09127c521150604eef8563e230ca
a9c3ef0d
1 parent
6d5db287
页面样式优化
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
101 additions
and
33 deletions
lib/home/home_page.dart
lib/poem/page/poem_detail.dart
lib/poem/widgets/poem_content.dart
lib/poem/widgets/poem_user_audio.dart
lib/poem/widgets/poem_user_comments.dart
lib/home/home_page.dart
View file @
a9c3ef0
...
...
@@ -6,7 +6,6 @@ import 'package:one_poem/res/resources.dart';
import
'package:one_poem/timeline/pages/timelines_page.dart'
;
import
'package:one_poem/util/theme_utils.dart'
;
import
'package:one_poem/widgets/double_tap_back_exit_app.dart'
;
import
'package:one_poem/widgets/load_image.dart'
;
import
'package:provider/provider.dart'
;
import
'package:flutter_gen/gen_l10n/one_poem_localizations.dart'
;
import
'provider/home_provider.dart'
;
...
...
lib/poem/page/poem_detail.dart
View file @
a9c3ef0
...
...
@@ -3,12 +3,18 @@ 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/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/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'
;
enum
PoemContentSwitch
{
audio
,
comment
,
}
class
PoemDetailPage
extends
StatefulWidget
{
const
PoemDetailPage
({
Key
?
key
,
...
...
@@ -26,6 +32,7 @@ class PoemDetailPage extends StatefulWidget {
}
class
_PoemDetailPageState
extends
State
<
PoemDetailPage
>
{
PoemContentSwitch
contentSwitch
=
PoemContentSwitch
.
audio
;
@override
Widget
build
(
BuildContext
context
)
{
const
poemStr
=
"清晨入古寺,初日照高林。
\n
竹径通幽处,禅房花木深。
\n
山光悦鸟性,潭影空人心。
\n
万籁此都寂,但余钟磬音。"
;
...
...
@@ -35,7 +42,12 @@ class _PoemDetailPageState extends State<PoemDetailPage> {
isTransparent:
false
,
homeMenuHeader:
HomeMenuHeader
(
funcLeft:
()
{
print
(
"lefltlelfle poem id="
+
widget
.
poemId
.
toString
());
contentSwitch
=
PoemContentSwitch
.
audio
;
setState
(()
{});
},
funcCenter:
()
{
contentSwitch
=
PoemContentSwitch
.
comment
;
setState
(()
{});
},
),
homeActionWidgets:
HomeActionWidgets
(
...
...
@@ -88,9 +100,16 @@ class _PoemDetailPageState extends State<PoemDetailPage> {
author:
"常建"
,
poemStr:
poemStr
,
),
const
Expanded
(
Expanded
(
flex:
1
,
child:
PoemUserComments
(),
child:
contentSwitch
==
PoemContentSwitch
.
audio
?
const
PoemUserAudio
()
:
const
PoemUserComments
(
author:
"老魔取西经"
,
comments:
"那日早上,我到达百望山顶,看着山顶空空的楼阁,想象那也可以是一所禅房吧"
,
datetime:
"2021年12月23日 辰时三刻"
,
),
),
Container
(
width:
double
.
infinity
,
...
...
lib/poem/widgets/poem_content.dart
View file @
a9c3ef0
...
...
@@ -22,7 +22,7 @@ class PoemContent extends StatelessWidget {
title
,
style:
const
TextStyle
(
fontSize:
24.0
,
color:
Colors
.
white
,
color:
Colors
.
black54
,
),
),
Gaps
.
vGap16
,
...
...
@@ -30,7 +30,7 @@ class PoemContent extends StatelessWidget {
author
,
style:
const
TextStyle
(
fontSize:
18.0
,
color:
Colors
.
white
,
color:
Colors
.
black54
,
),
),
Gaps
.
vGap12
,
...
...
@@ -52,7 +52,7 @@ class PoemContent extends StatelessWidget {
Text
(
poemStr
,
style:
const
TextStyle
(
color:
Colors
.
white
,
color:
Colors
.
black54
,
fontFamily:
"ZCOOLXiaoWei"
,
fontSize:
24.0
,
),
...
...
lib/poem/widgets/poem_user_audio.dart
0 → 100644
View file @
a9c3ef0
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
class
PoemUserAudio
extends
StatelessWidget
{
const
PoemUserAudio
({
Key
?
key
,
this
.
audio
,
//TODO 传入数据
this
.
desc
,
})
:
super
(
key:
key
);
final
List
<
Map
<
String
,
String
>>?
audio
;
final
String
?
desc
;
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
5.0
,
horizontal:
10.0
),
width:
double
.
infinity
,
child:
Column
(
children:
<
Widget
>[
ListTile
(
title:
Text
(
desc
??
"一大波用户朗读录制提交了“临境”"
,
style:
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
15.0
),
),
),
SizedBox
(
width:
double
.
infinity
,
height:
200.0
,
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
Wrap
(
spacing:
5.0
,
crossAxisAlignment:
WrapCrossAlignment
.
center
,
children:
const
[
Icon
(
Icons
.
play_circle_outline
,
size:
16.0
,
color:
Colors
.
white
,
),
Text
(
"普通话"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
16.0
),
)
],
);
}),
),
],
),
);
}
}
lib/poem/widgets/poem_user_comments.dart
View file @
a9c3ef0
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:one_poem/res/resources.dart'
;
class
PoemUserComments
extends
StatelessWidget
{
const
PoemUserComments
({
Key
?
key
,
this
.
comments
,
//TODO 传入数据
this
.
desc
,
required
this
.
comments
,
this
.
author
=
"佚名"
,
required
this
.
datetime
,
//TODO 传入数据
})
:
super
(
key:
key
);
final
List
<
Map
<
String
,
String
>>?
comments
;
final
String
?
desc
;
final
String
comments
;
final
String
author
;
final
String
datetime
;
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
alignment:
Alignment
.
topLeft
,
padding:
const
EdgeInsets
.
symmetric
(
vertical:
5.0
,
horizontal:
10.0
),
width:
double
.
infinity
,
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
ListTile
(
title:
Text
(
desc
??
"一大波用户朗读录制提交了“临境”"
,
style:
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
15.0
)
,
const
Text
(
"临境有感:"
,
style:
TextStyle
(
color:
Colors
.
black54
,
),
),
SizedBox
(
width:
double
.
infinity
,
height:
200.0
,
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
Wrap
(
spacing:
5.0
,
Gaps
.
vGap5
,
Text
(
comments
,
style:
const
TextStyle
(
color:
Colors
.
black45
),),
Gaps
.
vGap5
,
Wrap
(
crossAxisAlignment:
WrapCrossAlignment
.
center
,
children:
const
[
Icon
(
Icons
.
play_circle_outline
,
size:
16.0
,
color:
Colors
.
white
,
children:
[
const
Icon
(
Icons
.
self_improvement
,
size:
15.0
,
),
Text
(
"普通话"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
16.0
),
)
Text
(
"言者:
$author
"
,
style:
const
TextStyle
(
color:
Colors
.
black45
,
fontSize:
12.0
),),
],
);
}),
),
Text
(
datetime
,
style:
const
TextStyle
(
color:
Colors
.
black45
,
fontSize:
12.0
),),
],
),
);
...
...
Please
register
or
login
to post a comment