flutter AppBar


 

return Scaffold(
  appBar:AppBar(
    title:Text('Abc'),
    leading:Icon(Icons.home),
    elevation:4.0,//最下方陰影部分輻射范圍
    actions:<widget>[],//如圖區域
    iconTheme: IconThemeData(//設置圖標樣式
      color:,
      opacity:0.1,
      size:10.2
    ),
    brightness: Brightness.light,//應用欄材質的亮度
    backgroundColor: Colors.blueAccent,//背景顏色
    titleSpacing: 0.0,// 橫軸上圍繞title內容的間距  0.0即占據所有有用空間
    primary:true,appbar是否顯示在任務欄頂部,true代表不被任務欄遮蓋
    centerTitle:true/false,//是否居中title
    flexibleSpace:Container(
      color:colors.red,
    ),
    automaticallyImplyLeading: true, //配合leading使用,取決於automaticallyImplyLeading == true && leading ==null ,此時會自動做出一些哈事情
    bottom://接收一個widget
    textTheme: TextTheme(),
    toolbarOpacity: 1,//appBar上部分透明度
    bottomOpacity: 1,
  )
)

 

設置flutter AppBar的高度

Scaffold(
  appBar:PreferredSize(
    child:AppBar()
  ),
  preferredSize:size.fromHeight(screenSixe.height * 0.07)
)

設置flutter  bottom的高度

bottom: PreferredSize(
  child: Container(
    height: 50,
    width: double.infinity,
    color: Colors.grey,
    child: Text('bottom'),
  ),
  preferredSize: Size(30, 100),
),

 


免責聲明!

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



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