lifecycle property
LifecycleDesign
lifecycle
getter/setter pairinherited
Defines the lifecycle behavior of the pod.
Describes lifecycle behavior of a component, such as initialization and destruction methods.
This class allows you to specify whether the component should be lazy-loaded, which methods should be called at initialization and destruction, and whether those lifecycle methods are enforced.
Example
final lifecycle = LifecycleDesign(
isLazy: true,
initMethods: ["initDatabase"],
destroyMethods: ["closeDatabase"],
enforceInitMethod: true,
enforceDestroyMethod: true,
);
print(lifecycle.isLazy); // true
print(lifecycle.initMethods); // ["initDatabase"]
Implementation
LifecycleDesign lifecycle;