1. Declare cycles
@override
void initState() {
// Initialize method
super.initState();
}
@override
void didChangeDependencies() {
// called when state changes
super.didChangeDependencies();
}
@override
void didUpdateWidget(MyHomePage oldWidget) {
// State changes end the method called
super.didUpdateWidget(oldWidget);
}
@override
void deactivate() {
// The method called when removed from the view tree
super.deactivate();
}
@override
void dispose() {
// The component has destroyed the called method
super.dispose();
}
@override
void reassemble() {
// Hit Hot Reload in debugger mode
super.reassemble();
}
Copy the code