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
25 lines
638 B
Dart
25 lines
638 B
Dart
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);
|
|
});
|
|
}
|