【发布时间】:2022-01-18 23:51:33
【问题描述】:
我在我的颤振应用程序中使用Infinite Scroll Pagination 插件。我还需要在我的页面中使用 SilverAppBar。这是我的代码:
return Scaffold(
body: DefaultTabController(
length: 2,
child: NestedScrollView(
headerSliverBuilder: (context, value) {
return [
SliverAppBar(
bottom: TabBar(
tabs: [
Tab(icon: Icon(Icons.call), text: "1"),
Tab(icon: Icon(Icons.message), text: "2"),
],
),
),
];
},
body: TabBarView(
children: [
const MyListWidget()
Text('2')
],
),
),
),
);
这是我的 MyListWidget:
Widget build(BuildContext context) {
return PagedSliverList<int, MyModel>(
pagingController: _сontroller,
builderDelegate: PagedChildBuilderDelegate<MyModel>(
itemBuilder: (context, item, index) {
return Text(item.Title);
},
),
);
}
但我有错误:
A RenderRepaintBoundary expected a child of type RenderBox but received a child of type RenderSliverList.
我也试过了:
body: SliverFillRemaining(
child: TabBarView(
children: [
const ProfileSelections(),
//Container(child: Text('1')),
Text('2')
],
),
)
但我有错误:
A RenderSliverFillRemainingWithScrollable expected a child of type RenderBox but received a child of type RenderSliverFillRemainingWithScrollable.
如何解决这些错误?任何建议 - 我将不胜感激
【问题讨论】:
-
你能分享一下你实际上想要得到什么吗?
标签: flutter dart flutter-layout infinite-scroll