diff --git a/packages/uni_app/lib/view/home/widgets/exit_app_dialog.dart b/packages/uni_app/lib/view/home/widgets/exit_app_dialog.dart index 5454f6e3e..da241f604 100644 --- a/packages/uni_app/lib/view/home/widgets/exit_app_dialog.dart +++ b/packages/uni_app/lib/view/home/widgets/exit_app_dialog.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:uni/generated/l10n.dart'; /// Manages the app section displayed when the user presses the back button @@ -34,9 +35,9 @@ class BackButtonExitWrapper extends StatelessWidget { child: Text(S.of(context).no), ), ElevatedButton( - onPressed: () { + onPressed: () async { userActionCompleter.complete(true); - Navigator.of(context).pop(false); + await SystemNavigator.pop(); }, child: Text(S.of(context).yes), ),