How to show, edit or delete widget/property of widget in ListView.builder when a specific item widget is pressed on flutter?

364 views
Skip to first unread message

Yalamber Ingnam

unread,
Jan 11, 2022, 3:42:47 AM1/11/22
to Flutter Development (flutter-dev)
I have made a custom widget that fetches the data from the API and displays it using ListView.builder method in flutter. ListView.builder returns a widget, so I have made custom widget 'menuLoadedList' that is returned by ListView.builder to display the data from the API. Inside this custom 'menuLoadedList' widget there are many widget, to display number, to display item name and GestureDetector widget to detect user tap, onTap(). Activity looks like this: ListView.builder displaying data from the API

I have only designed this one list ListView design, which is used by listview.builder method to display all the data in the database.

On the custom widget implementation there is Text widget with comment this need to be updated. When the app is called upon with onTap method, how to update the Text widget of that particular Listview.builder item only out of many other.

My question is:- When I press the plus or minus button in any of the widget item within the custom widget, how can I update only the Text widget its property/value within that custom widget in the listview.builder ? How can I keep the track of the button of the list item in the listview.builder that I have pressed and update the text widget within that list item only?

Note:- When I press any one plus or minus button in the list every text value is updated. I cannot change any specific text widget within custom widget.

Stackoverflow Link: - https://stackoverflow.com/questions/70597495/how-to-show-edit-or-delete-widget-property-of-widget-in-listview-builder-when-a

Reply all
Reply to author
Forward
0 new messages