I tried the other StackOverflow answers and in all, that onPressed() is mentioned and the setState() is called in there but I don\'t know where to call setState() in my app as I