fix(nav): preserve HTPC escape behavior
Use Flutter's supported desktop application-exit API so the second root Back press closes Plezy on Windows. Preserve fullscreen when video player navigation is enabled while keeping fullscreen-first Escape behavior for normal desktop use. close #1582
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/services/app_exit_service.dart';
|
||||
|
||||
void main() {
|
||||
test('desktop exit uses the required application exit API', () async {
|
||||
ui.AppExitType? requestedType;
|
||||
int? requestedCode;
|
||||
|
||||
expect(
|
||||
await AppExitService.requestExit(
|
||||
exitApplicationForTesting: (exitType, exitCode) async {
|
||||
requestedType = exitType;
|
||||
requestedCode = exitCode;
|
||||
return ui.AppExitResponse.exit;
|
||||
},
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
expect(requestedType, ui.AppExitType.required);
|
||||
expect(requestedCode, 0);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user