조용한 담장

공유: Learn Flutter Life Cycle In 10 Minutes 본문

Flutter

공유: Learn Flutter Life Cycle In 10 Minutes

iosroid 2020. 11. 30. 12:22

Youtube: Learn Flutter Life Cycle In 10 Minutes

 

youtu.be/CjloInz3-I0

InitState

First Lyfecycle method that is called.

 

Called when this object is inserted into the tree.
The framework will call this method exactly once for each State object it creates.

DidChangeDependencies

Second Lifecycle method that is called. Called every time a dependency change.

 

Called when a dependency of this element changes.
When the information of that type changes at this location in the tree the framework calls this function to notify this element of the change.

DidUpdateWidget

Called whenever the widget configuration changes.

 

Called whenever the widget configuration changes.
If the parent widget rebuilds and request that this location in the tree update to display a new widget with the same runtimeType and Widget.key, the framework will update the widget property of this State object to refer to the new widget and then call this method with the previous widget as an argument.

Deactivate

Called when object is removed from the tree. Do not dispose here.

 

Called when this object is removed from the tree.
The framework calls this method whenever it removes this State object from the tree.

Dispose

Called when object is removed from the tree permantely. Do dispose here.

 

Called when this object is removed from the tree permanently.
The framework calls this method when this State object will never build again.
After the framework calls dispose, the State object is considered unmounted and the mounted property is false.
It is an error to call setState at this point.
This stage of the lifecycle is terminal: there is no way to remount a State object that has been disposed.

Source

github.com/RobertBrunhage/flutter_life_cycle_methods_tutorial/blob/master/lib/main.dart

 

RobertBrunhage/flutter_life_cycle_methods_tutorial

Contribute to RobertBrunhage/flutter_life_cycle_methods_tutorial development by creating an account on GitHub.

github.com

 

'Flutter' 카테고리의 다른 글

Flutter 2.0 관련 모음  (0) 2021.03.04
공유: Best Resources to Learn Flutter & Dart  (0) 2021.02.17
Flutter Package: school_ui_toolkit  (0) 2020.07.30
Flutter Gems  (0) 2020.07.28
Flutter: device_apps package  (0) 2020.06.11
Comments