progress indicator when web page loads

371 views
Skip to first unread message

Alex Kravets

unread,
Feb 8, 2020, 3:52:13 PM2/8/20
to flutt...@googlegroups.com
I am trying to implement progress indicator for reloading url using webview plugin. Here are parts of the code:

...
flutterWebviewPlugin.reloadUrl('file://${file.path}')
        .then((onValue) =>
          setState(() {
            _isLoading = false;
          })
 );
...

Widget build(BuildContext context){
   return new Scaffold(
      body: Container(
        child: _isLoading
        ? Center(
          child: CircularProgressIndicator(),
        )
        : WebviewScaffold(
            url: 'about:blank',
        ),
      ),

    );
  } 

Debugging starting with setState() propagates through setState() and calls build(), however new web page does not load. If I substitute  WebviewScaffold for Text() widget - I can see text loading. Why can't I see WebviewScaffold loaded?

Thanks,
Alex

Andy Greenshaw

unread,
Feb 9, 2020, 7:24:57 AM2/9/20
to flutt...@googlegroups.com, Alex Kravets
I would use webview_flutter
--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/CAL3pOKApZURxVJ5ekeWM%2BNPCBD3s%2BpTDKLf45E6q7tiKejfqvw%40mail.gmail.com.

Alex Kravets

unread,
Feb 9, 2020, 4:32:20 PM2/9/20
to Andy Greenshaw, flutt...@googlegroups.com
Do you think it's a problem with plugin and not my use of Flutter UI?

I would switch, but webView_flutter doesn't support combo box selection in a web page, where as webview plugin does. When I select with webview_flutter nothing happens, but in plugin everything works fine.

Andy Greenshaw

unread,
Feb 9, 2020, 5:06:44 PM2/9/20
to Alex Kravets, flutt...@googlegroups.com
Well, if you read the README it says not to use alongside other widgets. The Flutter teams webview_flutter can be used in the tree (and I do exactly what you want with it).

 

From: Alex Kravets <kravet...@gmail.com>
Sent: Sunday, February 9, 2020 9:32 pm
To: Andy Greenshaw
Cc: flutt...@googlegroups.com
Subject: Re: progress indicator when web page loads
 
Reply all
Reply to author
Forward
0 new messages