How to put loading bar with Flutter Webview Plugin?

Asked

Viewed 478 times

0

I implemented a browser using Flutter Webview Plugin (https://pub.dartlang.org/packages/flutter_webview_plugin), in the example below:

class _VisualizadorDeUrl extends StatelessWidget {
  final items;
  final flutterWebviewPlugin = new FlutterWebviewPlugin();

  _VisualizadorDeUrl(this.items);
  @override
  Widget build(BuildContext context){
    return WebviewScaffold(
      appBar: AppBar(
        centerTitle: true,
        backgroundColor: Colors.green,
        title: Text('Navegador'),
      ),
      hidden: true,
      url: items["link"],
      withZoom: false,
      withLocalStorage: true,
      scrollBar: true,
    );
  }
}

String items contain the addresses I want to open. It’s working normal. The problem is that it does not show a Circularbarprogess when the link opens. The page is empty until the site is loaded.

I tried to use the:

initialChild: Container(
        color: Colors.redAccent,
        child: const Center(
         child: new CircularProgressIndicator ();
        ),
      ),

However, this does not simply change NOTHING in the application, so I removed it to make it cleaner.

1 answer

0


It is possible to implement using callback onPageFinished present in version 0.3.5 onwards, along with Stack.

Follow the example implementation in that reply.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.