Home > front end >  How could I open a WebPage inside my Flutter WebApp and parse the URI of this webpage?
How could I open a WebPage inside my Flutter WebApp and parse the URI of this webpage?

Time:10-13

Does someone know how to open a "WebView" inside a Flutter WebApp ? I need to parse the url of a webpage an return this result into mu Flutter Web App

below my code that open a new tab in the browser :

html.window.open('https://demo.vivapayments.com/web2?ref=$orderCode&lang=fr-BE',"_blank");

I'm Using VivaWallet Payment Solutions and I need to parse the URL after payment validation before sending the items in my database...

I need a solution for Friday night , please if someone has an idea ...

CodePudding user response:

You cannot put the functioning of browser inside widget, but you can render the html contents inside the widget using some external packages like. https://pub.dev/packages/fwfh_webview

just make GET request to some html page URL and get the html body of the request and pass the html content to this widget

HtmlWidget( [html string], )

CodePudding user response:

If you want to open webview you can use fwfh_webview package. But what you want to achieve is use the $orderCode response and parse it to VivaWallet API Url.

just change this

html.window.open('https://demo.vivapayments.com/web2?ref=$orderCode&lang=fr-BE',"_blank");

to

html.window.open('https://demo.vivapayments.com/web2?ref=$orderCode&lang=fr-BE',"new tab");

It will open you a new tab for vivapayment where you do your transaction. wait on app screen to finish transaction. then you should create a transaction table/collection whether with its status whether it is successfull or not because you should keep record of failure transaction too. Rest you can do on the transaction status basis.

  • Related