Accessing a function of stateful widget in its state class? flutter Accessing a function of stateful widget in its state class? flutter dart dart

Accessing a function of stateful widget in its state class? flutter


You need to make your method public. Right now because of the underscore (_) before the name, the method is private and you cannot access it.

Simply change the name from _signOut to signOut and then you should be able to call it by widget.signOut().