我把頭像影像放在appbar上,我給了它墨水池以獲得飛濺效果,但墨水池高度不能改變,我想將墨水池與影像匹配。或者,如果您有任何更好的方法來使用 splash 進行影像 ontap,但不要給我額外的包好嗎

代碼:
AppBar(
centerTitle: false,
elevation: 0,
toolbarHeight: 80,
backgroundColor: Colors.blue,
titleSpacing: 24,
title: Text(
'Hello, what\'s your name? ',
style: TextStyle(
fontSize: 22.sp,
),
),
actions: [
CircleAvatar(
radius: 30.0,
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(50),
onTap: () {},
),
),
backgroundImage: NetworkImage(
"https://images.unsplash.com/photo-1539571696357-5a69c17a67c6?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8N3x8cGVvcGxlfGVufDB8fDB8fA==&auto=format&fit=crop&w=500&q=60"),
backgroundColor: Colors.transparent,
),
SizedBox(width: 24),
],
);
uj5u.com熱心網友回復:
您必須使用中心小部件包裝您的操作,它應該可以正常作業。
AppBar(
centerTitle: false,
elevation: 0,
toolbarHeight: 80,
backgroundColor: Colors.blue,
titleSpacing: 24,
title: Text(
'Hello, what\'s your name? ',
style: TextStyle(
fontSize: 22.sp,
),
),
actions: [
Center(
child:CircleAvatar(
radius: 30.0,
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(50),
onTap: () {},
),
),
backgroundImage: NetworkImage(
"https://images.unsplash.com/photo-1539571696357-5a69c17a67c6?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8N3x8cGVvcGxlfGVufDB8fDB8fA==&auto=format&fit=crop&w=500&q=60"),
backgroundColor: Colors.transparent,
),),
SizedBox(width: 24),
],
);
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/459939.html
下一篇:應用欄上的InkWell高度飛濺
