pop<T> function
A Dart function that pops the current route off the navigation stack and returns an optional result.
Parameters:
- context: the BuildContext associated with the current widget tree.
- result: an optional generic value representing the result to be returned to the previous route.
Returns: This function returns void, as it simply pops the current route off the navigation stack and returns an optional result.
Example usage: // Pops the current route off the navigation stack and returns a String result.
pop<String>(context, result: "Hello World!");
Implementation
void pop<T>(BuildContext context, {T? result}) => Navigator.of(context).pop<T>(result);