Skip to content

WebviewScaffold with a drawer #46

@wolfkang

Description

@wolfkang

Hi,
Is there a way to use a WebviewScaffold with a drawer?

I revised WebviewScaffold like this.

class MyWebviewScaffold extends StatefulWidget {
  final PreferredSizeWidget appBar;
  final String url;
  final bool withJavascript;
  final bool clearCache;
  final bool clearCookies;
  final bool enableAppScheme;
  final String userAgent;
  final bool primary;
  final List<Widget> persistentFooterButtons;
  final Widget bottomNavigationBar;
  final bool withZoom;
  final Drawer drawer;

  MyWebviewScaffold(
      {Key key,
      this.appBar,
      @required this.url,
      this.withJavascript,
      this.clearCache,
      this.clearCookies,
      this.enableAppScheme,
      this.userAgent,
      this.primary: true,
      this.persistentFooterButtons,
      this.bottomNavigationBar,
      this.withZoom,
      this.drawer})
...
class _MyWebviewScaffoldState extends State<MyWebviewScaffold> {
...
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: widget.appBar,
      persistentFooterButtons: widget.persistentFooterButtons,
      bottomNavigationBar: widget.bottomNavigationBar,
      body: new Center(child: new CircularProgressIndicator()),
      drawer: widget.drawer,
    );
  }

When I tab a drawer button, the drawer appears behind the webview.
I set the elevation of the drawer as 10000, but it's not working.
I think this is related to the Rect class of the Dart UI package.
Is there another way to use a webview with a drawer?

2018-03-16 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions