Flutter onClosing callback for showModalBottomSheet

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

    wrapper Container in WillPopScope widget

    showModalBottomSheet(
            context: context,
            builder: (BuildContext context) {
              return WillPopScope(
                onWillPop: () aysnc{
                  // listener dismiss
                  return true;
                }
                child : Container(
                  height: 260.0,
                  child: Text('I am text')
                ));
            },
          );
    

提交回复
热议问题