【发布时间】:2020-07-20 19:45:11
【问题描述】:
我在高层有滚动条,在树的下面有几个级别的子滚动条。当滚动孩子时,父母也滚动。只是滚动条在父级中显示和移动。这不会反过来发生。我尝试将孩子包裹在手势检测器中,但没有成功。顺便说一句,这是网络
这是父布局小部件(子是子渲染的地方):
Scrollbar(
controller: layoutScrollController,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if(title != null) Container(
height: 67,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color:Theme.of(context).brightness == Brightness.dark ? GatheredThemeColors.light[850] : Colors.white,
border: Border(
bottom: BorderSide(
color: Theme.of(context).brightness == Brightness.dark ? GatheredThemeColors.light[800] : GatheredThemeColors.light[200],
width: 1
)
)
),
padding: EdgeInsets.all(20),
child: Text(title,style: Theme.of(context).textTheme.headline1,),
),
Container(
padding: EdgeInsets.all(20),
constraints: BoxConstraints(minHeight: 200),
child: child,
),
],
),
),
);
}
在下图中,“报告”区域是导致父级滚动的子级。查找报告列表。报表列表是一个 ListView 小部件。
【问题讨论】:
-
你能提供一些代码吗?您是否已经与
SingleChildScrollView合作过? -
代码量会太多。如前所述,父母和孩子之间的分离是几个层次。让我看看我是否可以建立一个例子
-
你能给你的
reportsList一个shrinkWrap: true,看看会发生什么吗? -
已经有一个
标签: flutter flutter-web flutter-scrollbar