blob: d167a88f5701db2679954d9cdf0a23b08554486e [file] [log] [blame] [view]
# Lifecycle class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Allows running components to be notified when lifecycle events happen in the
system.</p>
## Constructors
[Lifecycle](../package-fuchsia_modular_lifecycle/Lifecycle/Lifecycle.md) ()
Obtains an instance of the shared <a href="../package-fuchsia_modular_lifecycle/Lifecycle-class.md">Lifecycle</a> instance. _factory_
## Properties
##### [hashCode](../package-fuchsia_modular_lifecycle/Lifecycle/hashCode.md) &#8594; int
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [runtimeType](../package-fuchsia_modular_lifecycle/Lifecycle/runtimeType.md) &#8594; Type
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
## Methods
##### [addTerminateListener](../package-fuchsia_modular_lifecycle/Lifecycle/addTerminateListener.md)(Future&lt;void> listener()) bool
Adds a terminate <code>listener</code> which will be called when the system starts to
shutdown this process. Returns <code>false</code> if this listener was already added.
##### [noSuchMethod](../package-fuchsia_modular_lifecycle/Lifecycle/noSuchMethod.md)(Invocation invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [toString](../package-fuchsia_modular_lifecycle/Lifecycle/toString.md)() String
A string representation of this object.
_<span class="feature">inherited</span>_
## Operators
##### [operator ==](../package-fuchsia_modular_lifecycle/Lifecycle/operator_equals.md)(Object other) bool
The equality operator.
_<span class="feature">inherited</span>_
## Static Methods
##### [enableLifecycleEvents](../package-fuchsia_modular_lifecycle/Lifecycle/enableLifecycleEvents.md)([Outgoing](../package-fuchsia_services_services/Outgoing-class.md) outgoing) void
Initializes the shared <a href="../package-fuchsia_modular_lifecycle/Lifecycle-class.md">Lifecycle</a> instance. This is required before
Lifecycle can be constructed.