我想将自定义 webview 添加到 flutter 中的 sizedBox 中...我尝试这样做,但出现错误:
code:
@override
Widget build(BuildContext context) {
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
return new Scaffold(
key: _scaffoldKey,
floatingActionButton: new Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new GestureDetector(
child: new Image.network("http://modernworfare.altervista.org/pause.png", width: 80.0,),
onTap: (){stop(); _showSnackBar();},
),
new GestureDetector(
child: new Image.network("http://modernworfare.altervista.org/bg.png",width: 80.0,),
onTap: (){play(); _showSnackBar2();},
),
],
),
backgroundColor: Colors.black,
body: new ListView(
children: <Widget>[
new Column(
children: <Widget>[
new Image.network("https://scontent-mxp1-1.xx.fbcdn.net/v/t1.0-9/16864236_1836092593321492_1828236030296093399_n.jpg?_nc_cat=0&oh=817190c0ef6ac6e3076582905997f3e9&oe=5B81BFF9"),
new Divider(),
new Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
new Container(
padding: new EdgeInsets.all(8.0),
child: new Text(" WEBSITE ", style: new TextStyle(color: Colors.white,)),
decoration: new BoxDecoration(
borderRadius: new BorderRadius.circular(10.0),
border: new Border.all(
width: 4.0,
color: Colors.white,
),
),
),
new Container(
padding: new EdgeInsets.all(8.0),
child: new Text(" SOCIAL ", style: new TextStyle(color: Colors.white,)),
decoration: new BoxDecoration(
borderRadius: new BorderRadius.circular(10.0),
border: new Border.all(
width: 4.0,
color: Colors.white,
),
),
),
new Container(
padding: new EdgeInsets.all(8.0),
child: new Text(" SHOP ", style: new TextStyle(color: Colors.white,)),
decoration: new BoxDecoration(
borderRadius: new BorderRadius.circular(10.0),
border: new Border.all(
width: 4.0,
color: Colors.white,
),
),
),
new Container(
padding: new EdgeInsets.all(8.0),
child: new Text(" CONTACT ", style: new TextStyle(color: Colors.white,)),
decoration: new BoxDecoration(
borderRadius: new BorderRadius.circular(10.0),
border: new Border.all(
width: 4.0,
color: Colors.white,
),
),
)],
),
new Text("hi",style: new TextStyle(color: Colors.white), ),
new SizedBox(
height: 50.0,
width: 600.0,
child: webview.launch("url",
)
),
],
)],
),
);
}
error:
参数类型“Future”无法分配给参数类型“Widget”。
有什么建议或想法吗?
可以这样做吗?
也许添加一个未来的构建者或类似的东西?