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_Flutter Sliver - Fatal编程技术网

Flutter 颤振嵌套滚动视图';不立即显示浮动滑动条吗?

Flutter 颤振嵌套滚动视图';不立即显示浮动滑动条吗?,flutter,flutter-sliver,Flutter,Flutter Sliver,我试图创建一个带有浮动滑动条的scrollview和NestedScrollView,并在CustomScrollView中添加内容,我需要将其分离,因为我还使用pull_to_刷新插件来处理api请求 但若我向上滚动显示浮动滑动应用条,它并不像我预期的那个样工作,它只是在用户停止滚动后才显示 有没有办法通过NestedScrollView实现这一点?或者其他小部件,我需要将其与CustomScrollView分开,因为如果我在CustomScrollView中使用浮动滑动条,我的加载指示器将与

我试图创建一个带有浮动滑动条的scrollview和NestedScrollView,并在CustomScrollView中添加内容,我需要将其分离,因为我还使用pull_to_刷新插件来处理api请求

但若我向上滚动显示浮动滑动应用条,它并不像我预期的那个样工作,它只是在用户停止滚动后才显示

有没有办法通过NestedScrollView实现这一点?或者其他小部件,我需要将其与CustomScrollView分开,因为如果我在CustomScrollView中使用浮动滑动条,我的加载指示器将与浮动滑动条重叠

这是我试过的代码

Scaffold(
        body: SafeArea(
          child: Scrollbar(
            child: NestedScrollView(
                    headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
                        // These are the slivers that show up in the "outer" scroll view.
                        return <Widget>[
                            SliverAppBar(
                                title: const Text('Books Nested'), // This is the title in the app b
                                forceElevated: innerBoxIsScrolled,
                                floating: true,
                                snap: true,
                            ),
                        ];
                    },
                    body: CustomScrollView(
                        slivers: <Widget>[
                            SliverList(
                                delegate: SliverChildBuilderDelegate(
                                        (BuildContext context, int index) {
                                        return Container(
                                            margin: EdgeInsets.all(10.0),
                                            color: Colors.grey,
                                            constraints: BoxConstraints(
                                                minWidth: 100.0,
                                                maxHeight: 160.0
                                            ),
                                        );
                                    },
                                    childCount: 30
                                ),
                            ),
                        ],
                    )
                ),
          )
        ),
    );
脚手架(
正文:安全区(
子:滚动条(
子:嵌套滚动视图(
headerSliverBuilder:(BuildContext上下文,boolInnerBoxIsCrolled){
//这些是“外部”滚动视图中显示的碎片。
返回[
滑杆(
标题:const Text('Books Nested'),//这是应用程序b中的标题
强制提升:内包装箱为羊角形,
浮动:是的,
是的,
),
];
},
正文:自定义滚动视图(
条子:[
银表(
代表:SliverChildBuilderDelegate(
(BuildContext上下文,int索引){
返回容器(
保证金:所有边缘套(10.0),
颜色:颜色。灰色,
约束:BoxConstraints(
最小宽度:100.0,
最大高度:160.0
),
);
},
儿童人数:30
),
),
],
)
),
)
),
);
结果是:NestedScrollView中的滑动应用条

我想得到这样的东西,这是我用CustomScrollView制作的,用来存储SliverAppBar和SliverList

自定义滚动视图中的滑动应用程序条

你找到解决方案了吗?还没有,萨尔迪