Debug School

rakesh kumar
rakesh kumar

Posted on

HOW TO CHANGE THE BACKGROUND COLOR OF BOTTOMSHEET IN FLUTTER?-FLUTTER

Output Screenshot:

SOLUTION
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Colors.black54)

 GestureDetector(onTap: () => showModalBottomSheet(
                                backgroundColor: Colors.transparent,
                                context: context,
                                builder: (BuildContext contxt) => Theme(
                                      data: Theme.of(context).copyWith(
                                        canvasColor: Colors.transparent,
                                      ),
                                      child: Container(
                                        decoration: BoxDecoration(
                                            color: Colors.white,
                                            borderRadius: BorderRadius.only(
                                                topRight: Radius.circular(20),
                                                topLeft: Radius.circular(20))),
                                        height: 360,
                                        child: ChildWidgetOfBottomSheetYouWantToImplement.....
Enter fullscreen mode Exit fullscreen mode
 showModalBottomSheet(
    context: context,
    backgroundColor: Colors.transparent,
    builder: (BuildContext bc){
      return Container(
        height: 430,
        child: BottomSheetWidget(name, test, images),
      );
    }
);
Enter fullscreen mode Exit fullscreen mode

Full Summary:

Refrence
Click here

Top comments (0)