简体   繁体   中英

Add widget from a page to another on button click in flutter

The title says it all. I need to click a button on a page, which will add a new widget to another page. Is it possible to make this in flutter? My app gets the data introduced by the user on a page, and using this data, when clicking on the "Save" button, I need to create a widget that will appear on another page.

I've found several solutions, but only for the cases when the button is on the same page where the widget needs to appear.

yes It is possible, to do that use APP level state, you can use Inherited Widget/provider/redux/riverpod/bloc etc for that. Your widgets using app level state will listen and update UI automatically according to state.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM