poem_user_comments.dart
1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:Parlando/res/resources.dart';
import 'package:Parlando/extension/int_extension.dart';
class PoemUserComments extends StatelessWidget {
const PoemUserComments({
Key? key,
required this.comments,
this.author = "佚名",
required this.datetime, //TODO 传入数据
}) : super(key: key);
final String comments;
final String author;
final String datetime;
@override
Widget build(BuildContext context) {
return Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(vertical: 5.px, horizontal: 10.px),
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Text(
"临境有感:",
style: TextStyle(
color: Colors.black54,
),
),
Gaps.vGap5,
Text(
comments,
style: const TextStyle(color: Colors.black45),
),
Gaps.vGap5,
Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
children: [
Icon(
Icons.self_improvement,
size: 15.px,
),
Text(
"言者:$author",
style: const TextStyle(color: Colors.black45, fontSize: 12.0),
),
],
),
Text(
datetime,
style: TextStyle(color: Colors.black45, fontSize: 12.px),
),
],
),
);
}
}