How do you adjust the height and borderRadius of a BottomSheet in Flutter?

后端 未结 9 1357
野性不改
野性不改 2021-02-05 03:47

I\'m probably missing something obvious here, but my BottomSheet only takes up the bottom half the screen, even though the widgets in it take up more space. So now there is scro

9条回答
  •  面向向阳花
    2021-02-05 04:09

    here is the simplest code working in 2021

     showModalBottomSheet(
          context: context,
          isScrollControlled: true,  // <-- make bottom sheet resize to content height
          shape: RoundedRectangleBorder(  // <-- for border radius
            borderRadius: BorderRadius.only(
              topLeft: Radius.circular(15.0),
              topRight: Radius.circular(15.0),
            ),
          ),
          builder: (BuildContext context) {
           return Container() // <-- any widget you want
          });
    

提交回复
热议问题