老熟女激烈的高潮_日韩一级黄色录像_亚洲1区2区3区视频_精品少妇一区二区三区在线播放_国产欧美日产久久_午夜福利精品导航凹凸

重慶分公司,新征程啟航

為企業提供網站建設、域名注冊、服務器等服務

flutterBottomAppBar如何實現不規則底部導航欄

flutter Bottom AppBar如何實現不規則底部導航欄,很多新手對此不是很清楚,為了幫助大家解決這個難題,下面小編將為大家詳細講解,有這方面需求的人可以來學習下,希望你能有所收獲。

10年積累的網站制作、成都網站建設經驗,可以快速應對客戶對網站的新想法和需求。提供各種問題對應的解決方案。讓選擇我們的客戶得到更好、更有力的網絡服務。我雖然不認識你,你也不認識我。但先網站設計后付款的網站建設流程,更有朔州免費網站建設讓你可以放心的選擇與我們合作。

實現底部導航欄并點擊切換頁面可簡述為有三種方式

TabBar + TabBarView  BottomNavigationBar + BottomNavigationBarItem  自定義 BottomAppBar

在這里 使用 BottomAppBar 來實現

/** * 有狀態StatefulWidget * 繼承于 StatefulWidget,通過 State 的 build 方法去構建控件 */class BotomeMenumBarPage extends StatefulWidget { ////通過構造方法傳值 BotomeMenumBarPage(); //主要是負責創建state @override BotomeMenumBarPageState createState() => BotomeMenumBarPageState();}/** * 在 State 中,可以動態改變數據 * 在 setState 之后,改變的數據會觸發 Widget 重新構建刷新 */class BotomeMenumBarPageState extends State { BotomeMenumBarPageState(); @override void initState() {  ///初始化,這個函數在生命周期中只調用一次  super.initState(); } @override Widget build(BuildContext context) {  //構建頁面  return buildBottomTabScaffold(); } //當前顯示頁面的 int currentIndex = 0; //點擊導航項是要顯示的頁面 final pages = [  ChildItemView("首頁"),  ChildItemView("發現"),  ChildItemView("動態"),  ChildItemView("我的") ]; Widget buildBottomTabScaffold() {  return SizedBox(    height: 100,    child: Scaffold(     //對應的頁面     body: pages[currentIndex],     //appBar: AppBar(title: const Text('Bottom App Bar')),     //懸浮按鈕的位置     floatingActionButtonLocation:       FloatingActionButtonLocation.centerDocked,     //懸浮按鈕     floatingActionButton: FloatingActionButton(      child: const Icon(Icons.add),      onPressed: () {       print("add press ");      },     ),     //其他菜單欄     bottomNavigationBar: BottomAppBar(      //懸浮按鈕 與其他菜單欄的結合方式      shape: CircularNotchedRectangle(),      // FloatingActionButton和BottomAppBar 之間的差距      notchMargin: 6.0,      color: Colors.white,      child: Row(       mainAxisSize: MainAxisSize.max,       mainAxisAlignment: MainAxisAlignment.spaceAround,       children: [        buildBotomItem(currentIndex, 0, Icons.home, "首頁"),        buildBotomItem(currentIndex, 1, Icons.library_music, "發現"),        buildBotomItem(currentIndex, -1, null, "發現"),        buildBotomItem(currentIndex, 2, Icons.email, "消息"),        buildBotomItem(currentIndex, 3, Icons.person, "我的"),       ],      ),     ),    )); } // ignore: slash_for_doc_comments /**  * @param selectIndex 當前選中的頁面  * @param index 每個條目對應的角標  * @param iconData 每個條目對就的圖標  * @param title 每個條目對應的標題  */ buildBotomItem(int selectIndex, int index, IconData iconData, String title) {  //未選中狀態的樣式  TextStyle textStyle = TextStyle(fontSize: 12.0,color: Colors.grey);  MaterialColor iconColor = Colors.grey;  double iconSize=20;  EdgeInsetsGeometry padding = EdgeInsets.only(top: 8.0);  if(selectIndex==index){   //選中狀態的文字樣式   textStyle = TextStyle(fontSize: 13.0,color: Colors.blue);   //選中狀態的按鈕樣式   iconColor = Colors.blue;   iconSize=25;   padding = EdgeInsets.only(top: 6.0);  }  Widget padItem = SizedBox();  if (iconData != null) {   padItem = Padding(    padding: padding,    child: Container(     color: Colors.white,     child: Center(      child: Column(       children: [        Icon(         iconData,         color: iconColor,         size: iconSize,        ),        Text(         title,         style: textStyle,        )       ],      ),     ),    ),   );  }  Widget item = Expanded(   flex: 1,   child: new GestureDetector(    onTap: () {     if (index != currentIndex) {      setState(() {       currentIndex = index;      });     }    },    child: SizedBox(     height: 52,     child: padItem,    ),   ),  );  return item; }}

//子頁面class ChildItemView extends StatefulWidget { String _title; ChildItemView(this._title); @override _ChildItemViewState createState() => _ChildItemViewState();}class _ChildItemViewState extends State { @override Widget build(BuildContext context) {  return Container(   child: Center(child: Text(widget._title)),  ); }}

看完上述內容是否對您有幫助呢?如果還想對相關知識有進一步的了解或閱讀更多相關文章,請關注創新互聯行業資訊頻道,感謝您對創新互聯的支持。


文章題目:flutterBottomAppBar如何實現不規則底部導航欄
新聞來源:http://www.xueling.net.cn/article/ihodhp.html

其他資訊

在線咨詢
服務熱線
服務熱線:028-86922220
TOP
主站蜘蛛池模板: 国产精品99久久久久久久 | 大黑人交xxxx| 91免费| 欧美大色视频在线观看 | 欧美韩一级片 | 美女张开腿露出尿口与奶头的照片 | 毛片在线网址 | 国产精品成人免费视频一区丝袜 | 中文人妻AV大区中文不卡 | 久久精品99久久香蕉国产色戒 | 欧美人与动牲交ZOOZ男人 | 日日噜噜夜夜狠狠久久av小说 | 青草伊人网 | 国产精品多P对白交换绿帽 久久久老司机 | 亚洲人成网站18禁止人 | 在线观看亚洲 | 不卡无在线一区二区三区 | 91porny九色白浆 | 日韩爱爱片 | 99精品不卡一区二区三区 | 18禁裸体动漫美女无遮挡网站 | 久久久a | 欧产日产国产精品三级 | 欧美丰满熟妇bbbbbb百度 | 极品美女销魂一区二区三区免费 | 天天躁夜夜躁狠狠久久 | 97超碰国产精品无码分类 | 国产精品不卡一区二区三区在线观看 | 青青网视频| 久久精品人 | 97爱视频| 高H紫黑色的又粗又上翘 | 中文字幕成人动漫 | 91看剧 | 国产51人人成人人人人爽色哟哟 | 浪浪视频色版 | 91九色磁力 | 国产韩日| xxx国产精品视频 | 性姿势108式大全 | 成人18夜夜网深夜福利网 |