瀏覽代碼

Replaced generic error dialog with new one + some minor changes

ashilkn 2 年之前
父節點
當前提交
e0fe29bf98

+ 2 - 1
lib/services/billing_service.dart

@@ -15,6 +15,7 @@ import 'package:photos/models/subscription.dart';
 import 'package:photos/models/user_details.dart';
 import 'package:photos/services/user_service.dart';
 import 'package:photos/ui/common/web_page.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/utils/dialog_util.dart';
 
 const kWebPaymentRedirectUrl = "https://payments.ente.io/frameRedirect";
@@ -194,7 +195,7 @@ class BillingService {
       );
     } catch (e) {
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
     await dialog.hide();
   }

+ 2 - 1
lib/services/hidden_service.dart

@@ -14,6 +14,7 @@ import 'package:photos/models/file.dart';
 import 'package:photos/models/magic_metadata.dart';
 import 'package:photos/services/collections_service.dart';
 import 'package:photos/services/file_magic_service.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/utils/crypto_util.dart';
 import 'package:photos/utils/dialog_util.dart';
 
@@ -90,7 +91,7 @@ extension HiddenService on CollectionsService {
     } catch (e, s) {
       _logger.severe("Could not hide", e, s);
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
       return false;
     } finally {
       await dialog.hide();

+ 7 - 6
lib/services/user_service.dart

@@ -30,6 +30,7 @@ import 'package:photos/ui/account/password_reentry_page.dart';
 import 'package:photos/ui/account/two_factor_authentication_page.dart';
 import 'package:photos/ui/account/two_factor_recovery_page.dart';
 import 'package:photos/ui/account/two_factor_setup_page.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/utils/crypto_util.dart';
 import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/navigation_util.dart';
@@ -96,7 +97,7 @@ class UserService {
         );
         return;
       }
-      unawaited(showGenericErrorDialog(context));
+      unawaited(showGenericErrorDialog(context: context));
     } on DioError catch (e) {
       await dialog.hide();
       _logger.info(e);
@@ -109,12 +110,12 @@ class UserService {
           ),
         );
       } else {
-        unawaited(showGenericErrorDialog(context));
+        unawaited(showGenericErrorDialog(context: context));
       }
     } catch (e) {
       await dialog.hide();
       _logger.severe(e);
-      unawaited(showGenericErrorDialog(context));
+      unawaited(showGenericErrorDialog(context: context));
     }
   }
 
@@ -196,7 +197,7 @@ class UserService {
     } catch (e) {
       _logger.severe(e);
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
   }
 
@@ -220,7 +221,7 @@ class UserService {
     } catch (e) {
       _logger.severe(e);
       await dialog.hide();
-      await showGenericErrorDialog(context);
+      await showGenericErrorDialog(context: context);
       return null;
     }
   }
@@ -647,7 +648,7 @@ class UserService {
     try {
       recoveryKey = await getOrCreateRecoveryKey(context);
     } catch (e) {
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
       return false;
     }
     final dialog = createProgressDialog(context, "Verifying...");

+ 1 - 1
lib/ui/account/delete_account_page.dart

@@ -173,7 +173,7 @@ class DeleteAccountPage extends StatelessWidget {
         },
       );
       if (choice == ButtonAction.error) {
-        showNewGenericErrorDialog(context: context);
+        showGenericErrorDialog(context: context);
       }
       if (choice != ButtonAction.first) {
         return;

+ 4 - 3
lib/ui/account/password_entry_page.dart

@@ -12,6 +12,7 @@ import 'package:photos/services/user_service.dart';
 import 'package:photos/ui/account/recovery_key_page.dart';
 import 'package:photos/ui/common/dynamic_fab.dart';
 import 'package:photos/ui/common/web_page.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/payment/subscription.dart';
 import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/navigation_util.dart';
@@ -399,7 +400,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
     } catch (e, s) {
       _logger.severe(e, s);
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
   }
 
@@ -429,7 +430,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
         } catch (e, s) {
           _logger.severe(e, s);
           await dialog.hide();
-          showGenericErrorDialog(context);
+          showGenericErrorDialog(context: context);
         }
       }
 
@@ -454,7 +455,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
           "Sorry, we could not generate secure keys on this device.\n\nplease sign up from a different device.",
         );
       } else {
-        showGenericErrorDialog(context);
+        showGenericErrorDialog(context: context);
       }
     }
   }

+ 3 - 2
lib/ui/account/verify_recovery_page.dart

