modal_bottom_sheet
modal_bottom_sheet copied to clipboard
How to know that a sheet has completely disappeared?
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.
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