I've a widget that has a Stateful widget as child. What I want is, some action to be triggered whenever this Stateful child widget reloads.
In the child widget I have this function,
//in child widget
@override
void initState() {
super.initState();
print("Inside Child Widget");
}
Problem is, it is printing this only the first time. After this, whenever there is a change in state of parent widget which leads to reloading of this child widget, this action does not get triggered.
I checked this answer initState function is't be called in StatefulWidget by default & I understand initstate() is called only once, however, when I reload the widget, it rebuilds, so shouldn't the function get triggered again?