Flutter 如何在ListView中添加DragableScrollableSheet
以上代码给出了一个错误Flutter 如何在ListView中添加DragableScrollableSheet,flutter,dart,flutter-layout,flutter-animation,Flutter,Dart,Flutter Layout,Flutter Animation,以上代码给出了一个错误 以下函数向RenderFractionallySizedOverflowBox的layout()函数提供了这些无效约束,该函数可能计算了所讨论的无效约束: 那么我们如何在ListView中使用DragableScrollableSheet呢 ListView仅用于RefreshIndicator,没有其他用途。因此,在您的情况下,是否有一个替代的AColumn比ListView更适合您?在将ListView替换为Column=>之后,我仍然会遇到相同的错误这些无效约束是
以下函数向RenderFractionallySizedOverflowBox的layout()函数提供了这些无效约束,该函数可能计算了所讨论的无效约束:
那么我们如何在ListView中使用DragableScrollableSheet呢
ListView仅用于RefreshIndicator,没有其他用途。因此,在您的情况下,是否有一个替代的A
Column
比ListView
更适合您?在将ListView替换为Column=>之后,我仍然会遇到相同的错误这些无效约束是由以下函数提供给renderfractionalysizedoverflowbox的layout()函数的,它可能计算了所讨论的无效约束://但我使用的是RefreshIndicator,因此对于一个列,我无法看到指示器将列上的mainAxisSize
设置为mainAxisSize.min
。
body: RefreshIndicator(
onRefresh: _onRefresh,
child: ListView(
children:[
Stack(
children: [
BuildMainProfile(
screenHeight: screenHeight,
screenWidth: screenWidth,
uid: widget.uid,
callBack: widget.callBack,
),
DraggableScrollableSheet(
builder: (BuildContext context, ScrollController scrollController) {
return Container(
color: Colors.blue[100],
child: ListView.builder(
controller: scrollController,
itemCount: 25,
itemBuilder: (BuildContext context, int index) {
return ListTile(title: Text('Item $index'));
},
),
);
},
)
],
),
] ),
),