Scaffold和BottomNavigationBar

摘自 《 Flutter快學快用24講》

Scaffold

const Scaffold({
  Key key,
  this.appBar, // 應用欄,顯示在頂部,包括其中的搜索框
  this.body, // 頁面的主題顯示內(nèi)容
  this.floatingActionButton, // 設置顯示在上層區(qū)域的按鈕,默認位置位于右下角
  this.floatingActionButtonLocation, // 設置floatingActionButton的位置
  this.floatingActionButtonAnimator, // floatingActionButton動畫
  this.persistentFooterButtons, // 在底部導航欄之上的一組操作按鈕
  this.drawer, // 左側(cè)導航欄
  this.endDrawer, // 右側(cè)導航欄
  this.bottomNavigationBar, // 底部導航欄
  this.bottomSheet, // 底部可隱藏導航欄
  this.backgroundColor, // 內(nèi)容區(qū)域顏色
  this.resizeToAvoidBottomPadding, // 是否重新布局來避免底部被覆蓋了,比如當鍵盤顯示的時候,重新布局避免被鍵盤蓋住內(nèi)容。默認值為 true。
  this.resizeToAvoidBottomInset, //鍵盤彈出時是否重新繪制,以避免輸入框被遮擋
  this.primary = true, // 是否計算手機頂部狀態(tài)欄的高度
  this.drawerDragStartBehavior = DragStartBehavior.start, // 拖動的處理
  this.extendBody = false, // 是否延伸body至底部
  this.extendBodyBehindAppBar = false, // 是否延伸body至頂部
  this.drawerScrimColor, // 抽屜遮罩層背景色
  this.drawerEdgeDragWidth, // 滑動拉出抽屜的生效距離
  this.drawerEnableOpenDragGesture = true, // 確定是否可以通過拖動手勢打開Scaffold.drawer, 默認情況下,拖動手勢處于啟用狀態(tài)
  this.endDrawerEnableOpenDragGesture = true, // 確定是否可以使用拖動手勢打開Scaffold.endDrawer,默認情況下,拖動手勢處于啟用狀態(tài)。
})

底部導航欄

BottomNavigationBar({
  Key key,
  @required this.items, // 數(shù)組,對應于BottomNavigationBarItem這個組件為菜單欄的每一項,其中包含四個屬性icon、title、activeIcon和backgroundColor
  this.onTap, // 點擊觸發(fā)邏輯,一般用來觸發(fā)頁面的跳轉(zhuǎn)更新
  this.currentIndex = 0, // 當前所在的 items 數(shù)組中的位置
  this.elevation = 8.0, // 設置陰影效果值
  BottomNavigationBarType type, // fixed(固定位置)和shifting(浮動效果)
  Color fixedColor, // 代表選中時候的顏色,不能和selectedItemColor一起使用
  this.backgroundColor, // 背景顏色
  this.iconSize = 24.0, // icon 大小
  Color selectedItemColor, // 代表選中的顏色,不能和selectedItemColor一起使用
  this.unselectedItemColor, // 未選中時顏色
  this.selectedIconTheme = const IconThemeData(), // 當前選中的BottomNavigationBarItem.icon中圖標的大小,不透明度和顏色
  this.unselectedIconTheme = const IconThemeData(), // 當前未選中的BottomNavigationBarItem.icon中圖標的大小,不透明度和顏色
  this.selectedFontSize = 14.0, // 選中的字體大小
  this.unselectedFontSize = 12.0, // 未選中字體大小
  this.selectedLabelStyle, // 選中字體樣式
  this.unselectedLabelStyle, // 未選中字體樣式
  this.showSelectedLabels = true, // 是否開啟選中的樣式
  bool showUnselectedLabels, // 是否開啟未選中的樣式
})

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容