[英]How can I forward my selected items to another page in Flutter
I have some datas and I can see in the homepage.我有一些数据,我可以在主页上看到。 I want to see also in the another page, how can i do this?我也想在另一个页面上看到,我该怎么做?
I have card for example, and It has some datas like fav_numbers, name, last_name etc. and I want to pass these informations to another page.例如,我有卡片,它有一些数据,如 fav_numbers、name、last_name 等,我想将这些信息传递到另一个页面。 Then, I can see these cards (only selected) in the another page.然后,我可以在另一个页面中看到这些卡片(仅选中)。 How can i do this?我怎样才能做到这一点?
I want to pass like this:我想这样通过:
ElevatedButton(
onPressed: () {
AutoRouter.of(context).push(
PeopleRoute(
name: games[index]["name"],
surname: games[index]["surname"],
luckyNumber: games[index]["luckyNumber"]),
);
},
child: Icon(CupertinoIcons.add),
),
and I can use these informations in people page like widget.name or widget.surname.我可以在人员页面中使用这些信息,例如 widget.name 或 widget.surname。 But I need to a list right?但我需要一份清单,对吗? Because I do not want to show just 1 card, I want to show when user click PLUS(+) button, then I want to show cards which are selected.因为我不想只显示一张卡片,所以我想在用户单击加号(+)按钮时显示,然后我想显示被选中的卡片。
If you show simply, I can continue with using other state management ways...如果你简单显示,我可以继续使用其他 state 管理方式...
Just I needed to create items in another widget, which I wanted.只是我需要在另一个小部件中创建我想要的项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.