Tạ Bích Hạnh
Member
How do you initState in flutter?
Answer
initState method Null safety
Answer
initState method Null safety
- In initState, subscribe to the object.
- In didUpdateWidget unsubscribe from the old object and subscribe to the new one if the updated widget configuration requires replacing the object.
- In dispose, unsubscribe from the object.