Flutter-WebViewScaffold后面的抽屉菜单

时间:2019-05-21 23:16:57

标签: dart flutter

我有stateLessWidget类,我想在这里:

1)加载带有URL的网页(效果很好) 2)使用“抽屉菜单”(效果很好)

问题:我的抽屉菜单位于视图的后面:(。

也许是因为WebviewScaffold稍后加载了抽屉菜单?

谢谢你们!

我的主页无状态窗口小部件

Widget build(BuildContext context) {

    return Scaffold(

        appBar: AppBar(
          title: Text(
              'Benvenuto',
              style: TextStyle(color: Colors.white)
          ),
          backgroundColor: Color(0xFF4035b1),
        ),

        drawer: Drawer(
          child: new Column(
            children: <Widget>[
              new UserAccountsDrawerHeader(
                  accountName: Text('TEST.IT', style: TextStyle(color:Color(0xFFFFFFFF))),
                  decoration: BoxDecoration(
                      gradient: LinearGradient(
                          colors: [
                            Color(0xFF584CD1),
                            Color(0xFF0fd1c0)
                          ],
                          begin: FractionalOffset(0.4, 0.2),
                          end: FractionalOffset(1.0, 0.6),
                          stops: [0.0, 0.9],
                          tileMode: TileMode.clamp
                      )
                  ),
                  accountEmail: Text("TEST TEXT", style: TextStyle(color:Color(0xFFFFFFFF))),
                  currentAccountPicture: new CircleAvatar(
                    radius: 50.0,
                    backgroundColor: const Color(0xFF778899),
                    backgroundImage: NetworkImage("https://domain.it/images/user.jpg"),
                  )
              ),
              new Column(children: drawerOptions)
            ],
          ),
        ),

        body: WebviewScaffold(
          url: "https://domain.it/api/api_booking",
          withJavascript: true,
          headers: {'Authorization': 'Bearer ' + tokenAccess},
          /*appBar: new AppBar(
                title: Text("Test page"),
              ),*/
          withZoom: true,
          withLocalStorage: true,
          hidden: true,
        )
    );
    // return
  }

enter image description here

1 个答案:

答案 0 :(得分:0)

Scaffold替换为WebviewScaffold并从身体中移除WebviewScaffold,您正在做的是嵌套脚手架。