useAppLifecycleState function
ReadonlySignal<AppLifecycleState?>
useAppLifecycleState({
- AppLifecycleState? initialState,
- void onChange(
- AppLifecycleState state
Listens to application lifecycle state changes
Returns a reactive Signal representing the current application lifecycle state
Implementation
ReadonlySignal<AppLifecycleState?> useAppLifecycleState({
AppLifecycleState? initialState,
void Function(AppLifecycleState state)? onChange,
}) {
final observer = useHook(
_AppLifecycleObserver(initialState: initialState, onChange: onChange));
return observer.readonly();
}