@@ -14,6 +14,7 @@ import 'package:photos/services/user_service.dart';
 import 'package:photos/ui/account/recovery_key_page.dart';
 import 'package:photos/ui/common/dialogs.dart';
 import 'package:photos/ui/common/gradient_button.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/navigation_util.dart';
 
@@ -49,7 +50,7 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
               "Please check your internet connection and try again.",
             );
           } else {
-            await showGenericErrorDialog(context);
+            await showGenericErrorDialog(context: context);
           }
           return;
         }
@@ -111,7 +112,7 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
           ),
         );
       } catch (e) {
-        showGenericErrorDialog(context);
+        showGenericErrorDialog(context: context);
         return;
       }
     }

+ 6 - 3
lib/ui/actions/collection/collection_file_actions.dart

@@ -8,6 +8,7 @@ import 'package:photos/services/favorites_service.dart';
 import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/ui/actions/collection/collection_sharing_actions.dart';
 import 'package:photos/ui/common/progress_dialog.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/toast_util.dart';
 
@@ -51,8 +52,10 @@ extension CollectionFileActions on CollectionActions {
           isDestructiveAction: true,
           onPressed: () async {
             Navigator.of(context, rootNavigator: true).pop();
-            final dialog = createProgressDialog(context,
-                showDeletePrompt ? "Deleting files..." : "Removing files...",);
+            final dialog = createProgressDialog(
+              context,
+              showDeletePrompt ? "Deleting files..." : "Removing files...",
+            );
             await dialog.show();
             try {
               await collectionsService.removeFromCollection(
@@ -64,7 +67,7 @@ extension CollectionFileActions on CollectionActions {
             } catch (e, s) {
               logger.severe(e, s);
               await dialog.hide();
-              showGenericErrorDialog(context);
+              showGenericErrorDialog(context: context);
             }
           },
           child: Text(showDeletePrompt ? "Yes, delete" : "Yes, remove"),

+ 5 - 4
lib/ui/actions/collection/collection_sharing_actions.dart

@@ -7,6 +7,7 @@ import 'package:photos/services/collections_service.dart';
 import 'package:photos/services/user_service.dart';
 import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/ui/common/dialogs.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/payment/subscription.dart';
 import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/email_util.dart';
@@ -55,7 +56,7 @@ class CollectionActions {
         _showUnSupportedAlert(context);
       } else {
         logger.severe("Failed to update shareUrl collection", e);
-        showGenericErrorDialog(context);
+        showGenericErrorDialog(context: context);
       }
       return false;
     }
@@ -92,7 +93,7 @@ class CollectionActions {
     } catch (e, s) {
       Logger("EmailItemWidget").severe(e, s);
       await dialog.hide();
-      await showGenericErrorDialog(context);
+      await showGenericErrorDialog(context: context);
       return false;
     }
   }
@@ -132,7 +133,7 @@ class CollectionActions {
         await dialog.hide();
       } catch (e) {
         logger.severe("Failed to get public key", e);
-        showGenericErrorDialog(context);
+        showGenericErrorDialog(context: context);
         await dialog.hide();
       }
     }
@@ -188,7 +189,7 @@ class CollectionActions {
           _showUnSupportedAlert(context);
         } else {
           logger.severe("failed to share collection", e);
-          showGenericErrorDialog(context);
+          showGenericErrorDialog(context: context);
         }
         return false;
       }

+ 2 - 1
lib/ui/backup_folder_selection_page.dart

@@ -16,6 +16,7 @@ import 'package:photos/models/device_collection.dart';
 import 'package:photos/models/file.dart';
 import 'package:photos/services/remote_sync_service.dart';
 import 'package:photos/ui/common/loading_widget.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/viewer/file/thumbnail_widget.dart';
 import 'package:photos/utils/dialog_util.dart';
 
@@ -228,7 +229,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
     } catch (e, s) {
       _logger.severe("Failed to updated backup folder", e, s);
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
   }
 

+ 5 - 3
lib/ui/components/dialog_widget.dart

@@ -9,12 +9,14 @@ import 'package:photos/ui/components/button_widget.dart';
 import 'package:photos/ui/components/models/button_type.dart';
 import 'package:photos/utils/separators_util.dart';
 
