I found a solution and it worked for me!
InAppWebView
In flutter to open the paytabs transaction page. When the transaction is successful, it redirects me to a return_url.
InAppWebView has a method
onLoadStart: (InAppWebViewController controller, String url)
In this method, I checked if the returl_url == url and redirected to my app and closed the InAppWebView accordingly.
onLoadStart: (InAppWebViewController controller, String url) {
setState(() {
_con.url = url;
});
if (url == "return_url") {
//close the webview
_con.webView.goBack();
//navigate to the desired screen with arguments
Navigator.of(context).pushReplacementNamed('/OrderSuccess',
arguments:
new RouteArgument(param: 'Credit Card (Paytabs)'));
}
},