Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 如何更改';s中心停靠在自定义底部应用程序栏中?_Flutter_Dart - Fatal编程技术网

Flutter 如何更改';s中心停靠在自定义底部应用程序栏中?

Flutter 如何更改';s中心停靠在自定义底部应用程序栏中?,flutter,dart,Flutter,Dart,因此,我希望能够填充FAB周围的颜色,但我不确定如何填充。我完全按照这篇文章,所以这里有一个定制栏 我认为您可以将其包装在容器或其他占位符小部件中,并设置背景色。我不知道这是否确实有效。让我知道! 格里茨 编辑:刚刚检查了我的答案,如果您实现了以下(示例)代码: 它创建将其用作您的支架 Scaffold( floatingActionButton: FloatingActionButton(onPressed: null, child: Icon(Icons.add),), flo

因此,我希望能够填充
FAB
周围的颜色,但我不确定如何填充。我完全按照这篇文章,所以这里有一个定制栏


我认为您可以将其包装在容器或其他占位符小部件中,并设置背景色。我不知道这是否确实有效。让我知道! 格里茨

编辑:刚刚检查了我的答案,如果您实现了以下(示例)代码:


它创建

将其用作您的
支架

Scaffold(
   floatingActionButton: FloatingActionButton(onPressed: null, child: Icon(Icons.add),),
   floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
   backgroundColor: Colors.orange,
   bottomNavigationBar: Container(
     color: Colors.white,
     child: BottomAppBar(
       color: Colors.purple,
       child: Padding(
         padding: const EdgeInsets.symmetric(horizontal: 56, vertical: 12),
         child: Row(
           mainAxisAlignment: MainAxisAlignment.spaceBetween,
           children: <Widget>[
             Icon(Icons.home, color: Colors.white,),
             Icon(Icons.perm_contact_calendar, color: Colors.white,),
           ],
         ),
       ),
       shape: CircularNotchedRectangle(),
     ),
   ),
 );
脚手架(
floatingActionButton:floatingActionButton(按下时为空,子项为图标(Icons.add)),
floatingActionButtonLocation:floatingActionButtonLocation.centerDocked,
背景颜色:Colors.orange,
底部导航栏:容器(
颜色:颜色,白色,
子项:BottomAppBar(
颜色:颜色,紫色,
孩子:填充(
填充:常量边集。对称(水平:56,垂直:12),
孩子:排(
mainAxisAlignment:mainAxisAlignment.spaceBetween,
儿童:[
图标(Icons.home,颜色:Colors.white,),
图标(Icons.perm\u contact\u日历,颜色:Colors.white,),
],
),
),
形状:CircularNotchedRectangle(),
),
),
);
输出:


试着在
Scaffold
中设置
backgroundColor
。一点尝试和错误就会给出你的答案。我认为底部的应用程序条或者两者都应该做这个把戏为什么不呢?它可以包装,并有样式选项。。。脚手架也是你说的一个选项,但是你的整个页面都是红色的…目前计算机无法触及,当我在的时候,我会发布我的结果,看看我添加的图片和代码。太好了,我这边+1!
Scaffold(
   floatingActionButton: FloatingActionButton(onPressed: null, child: Icon(Icons.add),),
   floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
   backgroundColor: Colors.orange,
   bottomNavigationBar: Container(
     color: Colors.white,
     child: BottomAppBar(
       color: Colors.purple,
       child: Padding(
         padding: const EdgeInsets.symmetric(horizontal: 56, vertical: 12),
         child: Row(
           mainAxisAlignment: MainAxisAlignment.spaceBetween,
           children: <Widget>[
             Icon(Icons.home, color: Colors.white,),
             Icon(Icons.perm_contact_calendar, color: Colors.white,),
           ],
         ),
       ),
       shape: CircularNotchedRectangle(),
     ),
   ),
 );