blob: 7072a98d5d3389b3bf149ccd18a20e3d8beb7670 [file] [log] [blame] [view] [edit]
# Lifecycle constructor
*[<Null safety>](https://dart.dev/null-safety)*
Lifecycle()
<p>Obtains an instance of the shared <a href="../../package-fuchsia_modular_lifecycle/Lifecycle-class.md">Lifecycle</a> instance.</p>
## Implementation
```dart
factory Lifecycle() {
if (_singleton == null) {
throw Exception(
'Attempted to construct Lifecycle before lifecycle events have been enabled. '
'Ensure that Lifecycle.enableLifecycleEvents is called first.');
}
return _singleton!;
}
```