我正在使用scrollable_positioned_list包,并让它渲染一个大的动态列表。它运作得很好。但是,我需要我的列表有一个滚动条(类似这样)。到目前为止,这是不可能的。
\n有谁知道该怎么做?
\n我的代码如下所示:
\nScrollbar(\n child: ScrollablePositionedList.builder(\n physics: const ClampingScrollPhysics(\n parent: AlwaysScrollableScrollPhysics(),\n ),\n itemCount: posts.length + 1,\n itemBuilder: (context, index) {\n if (index == 0) {\n return Container(\n height: 200,\n color: Colors.green,\n child: const Center(\n child: Text(\'post content\'),\n ),\n );\n } else if (posts[index - 1].isRoot) {\n return Container(\n padding: const EdgeInsets.symmetric(vertical: 15),\n margin: const EdgeInsets.symmetric(vertical: 5),\n color: Colors.redAccent,\n child: Text(\'ROOT COMMENT, index: ${index - 1}\'),\n );\n } else {\n return Container(\n padding: const …Run Code Online (Sandbox Code Playgroud) dart flutter flutter-layout flutter-listview flutter-scrollbar