showModalBottomSheet handler and dismissble

59 views Asked by At

isDismissible: true, //not work

showDragHandle:true, //is outside BottomSheet container

this two feature dont worked for this bottomsheet

void _showBottomSheet(BuildContext context) {
    showModalBottomSheet<void>(
    context: context,
    isScrollControlled: true,
    isDismissible: true,
    showDragHandle:true,
    backgroundColor: Colors.transparent,
    builder: (BuildContext context) {
      return DraggableScrollableSheet(
        initialChildSize: 0.5,
        maxChildSize: 0.7, // Set the maximum height to 70% of the screen height
        minChildSize: 0.2,
        expand: false,
        builder: (BuildContext context, ScrollController scrollController) {
          return Container(
            color: Colors.white, // Background color of the bottom sheet
            child: SingleChildScrollView(
              controller: scrollController,
              child: Column(
                children: [
                  // Your content here
                ],
              ),
            ),
          );
        },
      );
    },
  );
}
1

There are 1 answers

0
WaLeed Ahmad On

By Default the isDismissable: true check the documentation [https://api.flutter.dev/flutter/material/showModalBottomSheet.html] Also check how do you use this function