Flutter Web launch URL and get Response

Viewed 159

Is there a way of launching the URL from the Flutter Web and get a response like when you are using the flutter_web_plugin.

My code:

_webViewController.onUrlChanged.listen((String url) async {
    if (url == cancelUrl) {
        await _submit(false);
        _webViewController.close();
        Navigator.of(context).pop();
    }

    if (url == successUrl) {
        await _submit(true);
        _webViewController.close();
        Navigator.of(context).pop();
    }
});

bool isWeb = UniversalPlatform.isWeb;

return isWeb
    ? MaterialApp(
        title: 'Make payment',
        home: WebviewScaffold(
          url: url,
          initialChild: LoadingWidget(),
          withJavascript: true,
        ))
    : WebviewScaffold(
        url: url,
        appBar: AppBar(
          elevation: 0,
          title: Text('Make payment'),
        ),
        initialChild: LoadingWidget(),
        withJavascript: true,
      );

But it fails, I think that is because flutter_web_plugin doesn't support Flutter Web.

0 Answers
Related