Stuck inside Expansion Panel [Flutter]

Viewed 25
@override
  Widget build(BuildContext context) {
    final List<ExpansionPanel> items = [ ..... ];
    
    return Scaffold(
      body: SafeArea(
        child: SingleChildScrollView(
          child: ExpansionPanelList(
            elevation: 3.0,
            children: items,
           ),
        )
      )
    );

A very simple Expansion Panel But the issue here is with the content inside of of the Panel.

Scenario:
- I click [expand] a tile
- The content inside is displayed. The content is quite long so when I scroll down, the content covers the screen and I get stuck. I can neither collapse the panel nor come out of it

The code for content inside,

ListView.builder(
          shrinkWrap: true,
          itemCount: someData.length,
          itemBuilder: (context, index) => ListTile( .... ),
        ),

What Can I do to fix this? Image

1 Answers

Changing Scroll Physics of ListView to Never; physics: const NeverScrollableScrollPhysics(), Helped solve me the problem.

ListView.builder(
    shrinkWrap: true,
    physics: const NeverScrollableScrollPhysics(),
    itemCount: someData.length,
    itemBuilder: (context, index) => ListTile( .... ),
),
Related