Flexible(
child: StreamBuilder(
stream: ref.snapshots(),
builder: (context,AsyncSnapshot<QuerySnapshot> snapshot){
if(snapshot.hasError){
return Center(
child: Text("Error: ${snapshot.error}"),
);
}
//here what widget should i add
return Scrollbar(
child: GridView.builder(
shrinkWrap: true,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 15,
crossAxisSpacing: 15,
childAspectRatio: 2/3,
),
i don’t know why the scrollable on homepage can’t work well start from the gridView i can’t touch on that section to perform the scroll action
2
Answers
When you put two scroll view inside each other that happened, you need to disable second scroll view ‘s physics, try change your code to this:
You have two scrollable widgets together, so they’re clashing. so set
physics: const NeverScrollableScrollPhysics
on yourGridView
.