在我的顫振專案中,我使用了一個 floatingActionButton,我想添加一個填充,但我不知道如何用我的代碼制作樹。非常感謝任何幫助。
這是我的代碼:
floatingActionButton: Visibility(
visible: buttonshow,
child: FloatingActionButton(
onPressed: () {
scrollToTop();
},
shape: const StadiumBorder(
side: BorderSide(
color: Color(0xff135888), width: 2.5)),
backgroundColor: Colors.transparent,
elevation: 0.0,
child: const Icon(
Icons.keyboard_arrow_up, color: Color(0xff135888),
size: 28.0,),
mini: true,
),
),
uj5u.com熱心網友回復:
用擴展的小部件包裝您的可見性。
更新代碼:
floatingActionButton: Padding(
padding: const EdgeInsets.all(8.0),
child: Visibility(
visible: buttonshow,
child: FloatingActionButton(
onPressed: () {
scrollToTop();
},
shape: const StadiumBorder(
side: BorderSide(color: Color(0xff135888), width: 2.5)),
backgroundColor: Colors.transparent,
elevation: 0.0,
child: const Icon(
Icons.keyboard_arrow_up,
color: Color(0xff135888),
size: 28.0,
),
mini: true,
),
),
),
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/439366.html
上一篇:顫動||滾動回到頂部按鈕
