2023-12-12|閱讀時間 ‧ 約 1 分鐘

[Flutter]頁面切換

下一頁

沒傳資料

Navigator.push(context, MaterialPageRoute(builder: (context) => NewPage()));


有傳資料

Navigator.push(context, MaterialPageRoute(builder: (context) => NewPage(str:'123456')));


NewPage接收資料

//宣告參數
String str;

//接收傳遞參數
NewPage({Key key, this.str}) : super(key: key);


返回

Navigator.pop(context);





分享至
成為作者繼續創作的動力吧!
此專題是與APP程式設計相關的內容,包含:原生與跨平台。
從 Google News 追蹤更多 vocus 的最新精選內容從 Google News 追蹤更多 vocus 的最新精選內容

發表回應

成為會員 後即可發表留言