Closed wangjunjx8868 closed 1 year ago
Please, read documentation https://pub.dev/documentation/popover/latest/popover/showPopover.html
Could you please describe more? i didn't find any way to close the pop over progrmaticallty
The popover behaves just like a Flutter Dialog
. So you can use Navigator.of(context).pop();
to close it:
showPopover(
context: context,
bodyBuilder: (context) {
return ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text('Close'),
);
},
);
just in case someone still needs this :)
Sounds good. How can I tell if the popover is visible or not? I can't just blindly call Navigator.of(context.pop();
.
You would typically call Navigator.of(context).pop()
from within the popover, so you know it's open.
Is your feature request related to a problem? Please describe. How to manually turn it off Describe the solution you'd like click a button hide popover .