poem_content.dart
1.71 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
62
63
64
65
66
67
68
69
70
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:Parlando/res/resources.dart';
import 'package:Parlando/extension/int_extension.dart';
class PoemContent extends StatelessWidget {
const PoemContent({
Key? key,
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(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
title,
style: TextStyle(
fontSize: 24.px,
color: Colors.black54,
),
),
Gaps.vGap10,
Text(
author,
style: TextStyle(
fontSize: 18.px,
color: Colors.black54,
),
),
Gaps.vGap5,
Stack(
alignment: Alignment.center,
children: [
//TODO 字体是否描边?
// Text(
// poemStr,
// style: TextStyle(
// fontFamily: "ZCOOLXiaoWei",
// fontSize: 24.0,
// foreground: Paint()
// ..style = PaintingStyle.stroke
// ..strokeWidth = 1
// ..color = Colors.black,
// ),
// ),
Text(
poemStr,
style: TextStyle(
color: Colors.black54,
fontFamily: "ZCOOLXiaoWei",
fontSize: fontSize,
),
),
],
),
Gaps.vGap10,
],
);
}
}