简体   繁体   English

如何将我选择的项目转发到 Flutter 中的另一个页面

[英]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.

相关问题 在 React 中,如何使用复选框创建一个灵活的选定项目数组,类似于在我的手机上选择图像? - In React, how can I create a flexible array of selected items, using checkboxes, similar to selecting images on my Phone? 如何将项目添加到可以在另一个页面上访问的javascript数组? - How to add items to javascript array that can be accessed on another page? 如何按价格和名称对商品进行排序? - How can I sort my items by both price and name? 我如何在 dropDownButton 中显示我的数组,flutter? - How i can display my array in dropDownButton , flutter? 如何在一个会话中存储多个选定的列表框项目并在其他表单上查看? - how to store multiple selected listbox items in a session and view on another form? 如何将选定的项目从一个数组复制到另一个? - How to copy selected items from one array to another? 我如何在另一个PHP页面中显示所有数组值 - How can I display all the array value in another php page 如何将我的 php 数组转换为另一种类型的数组 - how can i transform my php array to another type of array 如果另一个 h2 选择关闭当前一个,我如何一次显示一个 h2? - How I can show one h2 at a time, if another h2 selected close current one? 在选定的意见触发 onChange() 方法后,如何在页面上呈现特定的对象道具 - How can i render specific object prop on page after selected opinion fire onChange() method
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM