我有一个小部件,用于打印文本:
class NormalText extends StatelessWidget {
final String txt;
NormalText(this.txt) {}
@override
Widget build(BuildContext context) {
return Container(
child: Text(txt,
style: TextStyle(
color: Colors.grey,
fontSize: 20,
fontWeight: FontWeight.bold)));
}
}
但是,如果我像这样使用它:
NormalText('hello\tworld\t42')
这个缩进太小了。是否有办法增加缩进,占用更多的空间?
SizedBox
对我来说是一个非常简单的解决方案! - Carl Smith