Can anyone tell me if there is a difference between using Navigator.of(context).pop() vs Navigator.pop(context) when closing a modal (using showDialog or Alert from rflutter_alert) as both close the modal?
Thanks for reading!
Can anyone tell me if there is a difference between using Navigator.of(context).pop() vs Navigator.pop(context) when closing a modal (using showDialog or Alert from rflutter_alert) as both close the modal?
Thanks for reading!
From Source code
https://github.com/flutter/flutter/blob/2a8e7b7bf162e672141a73180214a9eb9033251d/packages/flutter/lib/src/widgets/navigator.dart#L1487
@optionalTypeArgs
static void pop<T extends Object>(BuildContext context, [ T result ]) {
Navigator.of(context).pop<T>(result);
}
Navigator.pop(context) call Navigator.of(context).pop()