颤振水平滚动条未显示



这是我的代码:

final _horizontalScrollController = ScrollController();
final _verticalScrollController = ScrollController();

Widget displayTable(bool isValid) {
return Column(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: double.infinity,
color: Colors.white,
child: Visibility(
visible: isLoading,
replacement: RefreshIndicator(
onRefresh: () {
setState(() {
isValid = true;
});
return callMyFunction();
},
child: Scrollbar(
controller: _verticalScrollController,
thumbVisibility: true,
trackVisibility: true,
child: Scrollbar(
controller: _horizontalScrollController,
thumbVisibility: true,
trackVisibility: true,
child: SingleChildScrollView(
controller: _verticalScrollController,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
controller: _horizontalScrollController,
child: DataTable(
columns: const [
// columns ...
],
rows: [
// Rows ...
],
),
),
),
),
),
),
child: Center(child: CircularProgressIndicator()),
),
),
),
)
],
);
}

水平轴工作,但滚动条现在显示!.
如何解决这个问题?

:(颤振信息)

Flutter 3.7.8 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 90c64ed42b (9 days ago) • 2023-03-21 11:27:08 -0500
Engine • revision 9aa7816315
Tools • Dart 2.19.5 • DevTools 2.20.1

使用下面的属性查看滚动条

SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(),
showHorizontalScrollIndicator: true,
),

相关内容

  • 没有找到相关文章

最新更新