I'm using the showBottomSheet method to display a bottom sheet in my Flutter app. However, when I wrap my content inside a DraggableScrollableSheet, it blocks interaction with the rest of the screen.
If I remove DraggableScrollableSheet and use a simple Container, background interaction works as expected. However, I need DraggableScrollableSheet because I rely on its snapSizes and snap animation functionality.
Is there a way to allow interaction with the rest of the screen while still using DraggableScrollableSheet inside showBottomSheet?
Any help or workaround would be greatly appreciated!
Example Code:
void _showBottomSheet(BuildContext context) {
showBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return DraggableScrollableSheet(
initialChildSize: 0.5,
minChildSize: 0.2,
maxChildSize: 1,
snap: true,
snapSizes: [0.2, 0.5, 1.0],
builder: (context, scrollController) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
),
child: ListView.builder(
controller: scrollController,
itemCount: 20,
itemBuilder: (context, index) {
return ListTile(title: Text("Item $index"));
},
),
);
},
);
},
);
}