Flutter onClosing callback for showModalBottomSheet

前端 未结 8 1170
梦如初夏
梦如初夏 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:38

    () async {
    
       // Save the bottomsheet in a variable
    
       var bottomSheet = showModalBottomSheet(
          context: context,
          builder: (context) => Container();
        );
    
       // Detect when it closes
       await bottomSheet.then((onValue) {
         print("value: $onValue");
       });
    
       // Do something here
    }
    

提交回复
热议问题