我想在PHP URL中使用flutter变量的值。我可以做什么来传递变量的值。
我已经尝试传递值或者可以在web视图中说出一个id,但是它打印字符串而不是变量的值。
`
String url = "http://10.0.2.2/pre_beta_02/dummy.php?therapist_id=value";
class NextPage extends StatefulWidget{
//List list;
String value;
//NextPage({this.value});
NextPage({Key key,this.value}):super (key: key);
@override
_Nextpagestate createState() => new _Nextpagestate();
}
class _Nextpagestate extends State<NextPage>{
@override
Widget build(BuildContext context) {
return WebviewScaffold(
appBar: new AppBar(
title: new Text('${widget.value}'),
),
url: url,
);
}
}
`
我希望输出为“值= 5”但实际输出为“值”
这应该这样做:
return WebviewScaffold(
appBar: new AppBar(
title: new Text('${widget.value}'),
),
url: "http://10.0.2.2/pre_beta_02/dummy.php?therapist_id=${widget.value}",
);