onUrlChange method
FutureOr<NavigationDecision>
onUrlChange(
- dynamic request,
- dynamic callback(
- Map<
String, dynamic> , - BuildContext
- Map<
- dynamic context
Implementation
FutureOr<NavigationDecision> onUrlChange (request,
Function(Map<String, dynamic>, BuildContext)? callback, context)
async {
if (request.url.startsWith(KKiaPayRedirectURL)) {
//print('blocking navigation to $request}');
hideWebView ();
loadingStart ();
/**
* Payment Done with success
*/
final link = Uri.parse(request.url);
final transactionId = link.queryParameters['transaction_id'];
callback!( { 'requestData': data, 'transactionId': transactionId, 'status': 'SUCCESS' }, context);
/**
* dispose this view switch [disposeOnCallBack]
*/
//try{ Navigator.pop(context); } catch(e) {Utils.log.e(e);}
return NavigationDecision.prevent;
}
if (request.url.startsWith(WaveRedirectURI)
|| request.url.startsWith(WaveStoreRedirectURI)) {
Utils.launchWave(request.url);
return NavigationDecision.prevent;
}
return NavigationDecision.navigate;
}