Reputation: 103
I have ListView and the children that has pdf document wrap inside singleChildScrollView want to only scroll the singleChildScrollView and not the listView after expansion
Below is my code
Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(right: 15, top: 10),
width: size.width,
child: Text("Title should be Pinned",
textAlign: TextAlign.end,
),
),
SizedBox(
height: 20,
),
Theme(
data: ThemeData(
accentColor: Colors.black,
primaryColor: Colors.white24,
),
child: Expanded(
child: ListView.builder(
itemCount: data.length,
itemBuilder: (context, i) => ExpansionTile(
title: Center(
child: Text(
"After Expansion this should be pinned and only children should be scrollable"
),
),
children: [
Container(
child: SingleChildScrollView( //should be scrollable on expanded and not the title of ExpansionTile
child: SfPdfViewer.network(
'$url',
),
),
),
],
),
),
),
)
],
),
Upvotes: 0
Views: 2129
Reputation: 100
warp your widget in a container and give it a height use the following parameters inside the scroll widget
shrinkwrap: false, primary: true
Upvotes: 1
Reputation: 4750
physics: NeverScrollableScrollPhysics():
Add This Line to Your Widget then it will work
Upvotes: 0