AppBar 中的 Flutter 居中文本

马拉克

我只想将整个文本居中(当然它应该仍在 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)),
              )
            ])),
迪内什·纳加拉詹

包括mainAxisAlignmentMainAxisAlignment.centerRow小部件

示例代码:

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] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章