android - 可以在php url中使用flutter变量吗
问题描述
我想在 PHP URL 中使用颤振变量的值。我可以做些什么来传递变量的值。
我尝试过传递值,或者可以在 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,
);
}
}
`
我希望输出为“value = 5”,但实际输出为“value”
解决方案
这应该这样做:
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}",
);
推荐阅读
- jquery - 使用 jquery append 时单选按钮不起作用
- postgresql - 带有 docker 的 Jenkins 管道:以特定用户身份运行 docker(嵌入式 postgresql
- google-apps-script - 编辑谷歌文档表单提交?
- sas - SAS:暗淡和宏变量
- c# - 如何使用 Visual Studio 2017 从我的 CPanel 与 MySql 数据库建立连接
- excel - 如何根据包含该字符串的 excel 范围验证在输入框中输入的字符串?
- python - 混淆矩阵错误“分类指标无法处理多标签指标和多类目标的混合”
- python - python使用bs4搜索标签
- laravel - 等价于 $DB->Select("Raw expression here") 的数组
- excel - 如何合并重复数据并获得最大值