Reputation: 441
i just want to Center this entire Text (of course it should be still in AppBar). Thx
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)),
)
])),
Upvotes: 0
Views: 401
Reputation: 1243
Include mainAxisAlignment
to MainAxisAlignment.center
in Row
widget
Sample Code:
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)),
)
]))
Upvotes: 2
Reputation: 59
Use centerTitle : true
appBar: AppBar(
centerTitle: true,
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)),
)
])),
Upvotes: 1