I have created a listview with tiles containing title and buy price and sell price (Text widgets).I build the list view from Rest API call and initially all the price values of every tile will be set to zero. then, I call SSE and receive live data for the price values.what I am trying to define is, only the price values(Title will remain static) of every tiles should be constantly updated. does the listview of the flutter support this kind of action ? I am new to flutter.can somebody help me by answering if it is possible ?
if so how to do it (a general idea).
Thanks in advance!
It depends on you, what are the components you want to change.
A simple approach is to update the list(not listview) by which you are populating the listtiles inside listview and then call the setState.
You can update the list by changing the cost of each item of your custom data type in the list or you can also change the complete list item (possibly this is not required in question).
Related
I'm working with ag-grid I have a table that looks like the one provided HERE. In my own project, I am using an external api that will receive a real item. I need to update the Received Quantity after the done. Unfortunately, the api doesn't return anything other an a status code. So I can't do something like remove the row and a new row and this particular endpoint is also throttled heavily so I can't just refetch the list over and over to update it (which probably isn't a good idea anyway).
My plan was to just take the current value in Received Quantity and increment the cell myself. I can't seem to get it right and I just out of ideas of how I can possibly do that (I know it's probably simple by brain is just fried).
I'd really appreciate it if anything who's done this can help me out.
I ended up figuring this one out after a couple days not thinking about it. So I'll answer my own question for anyone who needs to know in the future.
I was trying to "edit" the data when I really needed to "update" it.
Essentially, every row in your grid will have a RowNode. You can access this node from the params of the row . Every is RowNode is indexed and has a setDataValue function which you can use to update entire rows or single cells. Click the update link above to reach the relevant documentation.
I have been using the PaginatedDataTable widget in flutter and am looking to add a search bar to filter down the rows based on the input
However there is no clear way to do this; most tutorials only show sorting the columns.
When I modify the RowData object that's passed into the source input of the table nothing happens.
Does anyone have any tips on what I'm missing?
Many thanks in advance.
Perhaps you are missing a notifyListeners after changing the data source?
Call this method whenever the object changes, to notify any clients the object may have changed. Listeners that are added during this iteration will not be visited. Listeners that are removed during this iteration will not be visited after they are removed.
I've been trying ReorderableListView two create a list that you are able to drag and drop but also that contains items that you are also able to drag a drop. I know there is the package drag_and_drop_lists but don't recommend it to me. I want to manage to built something like this without the need of a third party package.
Also, it is dynamic and the issue that I am having is with the items inside the list, I just don't know which list is calling and only returns the item number that is going to replace but if I have 4 lists each one with x amount of items, how can I know which list is replacing ?
Link to example, don't have reputation :(
I'm making a drag-and-drop feature with Flutter where users drag values between two columns. I created two DragTarget, one for each column, and lists to keep track of the data for each column. When a Draggable is accepted, I add it to the list, and for onLeave, I remove it from the list. However, there is a duplication issue where the draggable appears both in the column it just left and the new column it was accepted into. I'm thinking this may be due to only one of the DragTargets updating at once, but it seems like that shouldn't happen. Any ideas on how to design and handle the data here?
I'm using a Streambuilder to a Firestore instance stream to fetch some "Appointments" which I later modify (delete / add / update).
Problem is that each time I modify the date on one, each item reloads (because the StreamBuilder builds a list of the appointments)
I was thinking that something like giving each appointment it's own streambuilder? but that sounds stupid.
What would be a general solid approach to these types of issues , that I can later use in my future apps ?
You will want to use the ListView.builder() named constructor. It takes a property itemCount: which can be your list such as itemCount: items.length.
This will build the list based on the items currently in your list (firestore in your case).
It will build the list items conditionally as it needs them.