Showing
2 changed files
with
15 additions
and
19 deletions
... | @@ -80,14 +80,18 @@ class _PoemDetailPageState extends State<PoemDetailPage> { | ... | @@ -80,14 +80,18 @@ class _PoemDetailPageState extends State<PoemDetailPage> { |
80 | ), | 80 | ), |
81 | child: Padding( | 81 | child: Padding( |
82 | padding: const EdgeInsets.all(10.0), | 82 | padding: const EdgeInsets.all(10.0), |
83 | - child: Column( | 83 | + child: Flex( |
84 | + direction: Axis.vertical, | ||
84 | children: [ | 85 | children: [ |
85 | const PoemContent( | 86 | const PoemContent( |
86 | title: "题破山寺后禅院", | 87 | title: "题破山寺后禅院", |
87 | author: "常建", | 88 | author: "常建", |
88 | poemStr: poemStr, | 89 | poemStr: poemStr, |
89 | ), | 90 | ), |
90 | - const PoemUserComments(), | 91 | + const Expanded( |
92 | + flex: 1, | ||
93 | + child: PoemUserComments(), | ||
94 | + ), | ||
91 | Container( | 95 | Container( |
92 | width: double.infinity, | 96 | width: double.infinity, |
93 | alignment: Alignment.center, | 97 | alignment: Alignment.center, | ... | ... |
... | @@ -12,28 +12,21 @@ class PoemUserComments extends StatelessWidget { | ... | @@ -12,28 +12,21 @@ class PoemUserComments extends StatelessWidget { |
12 | final String? desc; | 12 | final String? desc; |
13 | @override | 13 | @override |
14 | Widget build(BuildContext context) { | 14 | Widget build(BuildContext context) { |
15 | - return SizedBox( | 15 | + return Container( |
16 | - height: 360, //TODO 高度待定 | 16 | + padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 10.0), |
17 | width: double.infinity, | 17 | width: double.infinity, |
18 | - child: Flex( | 18 | + child: Column( |
19 | - direction: Axis.vertical, | 19 | + children: <Widget>[ |
20 | - children: [ | 20 | + ListTile( |
21 | - Container( | 21 | + title: Text( |
22 | - alignment: Alignment.centerLeft, | ||
23 | - padding: | ||
24 | - const EdgeInsets.symmetric(vertical: 5.0, horizontal: 10.0), | ||
25 | - child: Text( | ||
26 | desc ?? "一大波用户朗读录制提交了“临境”", | 22 | desc ?? "一大波用户朗读录制提交了“临境”", |
27 | style: const TextStyle(color: Colors.white, fontSize: 15.0), | 23 | style: const TextStyle(color: Colors.white, fontSize: 15.0), |
28 | ), | 24 | ), |
29 | ), | 25 | ), |
30 | - Expanded( | 26 | + SizedBox( |
31 | - flex: 1, | ||
32 | - child: Container( | ||
33 | - padding: | ||
34 | - const EdgeInsets.symmetric(vertical: 5.0, horizontal: 10.0), | ||
35 | width: double.infinity, | 27 | width: double.infinity, |
36 | - child: ListView.builder( | 28 | + height: 200.0, |
29 | + child:ListView.builder( | ||
37 | itemBuilder: (BuildContext context, int index) { | 30 | itemBuilder: (BuildContext context, int index) { |
38 | return Wrap( | 31 | return Wrap( |
39 | spacing: 5.0, | 32 | spacing: 5.0, |
... | @@ -52,7 +45,6 @@ class PoemUserComments extends StatelessWidget { | ... | @@ -52,7 +45,6 @@ class PoemUserComments extends StatelessWidget { |
52 | ); | 45 | ); |
53 | }), | 46 | }), |
54 | ), | 47 | ), |
55 | - ) | ||
56 | ], | 48 | ], |
57 | ), | 49 | ), |
58 | ); | 50 | ); | ... | ... |
-
Please register or login to post a comment