Browse Source

Lint fixes

Neeraj Gupta 3 years ago
parent
commit
fdadf36baa
45 changed files with 78 additions and 74 deletions
  1. 4 0
      analysis_options.yaml
  2. 0 3
      lib/main.dart
  3. 0 0
      lib/models/gallery_type.dart
  4. 3 1
      lib/services/memories_service.dart
  5. 1 1
      lib/services/sync_service.dart
  6. 1 1
      lib/ui/account/email_entry_page.dart
  7. 1 1
      lib/ui/account/login_page.dart
  8. 1 1
      lib/ui/account/ott_verification_page.dart
  9. 1 1
      lib/ui/account/password_entry_page.dart
  10. 1 1
      lib/ui/account/password_reentry_page.dart
  11. 1 1
      lib/ui/account/recovery_key_page.dart
  12. 1 1
      lib/ui/account/recovery_page.dart
  13. 0 1
      lib/ui/account/sessions_page.dart
  14. 0 1
      lib/ui/account/two_factor_setup_page.dart
  15. 0 0
      lib/ui/common/bottom_shadow.dart
  16. 0 0
      lib/ui/common/dynamic_fab.dart
  17. 0 0
      lib/ui/common/gradient_button.dart
  18. 2 2
      lib/ui/common/only_outer_shadow.dart
  19. 5 5
      lib/ui/common/progress_dialog.dart
  20. 3 3
      lib/ui/create_collection_page.dart
  21. 4 3
      lib/ui/home_widget.dart
  22. 0 1
      lib/ui/huge_listview/lazy_loading_gallery.dart
  23. 1 1
      lib/ui/landing_page_widget.dart
  24. 1 1
      lib/ui/loading_photos_widget.dart
  25. 1 1
      lib/ui/payment/stripe_subscription_page.dart
  26. 0 1
      lib/ui/payment/subscription_plan_widget.dart
  27. 1 1
      lib/ui/settings/backup_section_widget.dart
  28. 4 2
      lib/ui/settings/debug_section_widget.dart
  29. 17 12
      lib/ui/settings/details_section_widget.dart
  30. 2 2
      lib/ui/shared_collections_gallery.dart
  31. 1 1
      lib/ui/sharing/share_collection_widget.dart
  32. 1 1
      lib/ui/tools/free_space_page.dart
  33. 1 1
      lib/ui/tools/lock_screen.dart
  34. 1 1
      lib/ui/viewer/gallery/archive_page.dart
  35. 1 1
      lib/ui/viewer/gallery/collection_page.dart
  36. 1 1
      lib/ui/viewer/gallery/device_folder_page.dart
  37. 1 1
      lib/ui/viewer/gallery/gallery_app_bar_widget.dart
  38. 1 1
      lib/ui/viewer/gallery/gallery_footer_widget.dart
  39. 1 1
      lib/ui/viewer/gallery/gallery_overlay_widget.dart
  40. 2 2
      lib/ui/viewer/gallery/trash_page.dart
  41. 3 5
      lib/ui/viewer/search/location_search_widget.dart
  42. 1 1
      lib/utils/dialog_util.dart
  43. 1 1
      lib/utils/file_uploader.dart
  44. 4 4
      lib/utils/hex.dart
  45. 2 3
      lib/utils/magic_util.dart

+ 4 - 0
analysis_options.yaml

@@ -18,6 +18,7 @@ linter:
     - sized_box_for_whitespace
     - use_full_hex_values_for_flutter_colors
     - use_key_in_widget_constructors
+    - cancel_subscriptions
 
     - avoid_empty_else
     - exhaustive_cases
@@ -39,12 +40,15 @@ analyzer:
     always_use_package_imports: error
     prefer_final_fields: error
     unused_import: error
+    camel_case_types: error
     prefer_is_empty: warning
     use_rethrow_when_possible: info
     unused_field: warning
     use_key_in_widget_constructors: warning
     sort_child_properties_last: warning
     library_private_types_in_public_api: warning
