我只想将整个文本居中(当然它应该仍在 AppBar 中)。谢谢
appBar: AppBar(
toolbarHeight: 80.0,
backgroundColor: Colors.amber,
title: Row(children: [
Text("Text",
style: GoogleFonts.josefinSans(
textStyle: const TextStyle(fontSize: 40.0))),
Text(
"The Game",
style: GoogleFonts.overpass(
textStyle: const TextStyle(fontSize: 20.0)),
)
])),
包括mainAxisAlignment
对MainAxisAlignment.center
在Row
小部件
示例代码:
AppBar(
toolbarHeight: 80.0,
backgroundColor: Colors.amber,
title: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Text("Text",
style: GoogleFonts.josefinSans(
textStyle: const TextStyle(fontSize: 40.0))),
Text(
"The Game",
style: GoogleFonts.overpass(
textStyle: const TextStyle(fontSize: 20.0)),
)
]))
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句