flutter --畫appBar返回鍵


 

   appBar: AppBar(

  backgroundColor: Color.fromRGBO(248,250,255,1),  //設置appBar背景色
elevation: 0, // 立視度為0
title: Text(
'記錄',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, ),
),
centerTitle: true, // 居中顯示
leading: Container( // 繪制返回鍵
margin: EdgeInsets.all(10), // 設置邊距
decoration: BoxDecoration(
boxShadow: <BoxShadow>[
BoxShadow(
offset: Offset(1, 2), // 陰影起始位置
blurRadius: 5, // 陰影面積
color: Colors.grey.withOpacity(.4), // 陰影透明度
)
],
color: Colors.white, // Container背景色
borderRadius: BorderRadius.all(
Radius.circular(100.0), // Container設置為圓形
),
),
child: IconButton(
icon: Icon(
Icons.arrow_back_ios,
size: 20,
),
onPressed: () {
Navigator.pop(context); // 關閉當前頁面
},
)
),
),


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM