1.抽屜 drawer(左側(cè)) endDrawer(右側(cè))
通常在Scaffold中使用
UserAccountsDrawerHeader用于展示用戶賬戶信息
CircleAvatar圓形圖片控件
Widget _createDrawerView() {
return new Drawer(
child: new ListView(
children: <Widget>[
UserAccountsDrawerHeader(
accountName: Text("xxx"),
accountEmail: Text("xxx@163.com"),
currentAccountPicture: new CircleAvatar(
backgroundImage: AssetImage("images/bg.jpeg"),
)
),
ListTile(
leading: CircleAvatar(
child: Text("A")
),
title: Text("itemA"),
onTap: (){
Navigator.pop(context);
},
),
ListTile(
leading: CircleAvatar(
child: Icon(Icons.favorite)
),
title: Text("itemB"),
onTap: (){
Navigator.pop(context);
},
),
ListTile(
leading: new CircleAvatar(
backgroundImage: AssetImage("images/bg.jpeg"),
),
title: Text("itemC"),
onTap: (){
Navigator.pop(context);
},
),
],
),
);
}
2.懸浮按鈕
this.child,//按鈕顯示的內(nèi)容
this.tooltip,//長按時顯示的提示
this.foregroundColor,//前景色,影響到文字顏色
this.backgroundColor,//背景色
this.heroTag = const _DefaultHeroTag(),//hero效果使用的tag,系統(tǒng)默認會給所有FAB使用同一個tag,方便做動畫效果
this.elevation = 6.0,//未點擊時陰影值
this.highlightElevation = 12.0,//點擊下陰影值
this.onPressed//點擊事件
this.mini = false,//FloatingActionButton有regular, mini, extended三種類型,默認為false即regular類型,true時按鈕變小即mini類型,extended需要通過FloatingActionButton.extended()創(chuàng)建,可以定制顯示內(nèi)容
this.shape = const CircleBorder(),//定義FAB的shape,設(shè)置shape時,默認的elevation將會失效,默認為CircleBorder
this.clipBehavior = Clip.none,
this.materialTapTargetSize,
this.isExtended = false,//是否為”extended”類型
3.AlertDialog
showDialog(context: mContext,builder: (mContext) =>AlertDialog(title: Text("xxxxxx"),));