-void showNewGenericErrorDialog({required BuildContext context}) async {
-  showDialogWidget(
+Future<ButtonAction?> showGenericErrorDialog({
+  required BuildContext context,
+}) async {
+  return showDialogWidget(
     context: context,
     title: "Error",
     icon: Icons.error_outline_outlined,
-    body: "It looks like something went wrong.",
+    body: "It looks like something went wrong. Please try again.",
     buttons: const [
       ButtonWidget(
         buttonType: ButtonType.secondary,

+ 5 - 4
lib/ui/create_collection_page.dart

@@ -14,6 +14,7 @@ import 'package:photos/services/ignored_files_service.dart';
 import 'package:photos/services/remote_sync_service.dart';
 import 'package:photos/ui/common/gradient_button.dart';
 import 'package:photos/ui/common/loading_widget.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/viewer/file/no_thumbnail_widget.dart';
 import 'package:photos/ui/viewer/file/thumbnail_widget.dart';
 import 'package:photos/ui/viewer/gallery/collection_page.dart';
@@ -318,7 +319,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
     } catch (e, s) {
       _logger.severe("Could not move to album", e, s);
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
       return false;
     }
   }
@@ -340,7 +341,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
     } catch (e, s) {
       _logger.severe("Could not move to album", e, s);
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
       return false;
     }
   }
@@ -386,7 +387,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
     } catch (e, s) {
       _logger.severe("Could not add to album", e, s);
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
     return false;
   }
@@ -400,7 +401,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
     } catch (e, s) {
       _logger.severe(e, s);
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     } finally {
       await dialog.hide();
     }

+ 2 - 1
lib/ui/notification/prompts/password_reminder.dart

@@ -11,6 +11,7 @@ import 'package:photos/theme/colors.dart';
 import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/ui/account/password_entry_page.dart';
 import 'package:photos/ui/common/gradient_button.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/home_widget.dart';
 import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/navigation_util.dart';
@@ -93,7 +94,7 @@ class _PasswordReminderState extends State<PasswordReminder> {
         );
       }
     } catch (e) {
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
       return;
     }
   }

+ 2 - 1
lib/ui/payment/child_subscription_widget.dart

@@ -5,6 +5,7 @@ import 'package:photos/ente_theme_data.dart';
 import 'package:photos/models/user_details.dart';
 import 'package:photos/services/user_service.dart';
 import 'package:photos/ui/common/dialogs.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/utils/dialog_util.dart';
 
 class ChildSubscriptionWidget extends StatelessWidget {
@@ -140,7 +141,7 @@ class ChildSubscriptionWidget extends StatelessWidget {
       Navigator.of(context).pop('');
     } catch (e) {
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
   }
 }

+ 2 - 1
lib/ui/payment/payment_web_page.dart

@@ -12,6 +12,7 @@ import 'package:photos/services/billing_service.dart';
 import 'package:photos/services/user_service.dart';
 import 'package:photos/ui/common/loading_widget.dart';
 import 'package:photos/ui/common/progress_dialog.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/utils/dialog_util.dart';
 
 class PaymentWebPage extends StatefulWidget {
@@ -186,7 +187,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
     } else {
       // should never reach here
       _logger.severe("unexpected status", uri.toString());
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
   }
 

+ 2 - 1
lib/ui/payment/stripe_subscription_page.dart

@@ -15,6 +15,7 @@ import 'package:photos/ui/common/dialogs.dart';
 import 'package:photos/ui/common/loading_widget.dart';
 import 'package:photos/ui/common/progress_dialog.dart';
 import 'package:photos/ui/common/web_page.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/payment/child_subscription_widget.dart';
 import 'package:photos/ui/payment/payment_web_page.dart';
 import 'package:photos/ui/payment/skip_subscription_widget.dart';
@@ -323,7 +324,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
       ).then((value) => onWebPaymentGoBack);
     } catch (e) {
       await _dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
     await _dialog.hide();
   }

+ 2 - 1
lib/ui/payment/subscription_page.dart

@@ -16,6 +16,7 @@ import 'package:photos/services/billing_service.dart';
 import 'package:photos/services/user_service.dart';
 import 'package:photos/ui/common/loading_widget.dart';
 import 'package:photos/ui/common/progress_dialog.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/payment/child_subscription_widget.dart';
 import 'package:photos/ui/payment/skip_subscription_widget.dart';
 import 'package:photos/ui/payment/subscription_common_widgets.dart';
@@ -403,7 +404,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
                   "Could not find products: " + response.notFoundIDs.toString(),
                 );
                 await _dialog.hide();
-                showGenericErrorDialog(context);
+                showGenericErrorDialog(context: context);
                 return;
               }
               final isCrossGradingOnAndroid = Platform.isAndroid &&

+ 3 - 3
lib/ui/settings/account_section_widget.dart

