[英]how appbar title calibrate to center in flutter
我有AppBar title
包裝與 Row 並希望在中心
appBar: AppBar(
title: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Lottie.asset(
'assets/lottie/coin.json',
width: 50,
),
const Text('1000'),
],
),
centerTitle: true,
actions: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 20.0),
child: GestureDetector(
onTap: () {
// _showConfirmationDialog(pageContext);
},
child: const Icon(
Icons.chat_bubble_outline,
size: 26.0,
),
)),
],
),
但似乎它不在中心
左側有額外的空間
如何將其校准到中心
嘗試將mainAxisSize
設置為MainAxisSize.min
,以便行的內容將占用所需的最小寬度:
title: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
而且我認為您不需要centerTitle: true
,請嘗試不使用它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.