bindObserver function
void
bindObserver({
- ScreenStatusCallback? onResume,
- ScreenStatusCallback? onPause,
- ScreenStatusCallback? onInactive,
- ScreenStatusCallback? onDetach,
- ScreenStatusCallback? onSuspend,
Implementation
void bindObserver({
ScreenStatusCallback? onResume,
ScreenStatusCallback? onPause,
ScreenStatusCallback? onInactive,
ScreenStatusCallback? onDetach,
ScreenStatusCallback? onSuspend
}){
WidgetsBinding.instance.addObserver(NUILifecycleEventHandler(
resumeCallBack: onResume ?? (){},
pauseCallback: onPause ?? (){},
inactiveCallback: onInactive ?? (){},
detachCallback: onDetach ?? (){},
suspendCallback: onSuspend ?? (){},
));
}