Flutter onClosing callback for showModalBottomSheet

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

    Old post but anyways, Might be helpful for you or others. So you can also achieve it by use of whenComplete function of showModalBottomSheet.

    Let's see below code

    showModalBottomSheet(
            context: context,
            builder: (BuildContext context) {
              return Container(
                height: 260.0,
                child: Text('I am text')
            );
          },
    ).whenComplete(() {
      print('Hey there, I\'m calling after hide bottomSheet');
    });
    

    That's it.

提交回复
热议问题