摘自 《 Flutter快學(xué)快用24講》
Scaffold
const Scaffold({
Key key,
this.appBar, // 應(yīng)用欄娘荡,顯示在頂部斋攀,包括其中的搜索框
this.body, // 頁面的主題顯示內(nèi)容
this.floatingActionButton, // 設(shè)置顯示在上層區(qū)域的按鈕劣挫,默認(rèn)位置位于右下角
this.floatingActionButtonLocation, // 設(shè)置floatingActionButton的位置
this.floatingActionButtonAnimator, // floatingActionButton動(dòng)畫
this.persistentFooterButtons, // 在底部導(dǎo)航欄之上的一組操作按鈕
this.drawer, // 左側(cè)導(dǎo)航欄
this.endDrawer, // 右側(cè)導(dǎo)航欄
this.bottomNavigationBar, // 底部導(dǎo)航欄
this.bottomSheet, // 底部可隱藏導(dǎo)航欄
this.backgroundColor, // 內(nèi)容區(qū)域顏色
this.resizeToAvoidBottomPadding, // 是否重新布局來避免底部被覆蓋了灾馒,比如當(dāng)鍵盤顯示的時(shí)候捻勉,重新布局避免被鍵盤蓋住內(nèi)容敞咧。默認(rèn)值為 true匹表。
this.resizeToAvoidBottomInset, //鍵盤彈出時(shí)是否重新繪制,以避免輸入框被遮擋
this.primary = true, // 是否計(jì)算手機(jī)頂部狀態(tài)欄的高度
this.drawerDragStartBehavior = DragStartBehavior.start, // 拖動(dòng)的處理
this.extendBody = false, // 是否延伸body至底部
this.extendBodyBehindAppBar = false, // 是否延伸body至頂部
this.drawerScrimColor, // 抽屜遮罩層背景色
this.drawerEdgeDragWidth, // 滑動(dòng)拉出抽屜的生效距離
this.drawerEnableOpenDragGesture = true, // 確定是否可以通過拖動(dòng)手勢打開Scaffold.drawer, 默認(rèn)情況下讶坯,拖動(dòng)手勢處于啟用狀態(tài)
this.endDrawerEnableOpenDragGesture = true, // 確定是否可以使用拖動(dòng)手勢打開Scaffold.endDrawer,默認(rèn)情況下岗屏,拖動(dòng)手勢處于啟用狀態(tài)辆琅。
})
底部導(dǎo)航欄
BottomNavigationBar({
Key key,
@required this.items, // 數(shù)組,對應(yīng)于BottomNavigationBarItem這個(gè)組件為菜單欄的每一項(xiàng)这刷,其中包含四個(gè)屬性icon婉烟、title、activeIcon和backgroundColor
this.onTap, // 點(diǎn)擊觸發(fā)邏輯暇屋,一般用來觸發(fā)頁面的跳轉(zhuǎn)更新
this.currentIndex = 0, // 當(dāng)前所在的 items 數(shù)組中的位置
this.elevation = 8.0, // 設(shè)置陰影效果值
BottomNavigationBarType type, // fixed(固定位置)和shifting(浮動(dòng)效果)
Color fixedColor, // 代表選中時(shí)候的顏色似袁,不能和selectedItemColor一起使用
this.backgroundColor, // 背景顏色
this.iconSize = 24.0, // icon 大小
Color selectedItemColor, // 代表選中的顏色,不能和selectedItemColor一起使用
this.unselectedItemColor, // 未選中時(shí)顏色
this.selectedIconTheme = const IconThemeData(), // 當(dāng)前選中的BottomNavigationBarItem.icon中圖標(biāo)的大小咐刨,不透明度和顏色
this.unselectedIconTheme = const IconThemeData(), // 當(dāng)前未選中的BottomNavigationBarItem.icon中圖標(biāo)的大小昙衅,不透明度和顏色
this.selectedFontSize = 14.0, // 選中的字體大小
this.unselectedFontSize = 12.0, // 未選中字體大小
this.selectedLabelStyle, // 選中字體樣式
this.unselectedLabelStyle, // 未選中字體樣式
this.showSelectedLabels = true, // 是否開啟選中的樣式
bool showUnselectedLabels, // 是否開啟未選中的樣式
})