I need to create an app for school, where it is possible to select multiple elements that were downloaded from a webservice and are shown using 'ListView'. Right now I'm working with the ListView and can select one element, but I didnt manage to select more neither to save my selection yet. Do I have to work with 'WhenListView.AfterPicking' or ist there another way?
Here's a bunch of ways to do this:
You could also do this with Tableviewer:
Another way:
Another alternative: use a pair of glyphs (☐,) in an item's maintext for checked and unchecked. when an item is picked, toggle between the two. the toggling requires deleting and then adding the new item as no replace method exists for ListView. Using the method AddItemAtIndex keeps the items from jumping around. PS. though copilot may tell you that ListView.AddItemAtIndex is effectively a replace, it is not.
A useful side-effect of the toggling might be to insert or delete a tinydb entry with the detail text value, creating a collection of elements to use (for example) as arguments to a subsequent service call.
CheckBoxListView is just a renamed ListView.
Assumes ListView was originally constructed with boxes in mainText.