Is there any way to build a SliverList inside ExpansionTile? The reason I want to do this, I have a really large amount of data that needs to be put inside the expansion tile. Expansion tile needs List but SliverList should be inside CustomScrollView. If I use custom Scroll View inside Expansion tile's Children and put SliverList in it renders nothing. If I set Shrinkwrap true to CustomScrollView it renders Every Widget at a time. So, How can it be fixed?
Here is an example,
class Expamle extends StatelessWidget {
const Expamle({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return CustomScrollView(
slivers: [
....,
SliverList(
delegate: SliverChildBuilderDelegate(
(_, i) => ExpansionTile(
title: const Text('Title'),
children: [
// But it is Illegal here
SliverList(
delegate: SliverChildBuilderDelegate(
(_, i) => const Text('Child'),
childCount: 10,
),
),
// It does not render anything
CustomScrollView(
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(_, i) => const Text('Child'),
childCount: 10,
),
),
],
),
// It Works but render all widgets at a time
CustomScrollView(
shrinkWrap: true,
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(_, i) => const Text('Child'),
childCount: 10,
),
),
],
),
],
),
),
),
],
);
}
}