From what I see, the snapshot
from your StreamBuilder
is not in use, you might as well remove the StreamBuilder
.
Anytime you setState, your StreamBuilder
rebuilds which might cause all the functions in there to get called multiple times and cause an infinite loop.