@@ -13,10 +13,10 @@ import 'package:photos/ui/account/delete_account_page.dart';
 import 'package:photos/ui/account/password_entry_page.dart';
 import 'package:photos/ui/account/recovery_key_page.dart';
 import 'package:photos/ui/components/captioned_text_widget.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/components/expandable_menu_item_widget.dart';
 import 'package:photos/ui/components/menu_item_widget.dart';
 import 'package:photos/ui/settings/common_settings.dart';
-import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/navigation_util.dart';
 
 class AccountSectionWidget extends StatelessWidget {
@@ -53,7 +53,7 @@ class AccountSectionWidget extends StatelessWidget {
               try {
                 recoveryKey = await _getOrCreateRecoveryKey(context);
               } catch (e) {
-                await showGenericErrorDialog(context);
+                await showGenericErrorDialog(context: context);
                 return;
               }
               unawaited(
@@ -158,7 +158,7 @@ class AccountSectionWidget extends StatelessWidget {
     );
   }
 
-    Future<void> _onLogoutTapped(BuildContext context) async {
+  Future<void> _onLogoutTapped(BuildContext context) async {
     final AlertDialog alert = AlertDialog(
       title: const Text(
         "Logout",

+ 3 - 2
lib/ui/settings/backup_section_widget.dart

@@ -13,6 +13,7 @@ import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/ui/backup_folder_selection_page.dart';
 import 'package:photos/ui/backup_settings_screen.dart';
 import 'package:photos/ui/components/captioned_text_widget.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/components/expandable_menu_item_widget.dart';
 import 'package:photos/ui/components/menu_item_widget.dart';
 import 'package:photos/ui/settings/common_settings.dart';
@@ -95,7 +96,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
               status = await SyncService.instance.getBackupStatus();
             } catch (e) {
               await dialog.hide();
-              showGenericErrorDialog(context);
+              showGenericErrorDialog(context: context);
               return;
             }
 
@@ -132,7 +133,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
                   await DeduplicationService.instance.getDuplicateFiles();
             } catch (e) {
               await dialog.hide();
-              showGenericErrorDialog(context);
+              showGenericErrorDialog(context: context);
               return;
             }
 

+ 2 - 1
lib/ui/sharing/manage_links_widget.dart

@@ -15,6 +15,7 @@ import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/ui/actions/collection/collection_sharing_actions.dart';
 import 'package:photos/ui/common/dialogs.dart';
 import 'package:photos/ui/components/captioned_text_widget.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/components/divider_widget.dart';
 import 'package:photos/ui/components/menu_item_widget.dart';
 import 'package:photos/ui/components/menu_section_description_widget.dart';
@@ -494,7 +495,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
       showToast(context, "Album updated");
     } catch (e) {
       await dialog.hide();
-      await showGenericErrorDialog(context);
+      await showGenericErrorDialog(context: context);
     }
   }
 

+ 4 - 3
lib/ui/viewer/file/fading_app_bar.dart

@@ -25,6 +25,7 @@ import 'package:photos/services/hidden_service.dart';
 import 'package:photos/services/ignored_files_service.dart';
 import 'package:photos/services/local_sync_service.dart';
 import 'package:photos/ui/common/progress_dialog.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/create_collection_page.dart';
 import 'package:photos/ui/viewer/file/custom_app_bar.dart';
 import 'package:photos/utils/delete_file_util.dart';
@@ -264,7 +265,7 @@ class FadingAppBarState extends State<FadingAppBar> {
       }
     } catch (e, s) {
       _logger.severe("failed to update file visibility", e, s);
-      await showGenericErrorDialog(context);
+      await showGenericErrorDialog(context: context);
     }
   }
 
@@ -469,7 +470,7 @@ class FadingAppBarState extends State<FadingAppBar> {
     } catch (e) {
       _logger.warning("Failed to save file", e);
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
   }
 
@@ -517,7 +518,7 @@ class FadingAppBarState extends State<FadingAppBar> {
     } catch (e) {
       dialog.hide();
       _logger.severe("Failed to use as", e);
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
   }
 }

+ 6 - 5
lib/ui/viewer/gallery/gallery_app_bar_widget.dart

@@ -21,6 +21,7 @@ import 'package:photos/services/sync_service.dart';
 import 'package:photos/services/update_service.dart';
 import 'package:photos/ui/common/dialogs.dart';
 import 'package:photos/ui/common/rename_dialog.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/sharing/album_participants_page.dart';
 import 'package:photos/ui/sharing/share_collection_page.dart';
 import 'package:photos/ui/tools/free_space_page.dart';
@@ -132,7 +133,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
       }
     } catch (e) {
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
   }
 
