INNER CODE UNIT · Dart
_TonkatsuBoxAppState
hacan359/tonkatsu_box · lib/app.dart:26
class _TonkatsuBoxAppState extends ConsumerState<TonkatsuBoxApp> {
late final AppLifecycleListener _lifecycleListener;
@override
void initState() {
super.initState();
_lifecycleListener = AppLifecycleListener(
// Veto OS-level close requests while a restore is mid-flight so SQLite
// can't be cut off mid-write; forced kills still bypass this.
onExitRequested: () async {
if (ref.read(restoreInProgressProvider)) {
return ui.AppExitResponse.cancel;
}
return ui.AppExitResponse.exit;
},
);
}