On tap I execute the following function which should make a bottom sheet appear in the usual fashion (scrolling up from the bottom):
showModalBottomSheet(
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
isScrollControlled: true,
isDismissible: true,
backgroundColor: Colors.white,
builder: (context) => ChooseTimeDialog(),
);
The bottom sheet that should appear should be scrollable. The code for it is as follows:
class ChooseTimeDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DraggableScrollableSheet(
initialChildSize: 0.4,
minChildSize: 0.2,
maxChildSize: 0.6,
builder: (context, scrollController) {
return SingleChildScrollView(
controller: scrollController,
child: Container(
color: Colors.blue,
height: 300,
width: 200,
),
);
},
);
}
}
This is the result that appears on tap:
Why does it cover the whole screen?