@@ -159,7 +160,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
       }
     } catch (e) {
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
   }
 
@@ -176,7 +177,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
           .getBackupStatus(pathID: widget.deviceCollection.id);
     } catch (e) {
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
       return;
     }
 
@@ -423,7 +424,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
     } catch (e, s) {
       _logger.severe("failed to trash collection", e, s);
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
   }
 
@@ -454,7 +455,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
       }
     } catch (e, s) {
       _logger.severe(e, s);
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
     }
   }
 }

+ 4 - 3
lib/ui/viewer/gallery/gallery_overlay_widget.dart

@@ -18,6 +18,7 @@ import 'package:photos/models/magic_metadata.dart';
 import 'package:photos/models/selected_files.dart';
 import 'package:photos/services/collections_service.dart';
 import 'package:photos/services/hidden_service.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/ui/create_collection_page.dart';
 import 'package:photos/utils/delete_file_util.dart';
 import 'package:photos/utils/dialog_util.dart';
@@ -511,7 +512,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
       );
     } catch (e, s) {
       _logger.severe("failed to update file visibility", e, s);
-      await showGenericErrorDialog(context);
+      await showGenericErrorDialog(context: context);
     } finally {
       _clearSelectedFiles();
     }
@@ -528,7 +529,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
       }
     } catch (e, s) {
       _logger.severe("failed to update file visibility", e, s);
-      await showGenericErrorDialog(context);
+      await showGenericErrorDialog(context: context);
     }
   }
 
@@ -665,7 +666,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
             } catch (e, s) {
               _logger.severe(e, s);
               await dialog.hide();
-              showGenericErrorDialog(context);
+              showGenericErrorDialog(context: context);
             }
           },
           child: const Text("Remove"),

+ 5 - 4
lib/utils/delete_file_util.dart

@@ -24,6 +24,7 @@ import 'package:photos/services/sync_service.dart';
 import 'package:photos/services/trash_sync_service.dart';
 import 'package:photos/ui/common/dialogs.dart';
 import 'package:photos/ui/common/linear_progress_dialog.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/file_util.dart';
 import 'package:photos/utils/toast_util.dart';
@@ -107,7 +108,7 @@ Future<void> deleteFilesFromEverywhere(
     } catch (e) {
       _logger.severe(e);
       await dialog.hide();
-      showGenericErrorDialog(context);
+      showGenericErrorDialog(context: context);
       rethrow;
     }
     for (final collectionID in updatedCollectionIDs) {
@@ -172,7 +173,7 @@ Future<void> deleteFilesFromRemoteOnly(
   } catch (e, s) {
     _logger.severe("Failed to delete files from remote", e, s);
     await dialog.hide();
-    showGenericErrorDialog(context);
+    showGenericErrorDialog(context: context);
     rethrow;
   }
   for (final collectionID in updatedCollectionIDs) {
@@ -288,7 +289,7 @@ Future<bool> deleteFromTrash(BuildContext context, List<File> files) async {
   } catch (e, s) {
     _logger.info("failed to delete from trash", e, s);
     await dialog.hide();
-    await showGenericErrorDialog(context);
+    await showGenericErrorDialog(context: context);
     return false;
   }
 }
@@ -314,7 +315,7 @@ Future<bool> emptyTrash(BuildContext context) async {
   } catch (e, s) {
     _logger.info("failed empty trash", e, s);
     await dialog.hide();
-    await showGenericErrorDialog(context);
+    await showGenericErrorDialog(context: context);
     return false;
   }
 }

+ 0 - 4
lib/utils/dialog_util.dart

@@ -68,10 +68,6 @@ Future<dynamic> showErrorDialog(
   );
 }
 
-Future<dynamic> showGenericErrorDialog(BuildContext context) {
-  return showErrorDialog(context, "Something went wrong", "Please try again.");
-}
-
 Future<T> showConfettiDialog<T>({
   @required BuildContext context,
   WidgetBuilder builder,

+ 2 - 1
lib/utils/share_util.dart

@@ -10,6 +10,7 @@ import 'package:photos/core/configuration.dart';
 import 'package:photos/core/constants.dart';
 import 'package:photos/models/file.dart';
 import 'package:photos/models/file_type.dart';
+import 'package:photos/ui/components/dialog_widget.dart';
 import 'package:photos/utils/date_time_util.dart';
 import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/exif_util.dart';
@@ -61,7 +62,7 @@ Future<void> share(
       s,
     );
     await dialog.hide();
-    await showGenericErrorDialog(context);
+    await showGenericErrorDialog(context: context);
   }
 }