Get and Display Data from data source Online

Of course, you can use one of this two List instance methods

  • where
  • retainWhere

// mocking the list of rows
List<Map> rows = [
  {'id': 1, 'name': 'a', 'target': 'a1'},
  {'id': 2, 'name': 'b', 'target': 'b1'},
  {'id': 1, 'name': 'a', 'target': 'a2'},
  {'id': 3, 'name': 'c', 'target': 'c1'},

void main() {
  // where creates a new lazy Iterable, it doesn't mutate the rows list.
  List filteredRows1 = rows.where((row) => row['id'] == 1).toList();
  // retainWhere filters in place, it mutates the rows list.
  rows.retainWhere((row) => row['id'] == 1);


> [{id: 1, name: a, target: a1}, {id: 1, name: a, target: a2}]
> [{id: 1, name: a, target: a1}, {id: 1, name: a, target: a2}]

@KAD9_911, I just had the idea of checking if was possibile to implement a kind of sync between a Sheet file and a Firebase database, in order to take advantage of its querying capabilities, and save lots of bytes and energy downloading only specific user’s data.
I really wasn’t happy with the full data download and on-client late filtering for obvious efficiency reasons. The fact is that -yes why shouldn’t be!- it is quite seamless. I didn’t test the implementation described in the following post, but I think you really should have a look at this possibile solution:

Hello, I am trying to update the retrieved values from the sheets in a text widget. I am using Future Builder to display the text. But the widget doesn’t update and I have to hot reload the screen to get the text text widget. How can I fix this?

:thinking:How would you debug a code you cannot read? :wink:
Please share the relevant source code if you’d like someone to look at it and try to help you.