[英]how to pass data from login page to another url in flutter?
我想將登錄數據(ID)從登錄頁面傳遞到 flutter 中的另一個 url(不是同一項目中的其他 class)
示例:我想打開“http://mylink.com/test”(示例 url),但我也想從“http://mylink.com/login”(示例 url)傳遞 ID
我嘗試使用:
final _dataID = {"loginid" : "$id"};
final url = Uri.encodeFull('http://mylink.com/test/$_dataID');
html.open.window(url,"test");
但它不起作用,如何實現? 謝謝
Kevin Malix這取決於您的端點如何獲取此 ID 值:
嘗試這個:
//final _dataID = {"loginid" : "$id"};
final url = Uri.encodeFull('http://mylink.com/test?loginid=$id');
html.open.window(url,"test");
嘗試這個。
import 'dart:js' as js;
.
.
.
js.context.callMethod("open", ["http://mylink.com/test/$_dataID"]);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.