I’m using a DraggableScrollableSheet
in my Flutter app, and I’m experiencing an issue where the screen dims after pulling down the bottom sheet to its minimum size. This issue started happening after I reset the minChildSize
to 0. The screen returns to normal after pressing the back button. Below is the relevant code snippet:
DraggableScrollableSheet(
initialChildSize: 1.0,
maxChildSize: 1,
minChildSize: 0.0, // Issue occurs after setting this to 0
snap: true,
expand: false,
snapSizes: const [0.77, 1],
controller: draggableScrollableController,
builder: (BuildContext context, ScrollController scrollController) {
return ClipRRect(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
),
child: Scaffold(...
Issue Description:
1.Pull down the DraggableScrollableSheet
to the minimum size.
2.The screen dims.
3.Press the back button, and the screen returns to normal.
What I Have Tried:
1.Setting minChildSize
to a small non-zero value (e.g., 0.1) mitigates the issue, but I’m looking for a solution that allows minChildSize
to be 0.
2.Handling the back button press explicitly.
this is a screen recode related to this issue:https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcWI2dDB4YWxuMmhmcGpvZzkyc29iM20wYzNwbGx1aHp3dm10ZDFmaSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/JVsS3Xt8OVsNkDUzE0/giphy.gif