+    constant_identifier_names: warning
+    cancel_subscriptions: error
 
     use_build_context_synchronously: ignore # experimental lint, requires many changes
     prefer_interpolation_to_compose_strings: ignore # later too many warnings

+ 0 - 3
lib/main.dart

@@ -1,7 +1,6 @@
 import 'dart:async';
 import 'dart:io';
 
-import 'package:adaptive_theme/adaptive_theme.dart';
 import 'package:background_fetch/background_fetch.dart';
 import 'package:firebase_messaging/firebase_messaging.dart';
 import 'package:flutter/foundation.dart';
@@ -40,7 +39,6 @@ import 'package:shared_preferences/shared_preferences.dart';
 final _logger = Logger("main");
 
 bool _isProcessRunning = false;
-AdaptiveThemeMode _savedThemeMode;
 const kLastBGTaskHeartBeatTime = "bg_task_hb_time";
 const kLastFGTaskHeartBeatTime = "fg_task_hb_time";
 const kHeartBeatFrequency = Duration(seconds: 1);
@@ -120,7 +118,6 @@ Future<void> _init(bool isBackground, {String via = ''}) async {
   _isProcessRunning = true;
   _logger.info("Initializing...  inBG =$isBackground via: $via");
   await _logFGHeartBeatInfo();
-  _savedThemeMode = await AdaptiveTheme.getThemeMode();
   _scheduleHeartBeat(isBackground);
   if (isBackground) {
     AppLifecycleService.instance.onAppInBackground('init via: $via');

+ 0 - 0
lib/models/galleryType.dart → lib/models/gallery_type.dart


+ 3 - 1
lib/services/memories_service.dart

@@ -74,7 +74,9 @@ class MemoriesService extends ChangeNotifier {
     final archivedCollectionIds =
         CollectionsService.instance.getArchivedCollections();
     final files = await _filesDB.getFilesCreatedWithinDurations(
-        durations, archivedCollectionIds);
+      durations,
+      archivedCollectionIds,
+    );
     final seenTimes = await _memoriesDB.getSeenTimes();
     final List<Memory> memories = [];
     final filter = ImportantItemsFilter();

+ 1 - 1
lib/services/sync_service.dart

@@ -116,7 +116,7 @@ class SyncService {
     } on UnauthorizedError {
       _logger.info("Logging user out");
       Bus.instance.fire(TriggerLogoutEvent());
-    } catch (e, s) {
+    } catch (e) {
       if (e is DioError) {
         if (e.type == DioErrorType.connectTimeout ||
             e.type == DioErrorType.sendTimeout ||

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

@@ -10,7 +10,7 @@ import 'package:photos/ente_theme_data.dart';
 import 'package:photos/models/billing_plan.dart';
 import 'package:photos/services/billing_service.dart';
 import 'package:photos/services/user_service.dart';
-import 'package:photos/ui/common/dynamicFAB.dart';
+import 'package:photos/ui/common/dynamic_fab.dart';
 import 'package:photos/ui/common/loading_widget.dart';
 import 'package:photos/ui/common/web_page.dart';
 import 'package:photos/utils/data_util.dart';

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

@@ -3,7 +3,7 @@ import 'package:flutter/gestures.dart';
 import 'package:flutter/material.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/services/user_service.dart';
-import 'package:photos/ui/common/dynamicFAB.dart';
+import 'package:photos/ui/common/dynamic_fab.dart';
 import 'package:photos/ui/common/web_page.dart';
 
 class LoginPage extends StatefulWidget {

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

@@ -1,7 +1,7 @@
 import 'package:flutter/material.dart';
 import 'package:photos/ente_theme_data.dart';
 import 'package:photos/services/user_service.dart';
-import 'package:photos/ui/common/dynamicFAB.dart';
+import 'package:photos/ui/common/dynamic_fab.dart';
 import 'package:step_progress_indicator/step_progress_indicator.dart';
 
 class OTTVerificationPage extends StatefulWidget {

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

@@ -8,7 +8,7 @@ import 'package:photos/events/account_configured_event.dart';
 import 'package:photos/events/subscription_purchased_event.dart';
 import 'package:photos/services/user_service.dart';
 import 'package:photos/ui/account/recovery_key_page.dart';
-import 'package:photos/ui/common/dynamicFAB.dart';
+import 'package:photos/ui/common/dynamic_fab.dart';
 import 'package:photos/ui/common/web_page.dart';
 import 'package:photos/ui/payment/subscription.dart';
 import 'package:photos/utils/dialog_util.dart';

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

@@ -4,7 +4,7 @@ import 'package:photos/core/configuration.dart';
 import 'package:photos/core/event_bus.dart';
 import 'package:photos/events/subscription_purchased_event.dart';
 import 'package:photos/ui/account/recovery_page.dart';
-import 'package:photos/ui/common/dynamicFAB.dart';
+import 'package:photos/ui/common/dynamic_fab.dart';
 import 'package:photos/ui/home_widget.dart';
 import 'package:photos/utils/dialog_util.dart';
 

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

@@ -7,7 +7,7 @@ import 'package:flutter/services.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/core/constants.dart';
 import 'package:photos/ente_theme_data.dart';
-import 'package:photos/ui/common/gradientButton.dart';
+import 'package:photos/ui/common/gradient_button.dart';
 import 'package:photos/utils/toast_util.dart';
 import 'package:share_plus/share_plus.dart';
 import 'package:step_progress_indicator/step_progress_indicator.dart';

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

@@ -3,7 +3,7 @@ import 'dart:ui';
 import 'package:flutter/material.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/ui/account/password_entry_page.dart';
-import 'package:photos/ui/common/dynamicFAB.dart';
+import 'package:photos/ui/common/dynamic_fab.dart';
 import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/toast_util.dart';
 

+ 0 - 1
lib/ui/account/sessions_page.dart

@@ -1,5 +1,4 @@
 import 'package:flutter/material.dart';
-import 'package:flutter/widgets.dart';
 import 'package:logging/logging.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/ente_theme_data.dart';

+ 0 - 1
lib/ui/account/two_factor_setup_page.dart

@@ -1,6 +1,5 @@
 import 'dart:ui';
 
-import 'package:flutter/foundation.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:flutter_sodium/flutter_sodium.dart';

+ 0 - 0
lib/ui/common/bottomShadow.dart → lib/ui/common/bottom_shadow.dart


+ 0 - 0
lib/ui/common/dynamicFAB.dart → lib/ui/common/dynamic_fab.dart


+ 0 - 0
lib/ui/common/gradientButton.dart → lib/ui/common/gradient_button.dart


+ 2 - 2
lib/ui/common/onlyOuterShadow.dart → lib/ui/common/only_outer_shadow.dart

@@ -1,9 +1,9 @@
 import 'package:flutter/material.dart';
 
-class onlyOuterShadow extends BoxShadow {
+class OnlyOuterShadow extends BoxShadow {
   final BlurStyle blurStyle;
 
-  const onlyOuterShadow({
+  const OnlyOuterShadow({
     Color color = const Color(0xFF000000),
     Offset offset = Offset.zero,
     double blurRadius = 0.0,

+ 5 - 5
lib/ui/common/progress_dialog.dart

@@ -1,6 +1,6 @@
 import 'package:flutter/material.dart';
 
-enum ProgressDialogType { Normal, Download }
+enum ProgressDialogType { normal, download }
 
 String _dialogMessage = "Loading...";
 double _progress = 0.0, _maxProgress = 100.0;
@@ -52,7 +52,7 @@ class ProgressDialog {
     Color barrierColor,
   }) {
     _context = context;
-    _progressDialogType = type ?? ProgressDialogType.Normal;
+    _progressDialogType = type ?? ProgressDialogType.normal;
     _barrierDismissible = isDismissible ?? true;
     _showLogs = showLogs ?? false;
     _customBody = customBody ?? null;
@@ -77,7 +77,7 @@ class ProgressDialog {
     Alignment progressWidgetAlignment,
   }) {
     if (_isShowing) return;
-    if (_progressDialogType == ProgressDialogType.Download) {
+    if (_progressDialogType == ProgressDialogType.download) {
       _progress = progress ?? _progress;
     }
 
@@ -105,7 +105,7 @@ class ProgressDialog {
     TextStyle progressTextStyle,
     TextStyle messageTextStyle,
   }) {
-    if (_progressDialogType == ProgressDialogType.Download) {
+    if (_progressDialogType == ProgressDialogType.download) {
       _progress = progress ?? _progress;
     }
 
@@ -223,7 +223,7 @@ class _BodyState extends State<_Body> {
     );
 
     final text = Expanded(
-      child: _progressDialogType == ProgressDialogType.Normal
+      child: _progressDialogType == ProgressDialogType.normal
           ? Text(
               _dialogMessage,
               textAlign: _textAlign,

+ 3 - 3
lib/ui/create_collection_page.dart

@@ -9,7 +9,7 @@ import 'package:photos/models/file.dart';
 import 'package:photos/models/selected_files.dart';
 import 'package:photos/services/collections_service.dart';
 import 'package:photos/services/remote_sync_service.dart';
-import 'package:photos/ui/common/gradientButton.dart';
+import 'package:photos/ui/common/gradient_button.dart';
 import 'package:photos/ui/common/loading_widget.dart';
 import 'package:photos/ui/viewer/file/thumbnail_widget.dart';
 import 'package:photos/ui/viewer/gallery/collection_page.dart';
@@ -313,7 +313,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
       widget.selectedFiles?.clearAll();
 
       return true;
-    } on AssertionError catch (e, s) {
+    } on AssertionError catch (e) {
       await dialog.hide();
       showErrorDialog(context, "Oops", e.message);
       return false;
@@ -335,7 +335,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
       widget.selectedFiles?.clearAll();
       await dialog.hide();
       return true;
-    } on AssertionError catch (e, s) {
+    } on AssertionError catch (e) {
       await dialog.hide();
       showErrorDialog(context, "Oops", e.message);
       return false;

+ 4 - 3
lib/ui/home_widget.dart

@@ -23,7 +23,7 @@ import 'package:photos/events/tab_changed_event.dart';
 import 'package:photos/events/trigger_logout_event.dart';
 import 'package:photos/events/user_logged_out_event.dart';
 import 'package:photos/models/file_load_result.dart';
-import 'package:photos/models/galleryType.dart';
+import 'package:photos/models/gallery_type.dart';
 import 'package:photos/models/selected_files.dart';
 import 'package:photos/services/collections_service.dart';
 import 'package:photos/services/ignored_files_service.dart';
@@ -32,8 +32,8 @@ import 'package:photos/services/update_service.dart';
 import 'package:photos/services/user_service.dart';
 import 'package:photos/ui/backup_folder_selection_page.dart';
 import 'package:photos/ui/collections_gallery_widget.dart';
-import 'package:photos/ui/common/bottomShadow.dart';
-import 'package:photos/ui/common/gradientButton.dart';
+import 'package:photos/ui/common/bottom_shadow.dart';
+import 'package:photos/ui/common/gradient_button.dart';
 import 'package:photos/ui/create_collection_page.dart';
 import 'package:photos/ui/extents_page_view.dart';
 import 'package:photos/ui/grant_permissions_widget.dart';
@@ -225,6 +225,7 @@ class _HomeWidgetState extends State<HomeWidget> {
     _firstImportEvent.cancel();
     _backupFoldersUpdatedEvent.cancel();
     _accountConfiguredEvent.cancel();
+    _intentDataStreamSubscription?.cancel();
     super.dispose();
   }
 

+ 0 - 1
lib/ui/huge_listview/lazy_loading_gallery.dart

@@ -1,6 +1,5 @@
 import 'dart:async';
 import 'dart:math';
-import 'dart:ui';
 
 import 'package:flutter/foundation.dart';
 import 'package:flutter/material.dart';

+ 1 - 1
lib/ui/landing_page_widget.dart

@@ -8,7 +8,7 @@ import 'package:photos/ui/account/email_entry_page.dart';
 import 'package:photos/ui/account/login_page.dart';
 import 'package:photos/ui/account/password_entry_page.dart';
 import 'package:photos/ui/account/password_reentry_page.dart';
-import 'package:photos/ui/common/gradientButton.dart';
+import 'package:photos/ui/common/gradient_button.dart';
 import 'package:photos/ui/payment/subscription.dart';
 
 class LandingPageWidget extends StatefulWidget {

+ 1 - 1
lib/ui/loading_photos_widget.dart

@@ -7,7 +7,7 @@ import 'package:photos/ente_theme_data.dart';
 import 'package:photos/events/sync_status_update_event.dart';
 import 'package:photos/services/local_sync_service.dart';
 import 'package:photos/ui/backup_folder_selection_page.dart';
-import 'package:photos/ui/common/bottomShadow.dart';
+import 'package:photos/ui/common/bottom_shadow.dart';
 import 'package:photos/utils/navigation_util.dart';
 
 class LoadingPhotosWidget extends StatefulWidget {

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

@@ -8,7 +8,7 @@ import 'package:photos/models/subscription.dart';
 import 'package:photos/models/user_details.dart';
 import 'package:photos/services/billing_service.dart';
 import 'package:photos/services/user_service.dart';
-import 'package:photos/ui/common/bottomShadow.dart';
+import 'package:photos/ui/common/bottom_shadow.dart';
 import 'package:photos/ui/common/dialogs.dart';
 import 'package:photos/ui/common/loading_widget.dart';
 import 'package:photos/ui/common/progress_dialog.dart';

+ 0 - 1
lib/ui/payment/subscription_plan_widget.dart

@@ -1,4 +1,3 @@
-import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:photos/utils/data_util.dart';
 

+ 1 - 1
lib/ui/settings/backup_section_widget.dart

@@ -143,7 +143,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
             BackupStatus status;
             try {
               status = await SyncService.instance.getBackupStatus();
-            } catch (e, s) {
+            } catch (e) {
               await dialog.hide();
               showGenericErrorDialog(context);
               return;

+ 4 - 2
lib/ui/settings/debug_section_widget.dart

@@ -56,8 +56,10 @@ class DebugSectionWidget extends StatelessWidget {
             Text("Key", style: TextStyle(fontWeight: FontWeight.bold)),
             Text(Sodium.bin2base64(Configuration.instance.getKey())),
             Padding(padding: EdgeInsets.all(12)),
-            Text("Encrypted Key",
-                style: TextStyle(fontWeight: FontWeight.bold)),
+            Text(
+              "Encrypted Key",
+              style: TextStyle(fontWeight: FontWeight.bold),
+            ),
             Text(keyAttributes.encryptedKey),
             Padding(padding: EdgeInsets.all(12)),
             Text(

+ 17 - 12
lib/ui/settings/details_section_widget.dart

@@ -123,7 +123,8 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                                     .textTheme
                                     .subtitle2
                                     .copyWith(
-                                        color: Colors.white.withOpacity(0.7)),
+                                      color: Colors.white.withOpacity(0.7),
+                                    ),
                               ),
                               Text(
                                 "${convertBytesToReadableFormat(_userDetails.getFreeStorage())} of ${convertBytesToReadableFormat(_userDetails.getTotalStorage())} free",
@@ -180,20 +181,21 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                                             ),
                                           ),
                                           Padding(
-                                              padding:
-                                                  EdgeInsets.only(right: 4)),
+                                            padding: EdgeInsets.only(right: 4),
+                                          ),
                                           Text(
                                             "You",
                                             style: Theme.of(context)
                                                 .textTheme
                                                 .bodyText1
                                                 .copyWith(
-                                                    color: Colors.white,
-                                                    fontSize: 12),
+                                                  color: Colors.white,
+                                                  fontSize: 12,
+                                                ),
                                           ),
                                           Padding(
-                                              padding:
-                                                  EdgeInsets.only(right: 12)),
+                                            padding: EdgeInsets.only(right: 12),
+                                          ),
                                           Container(
                                             width: 8.71,
                                             height: 8.99,
@@ -204,8 +206,8 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                                             ),
                                           ),
                                           Padding(
-                                              padding:
-                                                  EdgeInsets.only(right: 4)),
+                                            padding: EdgeInsets.only(right: 4),
+                                          ),
                                           Text(
                                             "Family",
                                             style: Theme.of(context)
@@ -224,8 +226,9 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                                             .textTheme
                                             .bodyText1
                                             .copyWith(
-                                                color: Colors.white,
-                                                fontSize: 12),
+                                              color: Colors.white,
+                                              fontSize: 12,
+                                            ),
                                       ),
                                 Padding(
                                   padding: const EdgeInsets.only(right: 16.0),
@@ -235,7 +238,9 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                                         .textTheme
                                         .bodyText1
                                         .copyWith(
-                                            color: Colors.white, fontSize: 12),
+                                          color: Colors.white,
+                                          fontSize: 12,
+                                        ),
                                   ),
                                 )
                               ],

+ 2 - 2
lib/ui/shared_collections_gallery.dart

@@ -13,10 +13,10 @@ import 'package:photos/events/local_photos_updated_event.dart';
 import 'package:photos/events/tab_changed_event.dart';
 import 'package:photos/events/user_logged_out_event.dart';
 import 'package:photos/models/collection_items.dart';
-import 'package:photos/models/galleryType.dart';
+import 'package:photos/models/gallery_type.dart';
 import 'package:photos/services/collections_service.dart';
 import 'package:photos/ui/collections_gallery_widget.dart';
-import 'package:photos/ui/common/gradientButton.dart';
+import 'package:photos/ui/common/gradient_button.dart';
 import 'package:photos/ui/common/loading_widget.dart';
 import 'package:photos/ui/viewer/file/thumbnail_widget.dart';
 import 'package:photos/ui/viewer/gallery/collection_page.dart';

+ 1 - 1
lib/ui/sharing/share_collection_widget.dart

@@ -16,7 +16,7 @@ import 'package:photos/services/collections_service.dart';
 import 'package:photos/services/feature_flag_service.dart';
 import 'package:photos/services/user_service.dart';
 import 'package:photos/ui/common/dialogs.dart';
-import 'package:photos/ui/common/gradientButton.dart';
+import 'package:photos/ui/common/gradient_button.dart';
 import 'package:photos/ui/common/loading_widget.dart';
 import 'package:photos/ui/payment/subscription.dart';
 import 'package:photos/ui/sharing/manage_links_widget.dart';

+ 1 - 1
lib/ui/tools/free_space_page.dart

@@ -3,7 +3,7 @@ import 'package:intl/intl.dart';
 import 'package:logging/logging.dart';
 import 'package:photos/ente_theme_data.dart';
 import 'package:photos/models/backup_status.dart';
-import 'package:photos/ui/common/gradientButton.dart';
+import 'package:photos/ui/common/gradient_button.dart';
 import 'package:photos/utils/data_util.dart';
 import 'package:photos/utils/delete_file_util.dart';
 

+ 1 - 1
lib/ui/tools/lock_screen.dart

@@ -1,7 +1,7 @@
 import 'package:flutter/material.dart';
 import 'package:logging/logging.dart';
 import 'package:photos/ente_theme_data.dart';
-import 'package:photos/ui/common/gradientButton.dart';
+import 'package:photos/ui/common/gradient_button.dart';
 import 'package:photos/ui/tools/app_lock.dart';
 import 'package:photos/utils/auth_util.dart';
 

+ 1 - 1
lib/ui/viewer/gallery/archive_page.dart

@@ -3,7 +3,7 @@ import 'package:photos/core/configuration.dart';
 import 'package:photos/core/event_bus.dart';
 import 'package:photos/db/files_db.dart';
 import 'package:photos/events/files_updated_event.dart';
-import 'package:photos/models/galleryType.dart';
+import 'package:photos/models/gallery_type.dart';
 import 'package:photos/models/magic_metadata.dart';
 import 'package:photos/models/selected_files.dart';
 import 'package:photos/ui/viewer/gallery/gallery.dart';

+ 1 - 1
lib/ui/viewer/gallery/collection_page.dart

@@ -4,7 +4,7 @@ import 'package:photos/db/files_db.dart';
 import 'package:photos/events/collection_updated_event.dart';
 import 'package:photos/events/files_updated_event.dart';
 import 'package:photos/models/collection_items.dart';
-import 'package:photos/models/galleryType.dart';
+import 'package:photos/models/gallery_type.dart';
 import 'package:photos/models/selected_files.dart';
 import 'package:photos/ui/viewer/gallery/gallery.dart';
 import 'package:photos/ui/viewer/gallery/gallery_app_bar_widget.dart';

+ 1 - 1
lib/ui/viewer/gallery/device_folder_page.dart

@@ -7,7 +7,7 @@ import 'package:photos/events/backup_folders_updated_event.dart';
 import 'package:photos/events/files_updated_event.dart';
 import 'package:photos/events/local_photos_updated_event.dart';
 import 'package:photos/models/device_folder.dart';
-import 'package:photos/models/galleryType.dart';
+import 'package:photos/models/gallery_type.dart';
 import 'package:photos/models/selected_files.dart';
 import 'package:photos/ui/viewer/gallery/gallery.dart';
 import 'package:photos/ui/viewer/gallery/gallery_app_bar_widget.dart';

+ 1 - 1
lib/ui/viewer/gallery/gallery_app_bar_widget.dart

@@ -6,7 +6,7 @@ import 'package:photos/core/configuration.dart';
 import 'package:photos/core/event_bus.dart';
 import 'package:photos/events/subscription_purchased_event.dart';
 import 'package:photos/models/collection.dart';
-import 'package:photos/models/galleryType.dart';
+import 'package:photos/models/gallery_type.dart';
 import 'package:photos/models/magic_metadata.dart';
 import 'package:photos/models/selected_files.dart';
 import 'package:photos/services/collections_service.dart';

+ 1 - 1
lib/ui/viewer/gallery/gallery_footer_widget.dart

@@ -3,7 +3,7 @@ import 'package:photo_manager/photo_manager.dart';
 import 'package:photos/ente_theme_data.dart';
 import 'package:photos/services/local_sync_service.dart';
 import 'package:photos/ui/backup_folder_selection_page.dart';
-import 'package:photos/ui/common/gradientButton.dart';
+import 'package:photos/ui/common/gradient_button.dart';
 import 'package:photos/utils/navigation_util.dart';
 
 class GalleryFooterWidget extends StatelessWidget {

+ 1 - 1
lib/ui/viewer/gallery/gallery_overlay_widget.dart

@@ -11,7 +11,7 @@ import 'package:photos/core/event_bus.dart';
 import 'package:photos/ente_theme_data.dart';
 import 'package:photos/events/subscription_purchased_event.dart';
 import 'package:photos/models/collection.dart';
-import 'package:photos/models/galleryType.dart';
+import 'package:photos/models/gallery_type.dart';
 import 'package:photos/models/magic_metadata.dart';
 import 'package:photos/models/selected_files.dart';
 import 'package:photos/services/collections_service.dart';

+ 2 - 2
lib/ui/viewer/gallery/trash_page.dart

@@ -5,9 +5,9 @@ import 'package:photos/core/event_bus.dart';
 import 'package:photos/db/trash_db.dart';
 import 'package:photos/events/files_updated_event.dart';
 import 'package:photos/events/force_reload_trash_page_event.dart';
-import 'package:photos/models/galleryType.dart';
+import 'package:photos/models/gallery_type.dart';
 import 'package:photos/models/selected_files.dart';
-import 'package:photos/ui/common/bottomShadow.dart';
+import 'package:photos/ui/common/bottom_shadow.dart';
 import 'package:photos/ui/viewer/gallery/gallery.dart';
 import 'package:photos/ui/viewer/gallery/gallery_app_bar_widget.dart';
 import 'package:photos/ui/viewer/gallery/gallery_overlay_widget.dart';

+ 3 - 5
lib/ui/viewer/search/location_search_widget.dart

@@ -107,11 +107,9 @@ class LocationSearchResultWidget extends StatelessWidget {
               ),
               Padding(padding: EdgeInsets.only(left: 20.0)),
               Flexible(
-                child: Container(
-                  child: Text(
-                    name,
-                    overflow: TextOverflow.clip,
-                  ),
+                child: Text(
+                  name,
+                  overflow: TextOverflow.clip,
                 ),
               ),
             ],

+ 1 - 1
lib/utils/dialog_util.dart

@@ -8,7 +8,7 @@ import 'package:photos/ui/common/progress_dialog.dart';
 ProgressDialog createProgressDialog(BuildContext context, String message) {
   final dialog = ProgressDialog(
     context,
-    type: ProgressDialogType.Normal,
+    type: ProgressDialogType.normal,
     isDismissible: false,
     barrierColor: Colors.black12,
   );

+ 1 - 1
lib/utils/file_uploader.dart

@@ -656,7 +656,7 @@ class FileUploader {
     }
     try {
       return _uploadURLs.removeFirst();
-    } catch (e, s) {
+    } catch (e) {
       if (e is StateError && e.message == 'No element' && _queue.isNotEmpty) {
         _logger.warning("Oops, uploadUrls has no element now, fetching again");
         return _getUploadURL();

+ 4 - 4
lib/utils/hex.dart

@@ -1,10 +1,10 @@
 import "dart:convert";
 import "dart:typed_data";
 
-const String _ALPHABET = "0123456789abcdef";
+const String _alphabet = "0123456789abcdef";
 
 /// An instance of the default implementation of the [HexCodec].
-const HEX = const HexCodec();
+const hex = HexCodec();
 
 /// A codec for encoding and decoding byte arrays to and from
 /// hexadecimal strings.
@@ -55,8 +55,8 @@ class HexDecoder extends Converter<String, List<int>> {
     }
     Uint8List result = Uint8List(str.length ~/ 2);
     for (int i = 0; i < result.length; i++) {
-      int firstDigit = _ALPHABET.indexOf(str[i * 2]);
-      int secondDigit = _ALPHABET.indexOf(str[i * 2 + 1]);
+      int firstDigit = _alphabet.indexOf(str[i * 2]);
+      int secondDigit = _alphabet.indexOf(str[i * 2 + 1]);
       if (firstDigit == -1 || secondDigit == -1) {
         throw FormatException("Non-hex character detected in $hex");
       }

+ 2 - 3
lib/utils/magic_util.dart

@@ -1,5 +1,4 @@
 import 'package:flutter/material.dart';
-import 'package:flutter/widgets.dart';
 import 'package:logging/logging.dart';
 import 'package:path/path.dart';
 import 'package:photos/core/event_bus.dart';
@@ -85,7 +84,7 @@ Future<bool> editTime(
       editedTime,
     );
     return true;
-  } catch (e, s) {
+  } catch (e) {
     showToast(context, 'something went wrong');
     return false;
   }
@@ -118,7 +117,7 @@ Future<bool> editFilename(
       result,
     );
     return true;
-  } catch (e, s) {
+  } catch (e) {
     showToast(context, 'something went wrong');
     return false;
   }