Flutter onClosing callback for showModalBottomSheet

前端 未结 8 1249
梦如初夏
梦如初夏 2021-02-04 00:50

I have a showModalBottomSheet like the below, which I understand to inherit from BottomSheet (right?)

      showModalBottomSheet

        
8条回答
  •  青春惊慌失措
    2021-02-04 01:32

    This is tested and verified on 28-01-2021

    showBottomSheet(
      backgroundColor: Colors.black.withOpacity(0.5),
      context: context,
      builder: (context) {
        return Container(//your sheet code here);      
      },
    ).closed.whenComplete(() {
     //do whatever you want after closing the bottom sheet
    });
    

提交回复
热议问题