Reputation: 67
https://i.sstatic.net/8yq5w.png when I click 1st time on Shirshak it doesnot open anything. When I try to click on mobile 2nd time on Shirshak it opens new Screen https://i.sstatic.net/4fVMN.png. And when I click 3rd time on mobile in 2 then It opens Shirshak again. But when I click it 4th time then it opens 2 https://i.sstatic.net/kqEqv.png . This happens again and again I have to hit same two times to get inside chat screen in flutter.
Here is my code:
https://i.sstatic.net/iGYfZ.png
https://i.sstatic.net/MdY1G.png
https://i.sstatic.net/tIUKh.png
Upvotes: 0
Views: 103
Reputation: 456
The function getDataForChat() in line 97 is an asynchronous method but you didn't use await and ansync keyword for it ( many other method which collect data from the internet in your code isn't marked with async and await too).
You should disabled all the other button when anyone of them is clicked .
You are using a Stateful Widget, so to change the value of any variable, you must use setState . For example, in line 101, you should use setState to set isLoading to false.
Upvotes: 1