xxxxxxxxxx
@override
void initState() {
super.initState();
///whatever you want to run on page build
}
xxxxxxxxxx
This is the first method called when the widget is created (after the class constructor, of course.)
initState is called once and only once. It must also call super.initState().
This @override method is the best time to:
Initialize data that relies on the specific BuildContext for the created instance of the widget.
Initialize properties that rely on this widgets 'parent' in the tree.
Subscribe to Streams, ChangeNotifiers, or any other object that could change the data on this widget.