I wonder if there is any difference between Selector widget and the context.select() function. At the end they do the same. Is there any difference between them or is it just syntax?


Solution 1: Sanketh B. K

context.select is a context method with others like context.read, context.watch. Funtionally they does the same thing, but depending onyour use-case, you can avoid using an extra widget, but while using context methods you need to be careful with widget rebuilds as entire widget inside the build method will be rebuilt, while in case of directly using Consumer or Selector only their children widgets are rebuilt