I have a page where I display a list of players. Each row has a switch to toggle a variable (is_active) in the players collection (Firebase). This is set up as a component and works fine when generated dynamically in a listview.
On another page I display these players who's variable is_active = 1.
Now I want to select again, but only from the players who has is_active = 1.
I was thinking that the best way would be to fill an App State Variable (list) with the players IDs (Document Reference) and then alter the App State if the user toggles any players on or off before sending it to Firebase. I use toggle on/off the App State won't be populated if the user does not take any action so I was thinking this would be the best approach.
There might be a better way of doing this, and if it is PLEASE tell me. Im stuck and I can't figure this one out.