Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.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 可膨胀底杆溢流_Flutter_Dart - Fatal编程技术网

Flutter 可膨胀底杆溢流

Flutter 可膨胀底杆溢流,flutter,dart,Flutter,Dart,我正在我的应用程序中使用,正如您所看到的,它工作得非常完美,但它显示了底部溢出 我不明白:这个溢出是正常的,因为它是这个插件的目标-隐藏一个小部件并在你向上滚动时显示它- 我是否在使用过程中遗漏了什么 这是我的密码: Positioned( bottom: 0.0, left: 0.0, right: 0.0, child: BottomExpandableAppBar(

我正在我的应用程序中使用,正如您所看到的,它工作得非常完美,但它显示了底部溢出

我不明白:这个溢出是正常的,因为它是这个插件的目标-隐藏一个小部件并在你向上滚动时显示它-

我是否在使用过程中遗漏了什么

这是我的密码:

 Positioned(
            bottom: 0.0,
            left: 0.0,
            right: 0.0,
            child: BottomExpandableAppBar(
              // Provide the bar controller in build method or default controller as ancestor in a tree 
              controller: controller,
              appBarHeight: 00.0,
              expandedHeight: controller.dragLength,
              horizontalMargin: 0.0,
              bottomOffset: 50.0,
              //expandedBackColor: Colors.white,
              expandedDecoration: BoxDecoration(
                        color: Colors.white,
                        borderRadius: BorderRadius.only(
                          topLeft: Radius.circular(20),
                          topRight: Radius.circular(20),
                        ),
                        boxShadow: [
                          BoxShadow(
                              color: Colors.black12,
                              offset: Offset(5.0, 5.0),
                              blurRadius: 15.0,
                              spreadRadius: 15.0,
                            ),
                        ]
                      ),
              // Your bottom sheet code here
              expandedBody: GestureDetector(
                onVerticalDragUpdate: controller.onDrag,
                onVerticalDragEnd: controller.onDragEnd,
                child: Column(
                  children: <Widget>[
                    Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: <Widget>[
                        Padding(
                          padding: const EdgeInsets.only(top: 8.0),
                          child: Icon(
                            Feather.getIconData('minus'),
                            size: 30.0,
                            ),
                        )
                      ],
                    ),
                    Container(),// my content
                  ],
                ),
              ),
              shape: AutomaticNotchedShape(
                       RoundedRectangleBorder(),
                       StadiumBorder(
                           side: BorderSide()
                           )
                        ),
              // Your bottom app bar code here
            ),
定位(
底部:0.0,
左:0.0,
右:0.0,
子项:BottomExpandableAppBar(
//在生成方法中提供bar控制器,或在树中提供默认控制器作为祖先
控制器:控制器,
appBarHeight:00.0,
扩展高度:controller.dragLength,
水平边距:0.0,
底部偏移量:50.0,
//扩展背景色:Colors.white,
扩大装饰:盒子装饰(
颜色:颜色,白色,
borderRadius:仅限borderRadius(
左上:半径。圆形(20),
右上角:半径。圆形(20),
),
boxShadow:[
箱形阴影(
颜色:颜色。黑色,
偏移量:偏移量(5.0,5.0),
半径:15.0,
扩展半径:15.0,
),
]
),
//你的底片代码在这里
扩展体:手势检测器(
onVerticalDragUpdate:controller.onDrag,
onVerticalDragEnd:controller.onDragEnd,
子:列(
儿童:[
划船(
mainAxisAlignment:mainAxisAlignment.center,
儿童:[
填充物(
填充:仅限常量边集(顶部:8.0),
子:图标(
Feather.geticonda('减'),
尺寸:30.0,
),
)
],
),
容器(),//我的内容
],
),
),
形状:自动匹配形状(
RoundedRectangleBorder(),
StadiumBorder(
边:BorderSide()
)
),
//您的底部应用程序条形码在这里
),

此软件包旨在用作底部应用程序栏。 您必须按照以下步骤进行操作:

bottomNavigationBar: BottomExpandableAppBar(
        // Provide the bar controller in build method or default controller as ancestor in a tree 
        controller: bbc,
        expandedHeight: expandedHeight.value,
        horizontalMargin: 16,
        expandedBackColor: Theme.of(context).backgroundColor,
        // Your bottom sheet code here
        expandedBody: Center(
          child: Text("Hello world!"),
        ),
        // Your bottom app bar code here
        bottomAppBarBody: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Row(
            mainAxisSize: MainAxisSize.max,
            children: <Widget>[
              Expanded(
                child: Text(
                  "Hello",
                  textAlign: TextAlign.center,
                ),
              ),
              Spacer(
                flex: 2,
              ),
              Expanded(
                child: Text(
                  "World",
                  textAlign: TextAlign.center,
                ),
              ),
            ],
          ),
        ),
      )
bottomNavigationBar:BottomExpandableAppBar(
//在生成方法中提供bar控制器,或在树中提供默认控制器作为祖先
控制员:英国广播公司,
expandedHeight:expandedHeight.value,
水平边距:16,
expandedBackColor:Theme.of(context).backgroundColor,
//你的底片代码在这里
扩展体:中心(
孩子:文本(“你好,世界!”),
),
//您的底部应用程序条形码在这里
车身底部:衬垫(
填充:常数边集全部(8.0),
孩子:排(
mainAxisSize:mainAxisSize.max,
儿童:[
扩大(
子:文本(
“你好”,
textAlign:textAlign.center,
),
),
间隔棒(
弹性:2,
),
扩大(
子:文本(
“世界”,
textAlign:textAlign.center,
),
),
],
),
),
)

此软件包旨在用作底部应用程序栏。 您必须按照以下步骤进行操作:

bottomNavigationBar: BottomExpandableAppBar(
        // Provide the bar controller in build method or default controller as ancestor in a tree 
        controller: bbc,
        expandedHeight: expandedHeight.value,
        horizontalMargin: 16,
        expandedBackColor: Theme.of(context).backgroundColor,
        // Your bottom sheet code here
        expandedBody: Center(
          child: Text("Hello world!"),
        ),
        // Your bottom app bar code here
        bottomAppBarBody: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Row(
            mainAxisSize: MainAxisSize.max,
            children: <Widget>[
              Expanded(
                child: Text(
                  "Hello",
                  textAlign: TextAlign.center,
                ),
              ),
              Spacer(
                flex: 2,
              ),
              Expanded(
                child: Text(
                  "World",
                  textAlign: TextAlign.center,
                ),
              ),
            ],
          ),
        ),
      )
bottomNavigationBar:BottomExpandableAppBar(
//在生成方法中提供bar控制器,或在树中提供默认控制器作为祖先
控制员:英国广播公司,
expandedHeight:expandedHeight.value,
水平边距:16,
expandedBackColor:Theme.of(context).backgroundColor,
//你的底片代码在这里
扩展体:中心(
孩子:文本(“你好,世界!”),
),
//您的底部应用程序条形码在这里
车身底部:衬垫(
填充:常数边集全部(8.0),
孩子:排(
mainAxisSize:mainAxisSize.max,
儿童:[
扩大(
子:文本(
“你好”,
textAlign:textAlign.center,
),
),
间隔棒(
弹性:2,
),
扩大(
子:文本(
“世界”,
textAlign:textAlign.center,
),
),
],
),
),
)

我解决了将expandedBody小部件包装在高度为(expandedHeight+kToolbarHeight)的大小框中,然后包装在SingleChildScrollView中的问题,给出了物理:NeverScrollableScrollPhysics()

ps:kToolbarHeight是应用程序栏高度的常量

我希望这有助于其他人面对这个恼人的问题


编辑:使用kBottomNavigationBarHeight比使用kToolbarHeight更好,因为它更适合上下文,但两者具有相同的值。

我解决了将expandedBody小部件包装在高度为(expandedHeight+kToolbarHeight)的大小框中的问题然后将其包装在SingleChildScrollView中,给出物理:NeverScrollableScrollPhysics()

ps:kToolbarHeight是应用程序栏高度的常量

我希望这有助于其他人面对这个恼人的问题

编辑:使用kBottomNavigationBarHeight比使用kToolbarHeight更好,因为它更适合上下文,但两者都有