modal_bottom_sheet icon indicating copy to clipboard operation
modal_bottom_sheet copied to clipboard

How to know that a sheet has completely disappeared?

Open xinlee333 opened this issue 3 years ago • 1 comments

1,Call the showMaterialModalBottomSheet(....) 2,Click on scrim to make the sheet disappear 3,If the showMaterialModalBottomSheet function is called with the await prefix,I can only be notified at the first frame when the sheet slide starts。How to know that a sheet has completely disappeared?

Please let me know if you know, thanks.

xinlee333 avatar Sep 14 '22 15:09 xinlee333

How about setting a custom animation duration and implementing Future.delayed?

const Duration animationDuration =  Duration(milliseconds: 300);
await showMaterialModalBottomSheet(
    context: context,
    duration: animationDuration,
    // the other parameters here...
);
await Future<void>.delayed(animationDuration);
// now the sheet has completely disappeared

xonaman avatar Nov 01 '22 21:11 xonaman