Showing
2 changed files
with
34 additions
and
38 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,47 +12,39 @@ class PoemUserComments extends StatelessWidget { | ... | @@ -12,47 +12,39 @@ 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, | 27 | + width: double.infinity, |
| 32 | - child: Container( | 28 | + height: 200.0, |
| 33 | - padding: | 29 | + child:ListView.builder( |
| 34 | - const EdgeInsets.symmetric(vertical: 5.0, horizontal: 10.0), | 30 | + itemBuilder: (BuildContext context, int index) { |
| 35 | - width: double.infinity, | 31 | + return Wrap( |
| 36 | - child: ListView.builder( | 32 | + spacing: 5.0, |
| 37 | - itemBuilder: (BuildContext context, int index) { | 33 | + crossAxisAlignment: WrapCrossAlignment.center, |
| 38 | - return Wrap( | 34 | + children: const [ |
| 39 | - spacing: 5.0, | 35 | + Icon( |
| 40 | - crossAxisAlignment: WrapCrossAlignment.center, | 36 | + Icons.play_circle_outline, |
| 41 | - children: const [ | 37 | + size: 16.0, |
| 42 | - Icon( | 38 | + color: Colors.white, |
| 43 | - Icons.play_circle_outline, | 39 | + ), |
| 44 | - size: 16.0, | 40 | + Text( |
| 45 | - color: Colors.white, | 41 | + "普通话", |
| 46 | - ), | 42 | + style: TextStyle(color: Colors.white, fontSize: 16.0), |
| 47 | - Text( | 43 | + ) |
| 48 | - "普通话", | 44 | + ], |
| 49 | - style: TextStyle(color: Colors.white, fontSize: 16.0), | 45 | + ); |
| 50 | - ) | 46 | + }), |
| 51 | - ], | 47 | + ), |
| 52 | - ); | ||
| 53 | - }), | ||
| 54 | - ), | ||
| 55 | - ) | ||
| 56 | ], | 48 | ], |
| 57 | ), | 49 | ), |
| 58 | ); | 50 | ); | ... | ... |
-
Please register or login to post a comment