[mob][photos] Stop popping root navigator to avoid black screen from appearing

This commit is contained in:
ashilkn
2024-10-21 18:56:13 +05:30
parent 04b4b6cbd1
commit 9713e96896
9 changed files with 15 additions and 16 deletions

View File

@@ -17,8 +17,8 @@ import "package:photos/utils/toast_util.dart";
class DeleteAccountPage extends StatefulWidget {
const DeleteAccountPage({
Key? key,
}) : super(key: key);
super.key,
});
@override
State<DeleteAccountPage> createState() => _DeleteAccountPageState();

View File

@@ -184,7 +184,7 @@ class _SessionsPageState extends State<SessionsPage> {
),
),
onPressed: () async {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
if (isLoggingOutFromThisDevice) {
await UserService.instance.logout(context);
} else {
@@ -202,7 +202,7 @@ class _SessionsPageState extends State<SessionsPage> {
),
),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
},
),
],

View File

@@ -127,8 +127,7 @@ class _GrantPermissionsWidgetState extends State<GrantPermissionsWidget> {
),
),
onPressed: () {
Navigator.of(context, rootNavigator: true)
.pop('dialog');
Navigator.of(context).pop('dialog');
if (Platform.isIOS) {
PhotoManager.openSetting();
}

View File

@@ -109,7 +109,7 @@ class DebugSectionWidget extends StatelessWidget {
TextButton(
child: const Text("OK"),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
},
),
],

View File

@@ -229,7 +229,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
),
),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
},
),
TextButton(
@@ -241,7 +241,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
),
onPressed: () async {
await UserService.instance.disableTwoFactor(context);
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
},
),
],

View File

@@ -239,7 +239,7 @@ class _HomeWidgetState extends State<HomeWidget> {
),
),
onPressed: () async {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
Navigator.of(context).popUntil((route) => route.isFirst);
final dialog =
createProgressDialog(context, S.of(context).loggingOut);

View File

@@ -84,7 +84,7 @@ class _DeleteEmptyAlbumsState extends State<DeleteEmptyAlbums> {
onTap: () async {
await _deleteEmptyAlbums();
if (!_isCancelled) {
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop();
}
Bus.instance.fire(
CollectionUpdatedEvent(
@@ -104,7 +104,7 @@ class _DeleteEmptyAlbumsState extends State<DeleteEmptyAlbums> {
shouldStickToDarkTheme: true,
onTap: () async {
_isCancelled = true;
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop();
},
),
],

View File

@@ -41,7 +41,7 @@ class ExifInfoDialog extends StatelessWidget {
style: textTheme.body,
),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
},
),
],

View File

@@ -119,7 +119,7 @@ Future<void> _sendLogs(
await FlutterEmailSender.send(email);
} catch (e, s) {
_logger.severe('email sender failed', e, s);
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop();
await shareLogs(context, toEmail, zipFilePath);
}
}
@@ -275,14 +275,14 @@ Future<void> sendEmail(
emailContent: content,
);
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop();
},
),
],
cancelButton: CupertinoActionSheetAction(
child: Text(S.of(context).cancel),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop();
},
),
),