Neeraj Gupta 3 vuotta sitten
vanhempi
commit
460dd1203e
100 muutettua tiedostoa jossa 959 lisäystä ja 907 poistoa
  1. 3 2
      analysis_options.yaml
  2. 7 4
      lib/core/configuration.dart
  3. 1 1
      lib/core/error-reporting/tunneled_transport.dart
  4. 1 0
      lib/core/network.dart
  5. 22 22
      lib/db/collections_db.dart
  6. 4 4
      lib/db/file_migration_db.dart
  7. 33 33
      lib/db/files_db.dart
  8. 7 7
      lib/db/ignored_files_db.dart
  9. 5 5
      lib/db/memories_db.dart
  10. 5 5
      lib/db/public_keys_db.dart
  11. 22 22
      lib/db/trash_db.dart
  12. 74 72
      lib/ente_theme_data.dart
  13. 1 1
      lib/main.dart
  14. 2 2
      lib/services/collections_service.dart
  15. 1 1
      lib/services/file_migration_service.dart
  16. 8 7
      lib/services/memories_service.dart
  17. 1 1
      lib/services/notification_service.dart
  18. 4 4
      lib/ui/account/change_email_dialog.dart
  19. 35 26
      lib/ui/account/email_entry_page.dart
  20. 15 13
      lib/ui/account/login_page.dart
  21. 5 5
      lib/ui/account/ott_verification_page.dart
  22. 10 10
      lib/ui/account/password_entry_page.dart
  23. 7 7
      lib/ui/account/password_reentry_page.dart
  24. 14 14
      lib/ui/account/recovery_key_page.dart
  25. 7 7
      lib/ui/account/recovery_page.dart
  26. 11 11
      lib/ui/account/sessions_page.dart
  27. 11 11
      lib/ui/account/two_factor_authentication_page.dart
  28. 7 7
      lib/ui/account/two_factor_recovery_page.dart
  29. 18 18
      lib/ui/account/two_factor_setup_page.dart
  30. 15 15
      lib/ui/backup_folder_selection_page.dart
  31. 21 21
      lib/ui/collections_gallery_widget.dart
  32. 1 1
      lib/ui/common/dialogs.dart
  33. 3 3
      lib/ui/common/dynamic_fab.dart
  34. 4 4
      lib/ui/common/gradient_button.dart
  35. 1 1
      lib/ui/common/linear_progress_dialog.dart
  36. 2 2
      lib/ui/common/loading_widget.dart
  37. 6 6
      lib/ui/common/progress_dialog.dart
  38. 4 4
      lib/ui/common/rename_dialog.dart
  39. 3 7
      lib/ui/common/web_page.dart
  40. 8 9
      lib/ui/create_collection_page.dart
  41. 6 6
      lib/ui/grant_permissions_widget.dart
  42. 19 19
      lib/ui/header_error_widget.dart
  43. 25 22
      lib/ui/home_widget.dart
  44. 6 6
      lib/ui/huge_listview/draggable_scrollbar.dart
  45. 4 4
      lib/ui/huge_listview/lazy_loading_gallery.dart
  46. 3 3
      lib/ui/huge_listview/place_holder_widget.dart
  47. 6 6
      lib/ui/huge_listview/scroll_bar_thumb.dart
  48. 18 18
      lib/ui/landing_page_widget.dart
  49. 5 5
      lib/ui/loading_photos_widget.dart
  50. 13 13
      lib/ui/memories_widget.dart
  51. 5 5
      lib/ui/payment/billing_questions_widget.dart
  52. 17 16
      lib/ui/payment/child_subscription_widget.dart
  53. 4 4
      lib/ui/payment/payment_web_page.dart
  54. 2 2
      lib/ui/payment/skip_subscription_widget.dart
  55. 11 11
      lib/ui/payment/stripe_subscription_page.dart
  56. 2 2
      lib/ui/payment/subscription_common_widgets.dart
  57. 5 5
      lib/ui/payment/subscription_page.dart
  58. 5 4
      lib/ui/payment/subscription_plan_widget.dart
  59. 11 7
      lib/ui/settings/account_section_widget.dart
  60. 10 10
      lib/ui/settings/app_update_dialog.dart
  61. 1 1
      lib/ui/settings/app_version_widget.dart
  62. 9 9
      lib/ui/settings/backup_section_widget.dart
  63. 1 1
      lib/ui/settings/common_settings.dart
  64. 11 10
      lib/ui/settings/danger_section_widget.dart
  65. 19 13
      lib/ui/settings/debug_section_widget.dart
  66. 15 9
      lib/ui/settings/details_section_widget.dart
  67. 16 10
      lib/ui/settings/info_section_widget.dart
  68. 9 8
      lib/ui/settings/security_section_widget.dart
  69. 2 2
      lib/ui/settings/settings_section_title.dart
  70. 8 5
      lib/ui/settings/social_section_widget.dart
  71. 8 4
      lib/ui/settings/support_section_widget.dart
  72. 1 1
      lib/ui/settings/theme_switch_widget.dart
  73. 11 11
      lib/ui/settings_page.dart
  74. 17 17
      lib/ui/shared_collections_gallery.dart
  75. 35 35
      lib/ui/sharing/manage_links_widget.dart
  76. 29 28
      lib/ui/sharing/share_collection_widget.dart
  77. 14 14
      lib/ui/status_bar_widget.dart
  78. 4 4
      lib/ui/tools/debug/log_file_viewer.dart
  79. 18 18
      lib/ui/tools/deduplicate_page.dart
  80. 18 18
      lib/ui/tools/editor/image_editor_page.dart
  81. 12 12
      lib/ui/tools/free_space_page.dart
  82. 2 2
      lib/ui/tools/set_wallpaper_dialog.dart
  83. 5 5
      lib/ui/viewer/file/detail_page.dart
  84. 1 1
      lib/ui/viewer/file/exif_info_dialog.dart
  85. 16 15
      lib/ui/viewer/file/fading_app_bar.dart
  86. 4 4
      lib/ui/viewer/file/fading_bottom_bar.dart
  87. 2 2
      lib/ui/viewer/file/file_icons_widget.dart
  88. 32 32
      lib/ui/viewer/file/file_info_dialog.dart
  89. 1 1
      lib/ui/viewer/file/file_widget.dart
  90. 2 2
      lib/ui/viewer/file/thumbnail_widget.dart
  91. 11 11
      lib/ui/viewer/file/video_controls.dart
  92. 6 6
      lib/ui/viewer/file/video_widget.dart
  93. 2 2
      lib/ui/viewer/file/zoomable_live_image.dart
  94. 1 1
      lib/ui/viewer/gallery/archive_page.dart
  95. 1 1
      lib/ui/viewer/gallery/collection_page.dart
  96. 5 5
      lib/ui/viewer/gallery/device_folder_page.dart
  97. 2 2
      lib/ui/viewer/gallery/gallery_app_bar_widget.dart
  98. 1 1
      lib/ui/viewer/gallery/gallery_footer_widget.dart
  99. 13 13
      lib/ui/viewer/gallery/gallery_overlay_widget.dart
  100. 8 8
      lib/ui/viewer/gallery/trash_page.dart

+ 3 - 2
analysis_options.yaml

@@ -48,12 +48,13 @@ analyzer:
     sort_child_properties_last: warning
     sort_child_properties_last: warning
     library_private_types_in_public_api: warning
     library_private_types_in_public_api: warning
     constant_identifier_names: warning
     constant_identifier_names: warning
+    prefer_const_constructors: warning
+    prefer_const_declarations: warning
+    unnecessary_const: error
     cancel_subscriptions: error
     cancel_subscriptions: error
 
 
     use_build_context_synchronously: ignore # experimental lint, requires many changes
     use_build_context_synchronously: ignore # experimental lint, requires many changes
     prefer_interpolation_to_compose_strings: ignore # later too many warnings
     prefer_interpolation_to_compose_strings: ignore # later too many warnings
-    prefer_const_constructors: ignore # too many warnings
-    prefer_const_declarations: ignore # too many warnings
     prefer_const_constructors_in_immutables: ignore # too many warnings
     prefer_const_constructors_in_immutables: ignore # too many warnings
     prefer_double_quotes: ignore # too many warnings
     prefer_double_quotes: ignore # too many warnings
     avoid_renaming_method_parameters: ignore # incorrect warnings for `equals` overrides
     avoid_renaming_method_parameters: ignore # incorrect warnings for `equals` overrides

+ 7 - 4
lib/core/configuration.dart

@@ -64,7 +64,7 @@ class Configuration {
       "has_selected_all_folders_for_backup";
       "has_selected_all_folders_for_backup";
   static const anonymousUserIDKey = "anonymous_user_id";
   static const anonymousUserIDKey = "anonymous_user_id";
 
 
-  final kTempFolderDeletionTimeBuffer = Duration(days: 1).inMicroseconds;
+  final kTempFolderDeletionTimeBuffer = const Duration(days: 1).inMicroseconds;
 
 
   static final _logger = Logger("Configuration");
   static final _logger = Logger("Configuration");
 
 
@@ -80,11 +80,11 @@ class Configuration {
   String _volatilePassword;
   String _volatilePassword;
 
 
   final _secureStorageOptionsIOS =
   final _secureStorageOptionsIOS =
-      IOSOptions(accessibility: IOSAccessibility.first_unlock);
+      const IOSOptions(accessibility: IOSAccessibility.first_unlock);
 
 
   Future<void> init() async {
   Future<void> init() async {
     _preferences = await SharedPreferences.getInstance();
     _preferences = await SharedPreferences.getInstance();
-    _secureStorage = FlutterSecureStorage();
+    _secureStorage = const FlutterSecureStorage();
     _documentsDirectory = (await getApplicationDocumentsDirectory()).path;
     _documentsDirectory = (await getApplicationDocumentsDirectory()).path;
     _tempDirectory = _documentsDirectory + "/temp/";
     _tempDirectory = _documentsDirectory + "/temp/";
     final tempDirectory = io.Directory(_tempDirectory);
     final tempDirectory = io.Directory(_tempDirectory);
@@ -128,7 +128,9 @@ class Configuration {
     if (SyncService.instance.isSyncInProgress()) {
     if (SyncService.instance.isSyncInProgress()) {
       SyncService.instance.stopSync();
       SyncService.instance.stopSync();
       try {
       try {
-        await SyncService.instance.existingSync().timeout(Duration(seconds: 5));
+        await SyncService.instance
+            .existingSync()
+            .timeout(const Duration(seconds: 5));
       } catch (e) {
       } catch (e) {
         // ignore
         // ignore
       }
       }
@@ -590,6 +592,7 @@ class Configuration {
 
 
   Future<String> _getOrCreateAnonymousUserID() async {
   Future<String> _getOrCreateAnonymousUserID() async {
     if (!_preferences.containsKey(anonymousUserIDKey)) {
     if (!_preferences.containsKey(anonymousUserIDKey)) {
+      //ignore: prefer_const_constructors
       await _preferences.setString(anonymousUserIDKey, Uuid().v4());
       await _preferences.setString(anonymousUserIDKey, Uuid().v4());
     }
     }
     return _preferences.getString(anonymousUserIDKey);
     return _preferences.getString(anonymousUserIDKey);

+ 1 - 1
lib/core/error-reporting/tunneled_transport.dart

@@ -48,7 +48,7 @@ class TunneledTransport implements Transport {
           'body = ${response.body}',
           'body = ${response.body}',
         );
         );
       }
       }
-      return SentryId.empty();
+      return const SentryId.empty();
     } else {
     } else {
       _options.logger(
       _options.logger(
         SentryLevel.debug,
         SentryLevel.debug,

+ 1 - 0
lib/core/network.dart

@@ -43,6 +43,7 @@ class Network {
 class RequestIdInterceptor extends Interceptor {
 class RequestIdInterceptor extends Interceptor {
   @override
   @override
   void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
   void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
+    // ignore: prefer_const_constructors
     options.headers.putIfAbsent("x-request-id", () => Uuid().v4().toString());
     options.headers.putIfAbsent("x-request-id", () => Uuid().v4().toString());
     return super.onRequest(options, handler);
     return super.onRequest(options, handler);
   }
   }

+ 22 - 22
lib/db/collections_db.dart

@@ -8,30 +8,30 @@ import 'package:sqflite/sqflite.dart';
 import 'package:sqflite_migration/sqflite_migration.dart';
 import 'package:sqflite_migration/sqflite_migration.dart';
 
 
 class CollectionsDB {
 class CollectionsDB {
-  static final _databaseName = "ente.collections.db";
-  static final table = 'collections';
-  static final tempTable = 'temp_collections';
-  static final _sqlBoolTrue = 1;
-  static final _sqlBoolFalse = 0;
+  static const _databaseName = "ente.collections.db";
+  static const table = 'collections';
+  static const tempTable = 'temp_collections';
+  static const _sqlBoolTrue = 1;
+  static const _sqlBoolFalse = 0;
 
 
-  static final columnID = 'collection_id';
-  static final columnOwner = 'owner';
-  static final columnEncryptedKey = 'encrypted_key';
-  static final columnKeyDecryptionNonce = 'key_decryption_nonce';
-  static final columnName = 'name';
-  static final columnEncryptedName = 'encrypted_name';
-  static final columnNameDecryptionNonce = 'name_decryption_nonce';
-  static final columnType = 'type';
-  static final columnEncryptedPath = 'encrypted_path';
-  static final columnPathDecryptionNonce = 'path_decryption_nonce';
-  static final columnVersion = 'version';
-  static final columnSharees = 'sharees';
-  static final columnPublicURLs = 'public_urls';
+  static const columnID = 'collection_id';
+  static const columnOwner = 'owner';
+  static const columnEncryptedKey = 'encrypted_key';
+  static const columnKeyDecryptionNonce = 'key_decryption_nonce';
+  static const columnName = 'name';
+  static const columnEncryptedName = 'encrypted_name';
+  static const columnNameDecryptionNonce = 'name_decryption_nonce';
+  static const columnType = 'type';
+  static const columnEncryptedPath = 'encrypted_path';
+  static const columnPathDecryptionNonce = 'path_decryption_nonce';
+  static const columnVersion = 'version';
+  static const columnSharees = 'sharees';
+  static const columnPublicURLs = 'public_urls';
   // MMD -> Magic Metadata
   // MMD -> Magic Metadata
-  static final columnMMdEncodedJson = 'mmd_encoded_json';
-  static final columnMMdVersion = 'mmd_ver';
-  static final columnUpdationTime = 'updation_time';
-  static final columnIsDeleted = 'is_deleted';
+  static const columnMMdEncodedJson = 'mmd_encoded_json';
+  static const columnMMdVersion = 'mmd_ver';
+  static const columnUpdationTime = 'updation_time';
+  static const columnIsDeleted = 'is_deleted';
 
 
   static final intitialScript = [...createTable(table)];
   static final intitialScript = [...createTable(table)];
   static final migrationScripts = [
   static final migrationScripts = [

+ 4 - 4
lib/db/file_migration_db.dart

@@ -6,12 +6,12 @@ import 'package:path_provider/path_provider.dart';
 import 'package:sqflite/sqflite.dart';
 import 'package:sqflite/sqflite.dart';
 
 
 class FilesMigrationDB {
 class FilesMigrationDB {
-  static final _databaseName = "ente.files_migration.db";
-  static final _databaseVersion = 1;
+  static const _databaseName = "ente.files_migration.db";
+  static const _databaseVersion = 1;
   static final Logger _logger = Logger((FilesMigrationDB).toString());
   static final Logger _logger = Logger((FilesMigrationDB).toString());
-  static final tableName = 're_upload_tracker';
+  static const tableName = 're_upload_tracker';
 
 
-  static final columnLocalID = 'local_id';
+  static const columnLocalID = 'local_id';
 
 
   Future _onCreate(Database db, int version) async {
   Future _onCreate(Database db, int version) async {
     await db.execute(
     await db.execute(

+ 33 - 33
lib/db/files_db.dart

@@ -20,49 +20,49 @@ class FilesDB {
   duplicate entries for un-uploaded files that were created due to a collision
   duplicate entries for un-uploaded files that were created due to a collision
   in background and foreground syncs.
   in background and foreground syncs.
   */
   */
-  static final _databaseName = "ente.files.db";
+  static const _databaseName = "ente.files.db";
 
 
   static final Logger _logger = Logger("FilesDB");
   static final Logger _logger = Logger("FilesDB");
 
 
-  static final table = 'files';
-  static final tempTable = 'temp_files';
-
-  static final columnGeneratedID = '_id';
-  static final columnUploadedFileID = 'uploaded_file_id';
-  static final columnOwnerID = 'owner_id';
-  static final columnCollectionID = 'collection_id';
-  static final columnLocalID = 'local_id';
-  static final columnTitle = 'title';
-  static final columnDeviceFolder = 'device_folder';
-  static final columnLatitude = 'latitude';
-  static final columnLongitude = 'longitude';
-  static final columnFileType = 'file_type';
-  static final columnFileSubType = 'file_sub_type';
-  static final columnDuration = 'duration';
-  static final columnExif = 'exif';
-  static final columnHash = 'hash';
-  static final columnMetadataVersion = 'metadata_version';
-  static final columnIsDeleted = 'is_deleted';
-  static final columnCreationTime = 'creation_time';
-  static final columnModificationTime = 'modification_time';
-  static final columnUpdationTime = 'updation_time';
-  static final columnEncryptedKey = 'encrypted_key';
-  static final columnKeyDecryptionNonce = 'key_decryption_nonce';
-  static final columnFileDecryptionHeader = 'file_decryption_header';
-  static final columnThumbnailDecryptionHeader = 'thumbnail_decryption_header';
-  static final columnMetadataDecryptionHeader = 'metadata_decryption_header';
+  static const table = 'files';
+  static const tempTable = 'temp_files';
+
+  static const columnGeneratedID = '_id';
+  static const columnUploadedFileID = 'uploaded_file_id';
+  static const columnOwnerID = 'owner_id';
+  static const columnCollectionID = 'collection_id';
+  static const columnLocalID = 'local_id';
+  static const columnTitle = 'title';
+  static const columnDeviceFolder = 'device_folder';
+  static const columnLatitude = 'latitude';
+  static const columnLongitude = 'longitude';
+  static const columnFileType = 'file_type';
+  static const columnFileSubType = 'file_sub_type';
+  static const columnDuration = 'duration';
+  static const columnExif = 'exif';
+  static const columnHash = 'hash';
+  static const columnMetadataVersion = 'metadata_version';
+  static const columnIsDeleted = 'is_deleted';
+  static const columnCreationTime = 'creation_time';
+  static const columnModificationTime = 'modification_time';
+  static const columnUpdationTime = 'updation_time';
+  static const columnEncryptedKey = 'encrypted_key';
+  static const columnKeyDecryptionNonce = 'key_decryption_nonce';
+  static const columnFileDecryptionHeader = 'file_decryption_header';
+  static const columnThumbnailDecryptionHeader = 'thumbnail_decryption_header';
+  static const columnMetadataDecryptionHeader = 'metadata_decryption_header';
 
 
   // MMD -> Magic Metadata
   // MMD -> Magic Metadata
-  static final columnMMdEncodedJson = 'mmd_encoded_json';
-  static final columnMMdVersion = 'mmd_ver';
+  static const columnMMdEncodedJson = 'mmd_encoded_json';
+  static const columnMMdVersion = 'mmd_ver';
 
 
-  static final columnPubMMdEncodedJson = 'pub_mmd_encoded_json';
-  static final columnPubMMdVersion = 'pub_mmd_ver';
+  static const columnPubMMdEncodedJson = 'pub_mmd_encoded_json';
+  static const columnPubMMdVersion = 'pub_mmd_ver';
 
 
   // part of magic metadata
   // part of magic metadata
   // Only parse & store selected fields from JSON in separate columns if
   // Only parse & store selected fields from JSON in separate columns if
   // we need to write query based on that field
   // we need to write query based on that field
-  static final columnMMdVisibility = 'mmd_visibility';
+  static const columnMMdVisibility = 'mmd_visibility';
 
 
   static final initializationScript = [...createTable(table)];
   static final initializationScript = [...createTable(table)];
   static final migrationScripts = [
   static final migrationScripts = [

+ 7 - 7
lib/db/ignored_files_db.dart

@@ -11,15 +11,15 @@ import 'package:sqflite/sqflite.dart';
 // Common use case:
 // Common use case:
 // when a user deletes a file just from ente on current or different device.
 // when a user deletes a file just from ente on current or different device.
 class IgnoredFilesDB {
 class IgnoredFilesDB {
-  static final _databaseName = "ente.ignored_files.db";
-  static final _databaseVersion = 1;
+  static const _databaseName = "ente.ignored_files.db";
+  static const _databaseVersion = 1;
   static final Logger _logger = Logger("IgnoredFilesDB");
   static final Logger _logger = Logger("IgnoredFilesDB");
-  static final tableName = 'ignored_files';
+  static const tableName = 'ignored_files';
 
 
-  static final columnLocalID = 'local_id';
-  static final columnTitle = 'title';
-  static final columnDeviceFolder = 'device_folder';
-  static final columnReason = 'reason';
+  static const columnLocalID = 'local_id';
+  static const columnTitle = 'title';
+  static const columnDeviceFolder = 'device_folder';
+  static const columnReason = 'reason';
 
 
   Future _onCreate(Database db, int version) async {
   Future _onCreate(Database db, int version) async {
     await db.execute(
     await db.execute(

+ 5 - 5
lib/db/memories_db.dart

@@ -7,13 +7,13 @@ import 'package:photos/models/memory.dart';
 import 'package:sqflite/sqflite.dart';
 import 'package:sqflite/sqflite.dart';
 
 
 class MemoriesDB {
 class MemoriesDB {
-  static final _databaseName = "ente.memories.db";
-  static final _databaseVersion = 1;
+  static const _databaseName = "ente.memories.db";
+  static const _databaseVersion = 1;
 
 
-  static final table = 'memories';
+  static const table = 'memories';
 
 
-  static final columnFileID = 'file_id';
-  static final columnSeenTime = 'seen_time';
+  static const columnFileID = 'file_id';
+  static const columnSeenTime = 'seen_time';
 
 
   MemoriesDB._privateConstructor();
   MemoriesDB._privateConstructor();
   static final MemoriesDB instance = MemoriesDB._privateConstructor();
   static final MemoriesDB instance = MemoriesDB._privateConstructor();

+ 5 - 5
lib/db/public_keys_db.dart

@@ -7,13 +7,13 @@ import 'package:photos/models/public_key.dart';
 import 'package:sqflite/sqflite.dart';
 import 'package:sqflite/sqflite.dart';
 
 
 class PublicKeysDB {
 class PublicKeysDB {
-  static final _databaseName = "ente.public_keys.db";
-  static final _databaseVersion = 1;
+  static const _databaseName = "ente.public_keys.db";
+  static const _databaseVersion = 1;
 
 
-  static final table = 'public_keys';
+  static const table = 'public_keys';
 
 
-  static final columnEmail = 'email';
-  static final columnPublicKey = 'public_key';
+  static const columnEmail = 'email';
+  static const columnPublicKey = 'public_key';
 
 
   PublicKeysDB._privateConstructor();
   PublicKeysDB._privateConstructor();
   static final PublicKeysDB instance = PublicKeysDB._privateConstructor();
   static final PublicKeysDB instance = PublicKeysDB._privateConstructor();

+ 22 - 22
lib/db/trash_db.dart

@@ -13,33 +13,33 @@ import 'package:sqflite/sqflite.dart';
 // column or not while showing trashed items. Even if we miss storing any new attributes,
 // column or not while showing trashed items. Even if we miss storing any new attributes,
 // during restore, all file attributes will be fetched & stored as required.
 // during restore, all file attributes will be fetched & stored as required.
 class TrashDB {
 class TrashDB {
-  static final _databaseName = "ente.trash.db";
-  static final _databaseVersion = 1;
+  static const _databaseName = "ente.trash.db";
+  static const _databaseVersion = 1;
   static final Logger _logger = Logger("TrashDB");
   static final Logger _logger = Logger("TrashDB");
-  static final tableName = 'trash';
-
-  static final columnUploadedFileID = 'uploaded_file_id';
-  static final columnCollectionID = 'collection_id';
-  static final columnOwnerID = 'owner_id';
-  static final columnTrashUpdatedAt = 't_updated_at';
-  static final columnTrashDeleteBy = 't_delete_by';
-  static final columnEncryptedKey = 'encrypted_key';
-  static final columnKeyDecryptionNonce = 'key_decryption_nonce';
-  static final columnFileDecryptionHeader = 'file_decryption_header';
-  static final columnThumbnailDecryptionHeader = 'thumbnail_decryption_header';
-  static final columnUpdationTime = 'updation_time';
-
-  static final columnCreationTime = 'creation_time';
-  static final columnLocalID = 'local_id';
+  static const tableName = 'trash';
+
+  static const columnUploadedFileID = 'uploaded_file_id';
+  static const columnCollectionID = 'collection_id';
+  static const columnOwnerID = 'owner_id';
+  static const columnTrashUpdatedAt = 't_updated_at';
+  static const columnTrashDeleteBy = 't_delete_by';
+  static const columnEncryptedKey = 'encrypted_key';
+  static const columnKeyDecryptionNonce = 'key_decryption_nonce';
+  static const columnFileDecryptionHeader = 'file_decryption_header';
+  static const columnThumbnailDecryptionHeader = 'thumbnail_decryption_header';
+  static const columnUpdationTime = 'updation_time';
+
+  static const columnCreationTime = 'creation_time';
+  static const columnLocalID = 'local_id';
 
 
   // standard file metadata, which isn't editable
   // standard file metadata, which isn't editable
-  static final columnFileMetadata = 'file_metadata';
+  static const columnFileMetadata = 'file_metadata';
 
 
-  static final columnMMdEncodedJson = 'mmd_encoded_json';
-  static final columnMMdVersion = 'mmd_ver';
+  static const columnMMdEncodedJson = 'mmd_encoded_json';
+  static const columnMMdVersion = 'mmd_ver';
 
 
-  static final columnPubMMdEncodedJson = 'pub_mmd_encoded_json';
-  static final columnPubMMdVersion = 'pub_mmd_ver';
+  static const columnPubMMdEncodedJson = 'pub_mmd_encoded_json';
+  static const columnPubMMdVersion = 'pub_mmd_ver';
 
 
   Future _onCreate(Database db, int version) async {
   Future _onCreate(Database db, int version) async {
     await db.execute(
     await db.execute(

+ 74 - 72
lib/ente_theme_data.dart

@@ -7,14 +7,15 @@ final lightThemeData = ThemeData(
   hintColor: Colors.grey,
   hintColor: Colors.grey,
   primaryColor: Colors.deepOrangeAccent,
   primaryColor: Colors.deepOrangeAccent,
   primaryColorLight: Colors.black54,
   primaryColorLight: Colors.black54,
-  iconTheme: IconThemeData(color: Colors.black),
-  primaryIconTheme: IconThemeData(color: Colors.red, opacity: 1.0, size: 50.0),
-  colorScheme: ColorScheme.light(
+  iconTheme: const IconThemeData(color: Colors.black),
+  primaryIconTheme:
+      const IconThemeData(color: Colors.red, opacity: 1.0, size: 50.0),
+  colorScheme: const ColorScheme.light(
     primary: Colors.black,
     primary: Colors.black,
     secondary: Color.fromARGB(255, 163, 163, 163),
     secondary: Color.fromARGB(255, 163, 163, 163),
   ),
   ),
-  accentColor: Color.fromRGBO(0, 0, 0, 0.6),
-  buttonColor: Color.fromRGBO(45, 194, 98, 1.0),
+  accentColor: const Color.fromRGBO(0, 0, 0, 0.6),
+  buttonColor: const Color.fromRGBO(45, 194, 98, 1.0),
   outlinedButtonTheme: buildOutlinedButtonThemeData(
   outlinedButtonTheme: buildOutlinedButtonThemeData(
     bgDisabled: Colors.grey.shade500,
     bgDisabled: Colors.grey.shade500,
     bgEnabled: Colors.black,
     bgEnabled: Colors.black,
@@ -28,27 +29,27 @@ final lightThemeData = ThemeData(
   toggleableActiveColor: Colors.green[400],
   toggleableActiveColor: Colors.green[400],
   scaffoldBackgroundColor: Colors.white,
   scaffoldBackgroundColor: Colors.white,
   backgroundColor: Colors.white,
   backgroundColor: Colors.white,
-  appBarTheme: AppBarTheme().copyWith(
+  appBarTheme: const AppBarTheme().copyWith(
     backgroundColor: Colors.white,
     backgroundColor: Colors.white,
     foregroundColor: Colors.black,
     foregroundColor: Colors.black,
-    iconTheme: IconThemeData(color: Colors.black),
+    iconTheme: const IconThemeData(color: Colors.black),
     elevation: 0,
     elevation: 0,
   ),
   ),
   //https://api.flutter.dev/flutter/material/TextTheme-class.html
   //https://api.flutter.dev/flutter/material/TextTheme-class.html
   textTheme: _buildTextTheme(Colors.black),
   textTheme: _buildTextTheme(Colors.black),
-  primaryTextTheme: TextTheme().copyWith(
-    bodyText2: TextStyle(color: Colors.yellow),
-    bodyText1: TextStyle(color: Colors.orange),
+  primaryTextTheme: const TextTheme().copyWith(
+    bodyText2: const TextStyle(color: Colors.yellow),
+    bodyText1: const TextStyle(color: Colors.orange),
   ),
   ),
-  cardColor: Color.fromRGBO(250, 250, 250, 1.0),
-  dialogTheme: DialogTheme().copyWith(
-    backgroundColor: Color.fromRGBO(250, 250, 250, 1.0), //
-    titleTextStyle: TextStyle(
+  cardColor: const Color.fromRGBO(250, 250, 250, 1.0),
+  dialogTheme: const DialogTheme().copyWith(
+    backgroundColor: const Color.fromRGBO(250, 250, 250, 1.0), //
+    titleTextStyle: const TextStyle(
       color: Colors.black,
       color: Colors.black,
       fontSize: 24,
       fontSize: 24,
       fontWeight: FontWeight.w600,
       fontWeight: FontWeight.w600,
     ),
     ),
-    contentTextStyle: TextStyle(
+    contentTextStyle: const TextStyle(
       fontFamily: 'Inter-Medium',
       fontFamily: 'Inter-Medium',
       color: Colors.black,
       color: Colors.black,
       fontSize: 16,
       fontSize: 16,
@@ -56,15 +57,15 @@ final lightThemeData = ThemeData(
     ),
     ),
     shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
     shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
   ),
   ),
-  inputDecorationTheme: InputDecorationTheme().copyWith(
-    focusedBorder: UnderlineInputBorder(
+  inputDecorationTheme: const InputDecorationTheme().copyWith(
+    focusedBorder: const UnderlineInputBorder(
       borderSide: BorderSide(
       borderSide: BorderSide(
         color: Color.fromRGBO(45, 194, 98, 1.0),
         color: Color.fromRGBO(45, 194, 98, 1.0),
       ),
       ),
     ),
     ),
   ),
   ),
   checkboxTheme: CheckboxThemeData(
   checkboxTheme: CheckboxThemeData(
-    side: BorderSide(
+    side: const BorderSide(
       color: Colors.black,
       color: Colors.black,
       width: 2,
       width: 2,
     ),
     ),
@@ -85,14 +86,15 @@ final darkThemeData = ThemeData(
   fontFamily: 'Inter',
   fontFamily: 'Inter',
   brightness: Brightness.dark,
   brightness: Brightness.dark,
   primaryColorLight: Colors.white70,
   primaryColorLight: Colors.white70,
-  iconTheme: IconThemeData(color: Colors.white),
-  primaryIconTheme: IconThemeData(color: Colors.red, opacity: 1.0, size: 50.0),
+  iconTheme: const IconThemeData(color: Colors.white),
+  primaryIconTheme:
+      const IconThemeData(color: Colors.red, opacity: 1.0, size: 50.0),
   hintColor: Colors.grey,
   hintColor: Colors.grey,
-  colorScheme: ColorScheme.dark(primary: Colors.white),
-  accentColor: Color.fromRGBO(45, 194, 98, 0.2),
-  buttonColor: Color.fromRGBO(45, 194, 98, 1.0),
-  buttonTheme: ButtonThemeData().copyWith(
-    buttonColor: Color.fromRGBO(45, 194, 98, 1.0),
+  colorScheme: const ColorScheme.dark(primary: Colors.white),
+  accentColor: const Color.fromRGBO(45, 194, 98, 0.2),
+  buttonColor: const Color.fromRGBO(45, 194, 98, 1.0),
+  buttonTheme: const ButtonThemeData().copyWith(
+    buttonColor: const Color.fromRGBO(45, 194, 98, 1.0),
   ),
   ),
   textTheme: _buildTextTheme(Colors.white),
   textTheme: _buildTextTheme(Colors.white),
   toggleableActiveColor: Colors.green[400],
   toggleableActiveColor: Colors.green[400],
@@ -108,19 +110,19 @@ final darkThemeData = ThemeData(
   ),
   ),
   scaffoldBackgroundColor: Colors.black,
   scaffoldBackgroundColor: Colors.black,
   backgroundColor: Colors.black,
   backgroundColor: Colors.black,
-  appBarTheme: AppBarTheme().copyWith(
+  appBarTheme: const AppBarTheme().copyWith(
     color: Colors.black,
     color: Colors.black,
     elevation: 0,
     elevation: 0,
   ),
   ),
-  cardColor: Color.fromRGBO(10, 15, 15, 1.0),
-  dialogTheme: DialogTheme().copyWith(
-    backgroundColor: Color.fromRGBO(15, 15, 15, 1.0),
-    titleTextStyle: TextStyle(
+  cardColor: const Color.fromRGBO(10, 15, 15, 1.0),
+  dialogTheme: const DialogTheme().copyWith(
+    backgroundColor: const Color.fromRGBO(15, 15, 15, 1.0),
+    titleTextStyle: const TextStyle(
       color: Colors.white,
       color: Colors.white,
       fontSize: 24,
       fontSize: 24,
       fontWeight: FontWeight.w600,
       fontWeight: FontWeight.w600,
     ),
     ),
-    contentTextStyle: TextStyle(
+    contentTextStyle: const TextStyle(
       fontFamily: 'Inter-Medium',
       fontFamily: 'Inter-Medium',
       color: Colors.white,
       color: Colors.white,
       fontSize: 16,
       fontSize: 16,
@@ -128,15 +130,15 @@ final darkThemeData = ThemeData(
     ),
     ),
     shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
     shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
   ),
   ),
-  inputDecorationTheme: InputDecorationTheme().copyWith(
-    focusedBorder: UnderlineInputBorder(
+  inputDecorationTheme: const InputDecorationTheme().copyWith(
+    focusedBorder: const UnderlineInputBorder(
       borderSide: BorderSide(
       borderSide: BorderSide(
         color: Color.fromRGBO(45, 194, 98, 1.0),
         color: Color.fromRGBO(45, 194, 98, 1.0),
       ),
       ),
     ),
     ),
   ),
   ),
   checkboxTheme: CheckboxThemeData(
   checkboxTheme: CheckboxThemeData(
-    side: BorderSide(
+    side: const BorderSide(
       color: Colors.grey,
       color: Colors.grey,
       width: 2,
       width: 2,
     ),
     ),
@@ -158,7 +160,7 @@ final darkThemeData = ThemeData(
 );
 );
 
 
 TextTheme _buildTextTheme(Color textColor) {
 TextTheme _buildTextTheme(Color textColor) {
-  return TextTheme().copyWith(
+  return const TextTheme().copyWith(
     headline4: TextStyle(
     headline4: TextStyle(
       color: textColor,
       color: textColor,
       fontSize: 32,
       fontSize: 32,
@@ -233,12 +235,12 @@ extension CustomColorScheme on ColorScheme {
       brightness == Brightness.light ? Colors.black : Colors.white;
       brightness == Brightness.light ? Colors.black : Colors.white;
 
 
   Color get boxSelectColor => brightness == Brightness.light
   Color get boxSelectColor => brightness == Brightness.light
-      ? Color.fromRGBO(67, 186, 108, 1)
-      : Color.fromRGBO(16, 32, 32, 1);
+      ? const Color.fromRGBO(67, 186, 108, 1)
+      : const Color.fromRGBO(16, 32, 32, 1);
 
 
   Color get boxUnSelectColor => brightness == Brightness.light
   Color get boxUnSelectColor => brightness == Brightness.light
-      ? Color.fromRGBO(240, 240, 240, 1)
-      : Color.fromRGBO(8, 18, 18, 0.4);
+      ? const Color.fromRGBO(240, 240, 240, 1)
+      : const Color.fromRGBO(8, 18, 18, 0.4);
 
 
   Color get dynamicFABBackgroundColor =>
   Color get dynamicFABBackgroundColor =>
       brightness == Brightness.light ? Colors.black : Colors.grey[850];
       brightness == Brightness.light ? Colors.black : Colors.grey[850];
@@ -247,18 +249,18 @@ extension CustomColorScheme on ColorScheme {
 
 
   // todo: use brightness == Brightness.light for changing color for dark/light theme
   // todo: use brightness == Brightness.light for changing color for dark/light theme
   ButtonStyle get optionalActionButtonStyle => buildElevatedButtonThemeData(
   ButtonStyle get optionalActionButtonStyle => buildElevatedButtonThemeData(
-        onPrimary: Color(0xFF777777),
-        primary: Color(0xFFF0F0F0),
+        onPrimary: const Color(0xFF777777),
+        primary: const Color(0xFFF0F0F0),
         elevation: 0,
         elevation: 0,
       ).style;
       ).style;
 
 
   Color get recoveryKeyBoxColor => brightness == Brightness.light
   Color get recoveryKeyBoxColor => brightness == Brightness.light
-      ? Color.fromRGBO(49, 155, 86, 0.2)
-      : Color(0xFF1DB954);
+      ? const Color.fromRGBO(49, 155, 86, 0.2)
+      : const Color(0xFF1DB954);
 
 
   Color get frostyBlurBackdropFilterColor => brightness == Brightness.light
   Color get frostyBlurBackdropFilterColor => brightness == Brightness.light
-      ? Color.fromRGBO(238, 238, 238, 0.5)
-      : Color.fromRGBO(48, 48, 48, 0.5);
+      ? const Color.fromRGBO(238, 238, 238, 0.5)
+      : const Color.fromRGBO(48, 48, 48, 0.5);
 
 
   Color get iconColor => brightness == Brightness.light
   Color get iconColor => brightness == Brightness.light
       ? Colors.black.withOpacity(0.75)
       ? Colors.black.withOpacity(0.75)
@@ -266,57 +268,57 @@ extension CustomColorScheme on ColorScheme {
 
 
   Color get bgColorForQuestions => brightness == Brightness.light
   Color get bgColorForQuestions => brightness == Brightness.light
       ? Colors.white
       ? Colors.white
-      : Color.fromRGBO(10, 15, 15, 1.0);
+      : const Color.fromRGBO(10, 15, 15, 1.0);
 
 
-  Color get greenText => Color.fromARGB(255, 40, 190, 113);
+  Color get greenText => const Color.fromARGB(255, 40, 190, 113);
 
 
   Color get cupertinoPickerTopColor => brightness == Brightness.light
   Color get cupertinoPickerTopColor => brightness == Brightness.light
-      ? Color.fromARGB(255, 238, 238, 238)
+      ? const Color.fromARGB(255, 238, 238, 238)
       : Colors.white.withOpacity(0.1);
       : Colors.white.withOpacity(0.1);
 
 
   DatePickerTheme get dateTimePickertheme => brightness == Brightness.light
   DatePickerTheme get dateTimePickertheme => brightness == Brightness.light
-      ? DatePickerTheme(
+      ? const DatePickerTheme(
           backgroundColor: Colors.white,
           backgroundColor: Colors.white,
           itemStyle: TextStyle(color: Colors.black),
           itemStyle: TextStyle(color: Colors.black),
           cancelStyle: TextStyle(color: Colors.black),
           cancelStyle: TextStyle(color: Colors.black),
         )
         )
-      : DatePickerTheme(
+      : const DatePickerTheme(
           backgroundColor: Colors.black,
           backgroundColor: Colors.black,
           itemStyle: TextStyle(color: Colors.white),
           itemStyle: TextStyle(color: Colors.white),
           cancelStyle: TextStyle(color: Colors.white),
           cancelStyle: TextStyle(color: Colors.white),
         );
         );
 
 
   Color get stepProgressUnselectedColor => brightness == Brightness.light
   Color get stepProgressUnselectedColor => brightness == Brightness.light
-      ? Color.fromRGBO(196, 196, 196, 0.6)
-      : Color.fromRGBO(255, 255, 255, 0.7);
+      ? const Color.fromRGBO(196, 196, 196, 0.6)
+      : const Color.fromRGBO(255, 255, 255, 0.7);
 
 
   Color get gNavBackgroundColor => brightness == Brightness.light
   Color get gNavBackgroundColor => brightness == Brightness.light
-      ? Color.fromRGBO(196, 196, 196, 0.6)
-      : Color.fromRGBO(40, 40, 40, 0.6);
+      ? const Color.fromRGBO(196, 196, 196, 0.6)
+      : const Color.fromRGBO(40, 40, 40, 0.6);
 
 
   Color get gNavBarActiveColor => brightness == Brightness.light
   Color get gNavBarActiveColor => brightness == Brightness.light
-      ? Color.fromRGBO(255, 255, 255, 0.6)
-      : Color.fromRGBO(255, 255, 255, 0.9);
+      ? const Color.fromRGBO(255, 255, 255, 0.6)
+      : const Color.fromRGBO(255, 255, 255, 0.9);
 
 
   Color get gNavIconColor => brightness == Brightness.light
   Color get gNavIconColor => brightness == Brightness.light
-      ? Color.fromRGBO(0, 0, 0, 0.8)
-      : Color.fromRGBO(255, 255, 255, 0.8);
+      ? const Color.fromRGBO(0, 0, 0, 0.8)
+      : const Color.fromRGBO(255, 255, 255, 0.8);
 
 
   Color get gNavActiveIconColor => brightness == Brightness.light
   Color get gNavActiveIconColor => brightness == Brightness.light
-      ? Color.fromRGBO(0, 0, 0, 0.8)
-      : Color.fromRGBO(0, 0, 0, 0.8);
+      ? const Color.fromRGBO(0, 0, 0, 0.8)
+      : const Color.fromRGBO(0, 0, 0, 0.8);
 
 
   Color get galleryThumbBackgroundColor => brightness == Brightness.light
   Color get galleryThumbBackgroundColor => brightness == Brightness.light
-      ? Color.fromRGBO(240, 240, 240, 1)
-      : Color.fromRGBO(20, 20, 20, 1);
+      ? const Color.fromRGBO(240, 240, 240, 1)
+      : const Color.fromRGBO(20, 20, 20, 1);
 
 
   Color get galleryThumbDrawColor => brightness == Brightness.light
   Color get galleryThumbDrawColor => brightness == Brightness.light
       ? Colors.black.withOpacity(0.8)
       ? Colors.black.withOpacity(0.8)
       : Colors.white.withOpacity(0.5);
       : Colors.white.withOpacity(0.5);
 
 
   Color get backupEnabledBgColor => brightness == Brightness.light
   Color get backupEnabledBgColor => brightness == Brightness.light
-      ? Color.fromRGBO(230, 230, 230, 0.95)
-      : Color.fromRGBO(10, 40, 40, 0.3);
+      ? const Color.fromRGBO(230, 230, 230, 0.95)
+      : const Color.fromRGBO(10, 40, 40, 0.3);
 
 
   Color get dotsIndicatorActiveColor => brightness == Brightness.light
   Color get dotsIndicatorActiveColor => brightness == Brightness.light
       ? Colors.black.withOpacity(0.5)
       ? Colors.black.withOpacity(0.5)
@@ -330,12 +332,12 @@ extension CustomColorScheme on ColorScheme {
       brightness == Brightness.light ? Colors.white : Colors.black;
       brightness == Brightness.light ? Colors.white : Colors.black;
 
 
   Color get toastBackgroundColor => brightness == Brightness.light
   Color get toastBackgroundColor => brightness == Brightness.light
-      ? Color.fromRGBO(24, 24, 24, 0.95)
-      : Color.fromRGBO(255, 255, 255, 0.95);
+      ? const Color.fromRGBO(24, 24, 24, 0.95)
+      : const Color.fromRGBO(255, 255, 255, 0.95);
 
 
   Color get subTextColor => brightness == Brightness.light
   Color get subTextColor => brightness == Brightness.light
-      ? Color.fromRGBO(180, 180, 180, 1)
-      : Color.fromRGBO(100, 100, 100, 1);
+      ? const Color.fromRGBO(180, 180, 180, 1)
+      : const Color.fromRGBO(100, 100, 100, 1);
 
 
   Color get themeSwitchIndicatorColor => brightness == Brightness.light
   Color get themeSwitchIndicatorColor => brightness == Brightness.light
       ? Colors.black.withOpacity(0.75)
       ? Colors.black.withOpacity(0.75)
@@ -361,8 +363,8 @@ OutlinedButtonThemeData buildOutlinedButtonThemeData({
         borderRadius: BorderRadius.circular(8),
         borderRadius: BorderRadius.circular(8),
       ),
       ),
       alignment: Alignment.center,
       alignment: Alignment.center,
-      padding: EdgeInsets.fromLTRB(50, 16, 50, 16),
-      textStyle: TextStyle(
+      padding: const EdgeInsets.fromLTRB(50, 16, 50, 16),
+      textStyle: const TextStyle(
         fontWeight: FontWeight.w600,
         fontWeight: FontWeight.w600,
         fontFamily: 'Inter-SemiBold',
         fontFamily: 'Inter-SemiBold',
         fontSize: 18,
         fontSize: 18,
@@ -400,12 +402,12 @@ ElevatedButtonThemeData buildElevatedButtonThemeData({
       onPrimary: onPrimary,
       onPrimary: onPrimary,
       primary: primary,
       primary: primary,
       alignment: Alignment.center,
       alignment: Alignment.center,
-      textStyle: TextStyle(
+      textStyle: const TextStyle(
         fontWeight: FontWeight.w600,
         fontWeight: FontWeight.w600,
         fontFamily: 'Inter-SemiBold',
         fontFamily: 'Inter-SemiBold',
         fontSize: 18,
         fontSize: 18,
       ),
       ),
-      padding: EdgeInsets.symmetric(vertical: 18),
+      padding: const EdgeInsets.symmetric(vertical: 18),
       shape: const RoundedRectangleBorder(
       shape: const RoundedRectangleBorder(
         borderRadius: BorderRadius.all(Radius.circular(8)),
         borderRadius: BorderRadius.all(Radius.circular(8)),
       ),
       ),

+ 1 - 1
lib/main.dart

@@ -87,7 +87,7 @@ Future<void> _runBackgroundTask(String taskId) async {
 }
 }
 
 
 Future<void> _runInBackground(String taskId) async {
 Future<void> _runInBackground(String taskId) async {
-  await Future.delayed(Duration(seconds: 3));
+  await Future.delayed(const Duration(seconds: 3));
   if (await _isRunningInForeground()) {
   if (await _isRunningInForeground()) {
     _logger.info("FG task running, skipping BG taskID: $taskId");
     _logger.info("FG task running, skipping BG taskID: $taskId");
     BackgroundFetch.finish(taskId);
     BackgroundFetch.finish(taskId);

+ 2 - 2
lib/services/collections_service.dart

@@ -29,8 +29,8 @@ import 'package:photos/utils/file_download_util.dart';
 import 'package:shared_preferences/shared_preferences.dart';
 import 'package:shared_preferences/shared_preferences.dart';
 
 
 class CollectionsService {
 class CollectionsService {
-  static final _collectionSyncTimeKeyPrefix = "collection_sync_time_";
-  static final _collectionsSyncTimeKey = "collections_sync_time_x";
+  static const _collectionSyncTimeKeyPrefix = "collection_sync_time_";
+  static const _collectionsSyncTimeKey = "collections_sync_time_x";
 
 
   static const int kMaximumWriteAttempts = 5;
   static const int kMaximumWriteAttempts = 5;
 
 

+ 1 - 1
lib/services/file_migration_service.dart

@@ -68,7 +68,7 @@ class FileMigrationService {
       await _importLocalFilesForMigration();
       await _importLocalFilesForMigration();
       final sTime = DateTime.now().microsecondsSinceEpoch;
       final sTime = DateTime.now().microsecondsSinceEpoch;
       bool hasData = true;
       bool hasData = true;
-      final int limitInBatch = 100;
+      const int limitInBatch = 100;
       while (hasData) {
       while (hasData) {
         var localIDsToProcess = await _filesMigrationDB
         var localIDsToProcess = await _filesMigrationDB
             .getLocalIDsForPotentialReUpload(limitInBatch);
             .getLocalIDsForPotentialReUpload(limitInBatch);

+ 8 - 7
lib/services/memories_service.dart

@@ -11,10 +11,10 @@ class MemoriesService extends ChangeNotifier {
   final _logger = Logger("MemoryService");
   final _logger = Logger("MemoryService");
   final _memoriesDB = MemoriesDB.instance;
   final _memoriesDB = MemoriesDB.instance;
   final _filesDB = FilesDB.instance;
   final _filesDB = FilesDB.instance;
-  static final daysInAYear = 365;
-  static final yearsBefore = 30;
-  static final daysBefore = 7;
-  static final daysAfter = 1;
+  static const daysInAYear = 365;
+  static const yearsBefore = 30;
+  static const daysBefore = 7;
+  static const daysAfter = 1;
 
 
   List<Memory> _cachedMemories;
   List<Memory> _cachedMemories;
   Future<List<Memory>> _future;
   Future<List<Memory>> _future;
@@ -65,10 +65,11 @@ class MemoriesService extends ChangeNotifier {
     final List<List<int>> durations = [];
     final List<List<int>> durations = [];
     for (var yearAgo = 1; yearAgo <= yearsBefore; yearAgo++) {
     for (var yearAgo = 1; yearAgo <= yearsBefore; yearAgo++) {
       final date = _getDate(present, yearAgo);
       final date = _getDate(present, yearAgo);
-      final startCreationTime =
-          date.subtract(Duration(days: daysBefore)).microsecondsSinceEpoch;
+      final startCreationTime = date
+          .subtract(const Duration(days: daysBefore))
+          .microsecondsSinceEpoch;
       final endCreationTime =
       final endCreationTime =
-          date.add(Duration(days: daysAfter)).microsecondsSinceEpoch;
+          date.add(const Duration(days: daysAfter)).microsecondsSinceEpoch;
       durations.add([startCreationTime, endCreationTime]);
       durations.add([startCreationTime, endCreationTime]);
     }
     }
     final archivedCollectionIds =
     final archivedCollectionIds =

+ 1 - 1
lib/services/notification_service.dart

@@ -16,7 +16,7 @@ class NotificationService {
     }
     }
     const AndroidInitializationSettings initializationSettingsAndroid =
     const AndroidInitializationSettings initializationSettingsAndroid =
         AndroidInitializationSettings('notification_icon');
         AndroidInitializationSettings('notification_icon');
-    final InitializationSettings initializationSettings =
+    const InitializationSettings initializationSettings =
         InitializationSettings(
         InitializationSettings(
       android: initializationSettingsAndroid,
       android: initializationSettingsAndroid,
     );
     );

+ 4 - 4
lib/ui/account/change_email_dialog.dart

@@ -16,14 +16,14 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return AlertDialog(
     return AlertDialog(
-      title: Text("Enter your email address"),
+      title: const Text("Enter your email address"),
       content: SingleChildScrollView(
       content: SingleChildScrollView(
         child: Column(
         child: Column(
           mainAxisAlignment: MainAxisAlignment.start,
           mainAxisAlignment: MainAxisAlignment.start,
           crossAxisAlignment: CrossAxisAlignment.start,
           crossAxisAlignment: CrossAxisAlignment.start,
           children: [
           children: [
             TextFormField(
             TextFormField(
-              decoration: InputDecoration(
+              decoration: const InputDecoration(
                 hintText: 'Email',
                 hintText: 'Email',
                 hintStyle: TextStyle(
                 hintStyle: TextStyle(
                   color: Colors.white30,
                   color: Colors.white30,
@@ -45,7 +45,7 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
       ),
       ),
       actions: [
       actions: [
         TextButton(
         TextButton(
-          child: Text(
+          child: const Text(
             "Cancel",
             "Cancel",
             style: TextStyle(
             style: TextStyle(
               color: Colors.redAccent,
               color: Colors.redAccent,
@@ -56,7 +56,7 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
           },
           },
         ),
         ),
         TextButton(
         TextButton(
-          child: Text(
+          child: const Text(
             "Verify",
             "Verify",
             style: TextStyle(
             style: TextStyle(
               color: Colors.green,
               color: Colors.green,

+ 35 - 26
lib/ui/account/email_entry_page.dart

@@ -30,7 +30,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
   final _config = Configuration.instance;
   final _config = Configuration.instance;
   final _passwordController1 = TextEditingController();
   final _passwordController1 = TextEditingController();
   final _passwordController2 = TextEditingController();
   final _passwordController2 = TextEditingController();
-  final Color _validFieldValueColor = Color.fromRGBO(45, 194, 98, 0.2);
+  final Color _validFieldValueColor = const Color.fromRGBO(45, 194, 98, 0.2);
 
 
   String _email;
   String _email;
   String _password;
   String _password;
@@ -80,7 +80,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
     final appBar = AppBar(
     final appBar = AppBar(
       elevation: 0,
       elevation: 0,
       leading: IconButton(
       leading: IconButton(
-        icon: Icon(Icons.arrow_back),
+        icon: const Icon(Icons.arrow_back),
         color: Theme.of(context).iconTheme.color,
         color: Theme.of(context).iconTheme.color,
         onPressed: () {
         onPressed: () {
           Navigator.of(context).pop();
           Navigator.of(context).pop();
@@ -92,7 +92,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
           totalSteps: 4,
           totalSteps: 4,
           currentStep: 1,
           currentStep: 1,
           selectedColor: Theme.of(context).buttonColor,
           selectedColor: Theme.of(context).buttonColor,
-          roundedEdges: Radius.circular(10),
+          roundedEdges: const Radius.circular(10),
           unselectedColor:
           unselectedColor:
               Theme.of(context).colorScheme.stepProgressUnselectedColor,
               Theme.of(context).colorScheme.stepProgressUnselectedColor,
         ),
         ),
@@ -152,8 +152,10 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                       fillColor: _emailIsValid ? _validFieldValueColor : null,
                       fillColor: _emailIsValid ? _validFieldValueColor : null,
                       filled: true,
                       filled: true,
                       hintText: 'Email',
                       hintText: 'Email',
-                      contentPadding:
-                          EdgeInsets.symmetric(horizontal: 16, vertical: 14),
+                      contentPadding: const EdgeInsets.symmetric(
+                        horizontal: 16,
+                        vertical: 14,
+                      ),
                       border: UnderlineInputBorder(
                       border: UnderlineInputBorder(
                         borderSide: BorderSide.none,
                         borderSide: BorderSide.none,
                         borderRadius: BorderRadius.circular(6),
                         borderRadius: BorderRadius.circular(6),
@@ -184,7 +186,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                     textInputAction: TextInputAction.next,
                     textInputAction: TextInputAction.next,
                   ),
                   ),
                 ),
                 ),
-                Padding(padding: EdgeInsets.all(4)),
+                const Padding(padding: EdgeInsets.all(4)),
                 Padding(
                 Padding(
                   padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
                   padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
                   child: TextFormField(
                   child: TextFormField(
@@ -198,8 +200,10 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                           _passwordIsValid ? _validFieldValueColor : null,
                           _passwordIsValid ? _validFieldValueColor : null,
                       filled: true,
                       filled: true,
                       hintText: "Password",
                       hintText: "Password",
-                      contentPadding:
-                          EdgeInsets.symmetric(horizontal: 16, vertical: 14),
+                      contentPadding: const EdgeInsets.symmetric(
+                        horizontal: 16,
+                        vertical: 14,
+                      ),
                       suffixIcon: _password1InFocus
                       suffixIcon: _password1InFocus
                           ? IconButton(
                           ? IconButton(
                               icon: Icon(
                               icon: Icon(
@@ -263,8 +267,10 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                       fillColor: _passwordsMatch ? _validFieldValueColor : null,
                       fillColor: _passwordsMatch ? _validFieldValueColor : null,
                       filled: true,
                       filled: true,
                       hintText: "Confirm password",
                       hintText: "Confirm password",
-                      contentPadding:
-                          EdgeInsets.symmetric(horizontal: 16, vertical: 14),
+                      contentPadding: const EdgeInsets.symmetric(
+                        horizontal: 16,
+                        vertical: 14,
+                      ),
                       suffixIcon: _password2InFocus
                       suffixIcon: _password2InFocus
                           ? IconButton(
                           ? IconButton(
                               icon: Icon(
                               icon: Icon(
@@ -369,12 +375,12 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
             child: RichText(
             child: RichText(
               text: TextSpan(
               text: TextSpan(
                 children: [
                 children: [
-                  TextSpan(
+                  const TextSpan(
                     text: "I agree to the ",
                     text: "I agree to the ",
                   ),
                   ),
                   TextSpan(
                   TextSpan(
                     text: "terms of service",
                     text: "terms of service",
-                    style: TextStyle(
+                    style: const TextStyle(
                       decoration: TextDecoration.underline,
                       decoration: TextDecoration.underline,
                     ),
                     ),
                     recognizer: TapGestureRecognizer()
                     recognizer: TapGestureRecognizer()
@@ -382,16 +388,19 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                         Navigator.of(context).push(
                         Navigator.of(context).push(
                           MaterialPageRoute(
                           MaterialPageRoute(
                             builder: (BuildContext context) {
                             builder: (BuildContext context) {
-                              return WebPage("Terms", "https://ente.io/terms");
+                              return const WebPage(
+                                "Terms",
+                                "https://ente.io/terms",
+                              );
                             },
                             },
                           ),
                           ),
                         );
                         );
                       },
                       },
                   ),
                   ),
-                  TextSpan(text: " and "),
+                  const TextSpan(text: " and "),
                   TextSpan(
                   TextSpan(
                     text: "privacy policy",
                     text: "privacy policy",
-                    style: TextStyle(
+                    style: const TextStyle(
                       decoration: TextDecoration.underline,
                       decoration: TextDecoration.underline,
                     ),
                     ),
                     recognizer: TapGestureRecognizer()
                     recognizer: TapGestureRecognizer()
@@ -399,7 +408,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                         Navigator.of(context).push(
                         Navigator.of(context).push(
                           MaterialPageRoute(
                           MaterialPageRoute(
                             builder: (BuildContext context) {
                             builder: (BuildContext context) {
-                              return WebPage(
+                              return const WebPage(
                                 "Privacy",
                                 "Privacy",
                                 "https://ente.io/privacy",
                                 "https://ente.io/privacy",
                               );
                               );
@@ -445,13 +454,13 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
             child: RichText(
             child: RichText(
               text: TextSpan(
               text: TextSpan(
                 children: [
                 children: [
-                  TextSpan(
+                  const TextSpan(
                     text:
                     text:
                         "I understand that if I lose my password, I may lose my data since my data is ",
                         "I understand that if I lose my password, I may lose my data since my data is ",
                   ),
                   ),
                   TextSpan(
                   TextSpan(
                     text: "end-to-end encrypted",
                     text: "end-to-end encrypted",
-                    style: TextStyle(
+                    style: const TextStyle(
                       decoration: TextDecoration.underline,
                       decoration: TextDecoration.underline,
                     ),
                     ),
                     recognizer: TapGestureRecognizer()
                     recognizer: TapGestureRecognizer()
@@ -459,7 +468,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                         Navigator.of(context).push(
                         Navigator.of(context).push(
                           MaterialPageRoute(
                           MaterialPageRoute(
                             builder: (BuildContext context) {
                             builder: (BuildContext context) {
-                              return WebPage(
+                              return const WebPage(
                                 "Encryption",
                                 "Encryption",
                                 "https://ente.io/architecture",
                                 "https://ente.io/architecture",
                               );
                               );
@@ -468,7 +477,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                         );
                         );
                       },
                       },
                   ),
                   ),
-                  TextSpan(text: " with ente"),
+                  const TextSpan(text: " with ente"),
                 ],
                 ],
                 style: Theme.of(context)
                 style: Theme.of(context)
                     .textTheme
                     .textTheme
@@ -505,7 +514,7 @@ class PricingWidget extends StatelessWidget {
         if (snapshot.hasData) {
         if (snapshot.hasData) {
           return _buildPlans(context, snapshot.data);
           return _buildPlans(context, snapshot.data);
         } else if (snapshot.hasError) {
         } else if (snapshot.hasError) {
-          return Text("Oops, Something went wrong.");
+          return const Text("Oops, Something went wrong.");
         }
         }
         return const EnteLoadingWidget();
         return const EnteLoadingWidget();
       },
       },
@@ -527,7 +536,7 @@ class PricingWidget extends StatelessWidget {
       child: Column(
       child: Column(
         mainAxisAlignment: MainAxisAlignment.spaceEvenly,
         mainAxisAlignment: MainAxisAlignment.spaceEvenly,
         children: <Widget>[
         children: <Widget>[
-          Text(
+          const Text(
             "Pricing",
             "Pricing",
             style: TextStyle(
             style: TextStyle(
               fontWeight: FontWeight.bold,
               fontWeight: FontWeight.bold,
@@ -594,23 +603,23 @@ class BillingPlanWidget extends StatelessWidget {
         ),
         ),
         color: Colors.black.withOpacity(0.2),
         color: Colors.black.withOpacity(0.2),
         child: Container(
         child: Container(
-          padding: EdgeInsets.fromLTRB(12, 20, 12, 20),
+          padding: const EdgeInsets.fromLTRB(12, 20, 12, 20),
           child: Column(
           child: Column(
             children: [
             children: [
               Text(
               Text(
                 convertBytesToGBs(plan.storage, precision: 0).toString() +
                 convertBytesToGBs(plan.storage, precision: 0).toString() +
                     " GB",
                     " GB",
-                style: TextStyle(
+                style: const TextStyle(
                   fontWeight: FontWeight.bold,
                   fontWeight: FontWeight.bold,
                   fontSize: 16,
                   fontSize: 16,
                 ),
                 ),
               ),
               ),
-              Padding(
+              const Padding(
                 padding: EdgeInsets.all(4),
                 padding: EdgeInsets.all(4),
               ),
               ),
               Text(
               Text(
                 plan.price + " / " + plan.period,
                 plan.price + " / " + plan.period,
-                style: TextStyle(
+                style: const TextStyle(
                   fontSize: 12,
                   fontSize: 12,
                   color: Colors.white70,
                   color: Colors.white70,
                 ),
                 ),

+ 15 - 13
lib/ui/account/login_page.dart

@@ -42,7 +42,7 @@ class _LoginPageState extends State<LoginPage> {
       appBar: AppBar(
       appBar: AppBar(
         elevation: 0,
         elevation: 0,
         leading: IconButton(
         leading: IconButton(
-          icon: Icon(Icons.arrow_back),
+          icon: const Icon(Icons.arrow_back),
           color: Theme.of(context).iconTheme.color,
           color: Theme.of(context).iconTheme.color,
           onPressed: () {
           onPressed: () {
             Navigator.of(context).pop();
             Navigator.of(context).pop();
@@ -88,8 +88,10 @@ class _LoginPageState extends State<LoginPage> {
                     fillColor: _emailInputFieldColor,
                     fillColor: _emailInputFieldColor,
                     filled: true,
                     filled: true,
                     hintText: 'Email',
                     hintText: 'Email',
-                    contentPadding:
-                        EdgeInsets.symmetric(horizontal: 15, vertical: 15),
+                    contentPadding: const EdgeInsets.symmetric(
+                      horizontal: 15,
+                      vertical: 15,
+                    ),
                     border: UnderlineInputBorder(
                     border: UnderlineInputBorder(
                       borderSide: BorderSide.none,
                       borderSide: BorderSide.none,
                       borderRadius: BorderRadius.circular(6),
                       borderRadius: BorderRadius.circular(6),
@@ -112,7 +114,7 @@ class _LoginPageState extends State<LoginPage> {
                       _emailIsValid = EmailValidator.validate(_email);
                       _emailIsValid = EmailValidator.validate(_email);
                       if (_emailIsValid) {
                       if (_emailIsValid) {
                         _emailInputFieldColor =
                         _emailInputFieldColor =
-                            Color.fromRGBO(45, 194, 98, 0.2);
+                            const Color.fromRGBO(45, 194, 98, 0.2);
                       } else {
                       } else {
                         _emailInputFieldColor = null;
                         _emailInputFieldColor = null;
                       }
                       }
@@ -124,8 +126,8 @@ class _LoginPageState extends State<LoginPage> {
                   autofocus: true,
                   autofocus: true,
                 ),
                 ),
               ),
               ),
-              Padding(
-                padding: const EdgeInsets.symmetric(vertical: 18),
+              const Padding(
+                padding: EdgeInsets.symmetric(vertical: 18),
                 child: Divider(
                 child: Divider(
                   thickness: 1,
                   thickness: 1,
                 ),
                 ),
@@ -143,12 +145,12 @@ class _LoginPageState extends State<LoginPage> {
                               .subtitle1
                               .subtitle1
                               .copyWith(fontSize: 12),
                               .copyWith(fontSize: 12),
                           children: [
                           children: [
-                            TextSpan(
+                            const TextSpan(
                               text: "By clicking log in, I agree to the ",
                               text: "By clicking log in, I agree to the ",
                             ),
                             ),
                             TextSpan(
                             TextSpan(
                               text: "terms of service",
                               text: "terms of service",
-                              style: TextStyle(
+                              style: const TextStyle(
                                 decoration: TextDecoration.underline,
                                 decoration: TextDecoration.underline,
                               ),
                               ),
                               recognizer: TapGestureRecognizer()
                               recognizer: TapGestureRecognizer()
@@ -156,7 +158,7 @@ class _LoginPageState extends State<LoginPage> {
                                   Navigator.of(context).push(
                                   Navigator.of(context).push(
                                     MaterialPageRoute(
                                     MaterialPageRoute(
                                       builder: (BuildContext context) {
                                       builder: (BuildContext context) {
-                                        return WebPage(
+                                        return const WebPage(
                                           "terms",
                                           "terms",
                                           "https://ente.io/terms",
                                           "https://ente.io/terms",
                                         );
                                         );
@@ -165,10 +167,10 @@ class _LoginPageState extends State<LoginPage> {
                                   );
                                   );
                                 },
                                 },
                             ),
                             ),
-                            TextSpan(text: " and "),
+                            const TextSpan(text: " and "),
                             TextSpan(
                             TextSpan(
                               text: "privacy policy",
                               text: "privacy policy",
-                              style: TextStyle(
+                              style: const TextStyle(
                                 decoration: TextDecoration.underline,
                                 decoration: TextDecoration.underline,
                               ),
                               ),
                               recognizer: TapGestureRecognizer()
                               recognizer: TapGestureRecognizer()
@@ -176,7 +178,7 @@ class _LoginPageState extends State<LoginPage> {
                                   Navigator.of(context).push(
                                   Navigator.of(context).push(
                                     MaterialPageRoute(
                                     MaterialPageRoute(
                                       builder: (BuildContext context) {
                                       builder: (BuildContext context) {
-                                        return WebPage(
+                                        return const WebPage(
                                           "privacy",
                                           "privacy",
                                           "https://ente.io/privacy",
                                           "https://ente.io/privacy",
                                         );
                                         );
@@ -200,7 +202,7 @@ class _LoginPageState extends State<LoginPage> {
             ],
             ],
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(8)),
+        const Padding(padding: EdgeInsets.all(8)),
       ],
       ],
     );
     );
   }
   }

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

@@ -40,7 +40,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
       appBar: AppBar(
       appBar: AppBar(
         elevation: 0,
         elevation: 0,
         leading: IconButton(
         leading: IconButton(
-          icon: Icon(Icons.arrow_back),
+          icon: const Icon(Icons.arrow_back),
           color: Theme.of(context).iconTheme.color,
           color: Theme.of(context).iconTheme.color,
           onPressed: () {
           onPressed: () {
             Navigator.of(context).pop();
             Navigator.of(context).pop();
@@ -53,7 +53,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                   totalSteps: 4,
                   totalSteps: 4,
                   currentStep: 2,
                   currentStep: 2,
                   selectedColor: Theme.of(context).buttonColor,
                   selectedColor: Theme.of(context).buttonColor,
-                  roundedEdges: Radius.circular(10),
+                  roundedEdges: const Radius.circular(10),
                   unselectedColor:
                   unselectedColor:
                       Theme.of(context).colorScheme.stepProgressUnselectedColor,
                       Theme.of(context).colorScheme.stepProgressUnselectedColor,
                 ),
                 ),
@@ -115,7 +115,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                                   .subtitle1
                                   .subtitle1
                                   .copyWith(fontSize: 14),
                                   .copyWith(fontSize: 14),
                               children: [
                               children: [
-                                TextSpan(text: "We've sent a mail to "),
+                                const TextSpan(text: "We've sent a mail to "),
                                 TextSpan(
                                 TextSpan(
                                   text: widget.email,
                                   text: widget.email,
                                   style: TextStyle(
                                   style: TextStyle(
@@ -150,7 +150,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                 decoration: InputDecoration(
                 decoration: InputDecoration(
                   filled: true,
                   filled: true,
                   hintText: 'Tap to enter code',
                   hintText: 'Tap to enter code',
-                  contentPadding: EdgeInsets.all(15),
+                  contentPadding: const EdgeInsets.all(15),
                   border: UnderlineInputBorder(
                   border: UnderlineInputBorder(
                     borderSide: BorderSide.none,
                     borderSide: BorderSide.none,
                     borderRadius: BorderRadius.circular(6),
                     borderRadius: BorderRadius.circular(6),
@@ -165,7 +165,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                 },
                 },
               ),
               ),
             ),
             ),
-            Divider(
+            const Divider(
               thickness: 1,
               thickness: 1,
             ),
             ),
             Padding(
             Padding(

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

@@ -38,7 +38,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
   final _logger = Logger((_PasswordEntryPageState).toString());
   final _logger = Logger((_PasswordEntryPageState).toString());
   final _passwordController1 = TextEditingController(),
   final _passwordController1 = TextEditingController(),
       _passwordController2 = TextEditingController();
       _passwordController2 = TextEditingController();
-  final Color _validFieldValueColor = Color.fromRGBO(45, 194, 98, 0.2);
+  final Color _validFieldValueColor = const Color.fromRGBO(45, 194, 98, 0.2);
   String _volatilePassword;
   String _volatilePassword;
   String _passwordInInputBox = '';
   String _passwordInInputBox = '';
   String _passwordInInputConfirmationBox = '';
   String _passwordInInputConfirmationBox = '';
@@ -101,7 +101,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
         leading: widget.mode == PasswordEntryMode.reset
         leading: widget.mode == PasswordEntryMode.reset
             ? Container()
             ? Container()
             : IconButton(
             : IconButton(
-                icon: Icon(Icons.arrow_back),
+                icon: const Icon(Icons.arrow_back),
                 color: Theme.of(context).iconTheme.color,
                 color: Theme.of(context).iconTheme.color,
                 onPressed: () {
                 onPressed: () {
                   Navigator.of(context).pop();
                   Navigator.of(context).pop();
@@ -169,7 +169,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                         .copyWith(fontSize: 14),
                         .copyWith(fontSize: 14),
                   ),
                   ),
                 ),
                 ),
-                Padding(padding: EdgeInsets.all(8)),
+                const Padding(padding: EdgeInsets.all(8)),
                 Padding(
                 Padding(
                   padding: const EdgeInsets.symmetric(horizontal: 20),
                   padding: const EdgeInsets.symmetric(horizontal: 20),
                   child: RichText(
                   child: RichText(
@@ -179,7 +179,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                           .subtitle1
                           .subtitle1
                           .copyWith(fontSize: 14),
                           .copyWith(fontSize: 14),
                       children: [
                       children: [
-                        TextSpan(
+                        const TextSpan(
                           text:
                           text:
                               "We don't store this password, so if you forget, ",
                               "We don't store this password, so if you forget, ",
                         ),
                         ),
@@ -194,7 +194,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                     ),
                     ),
                   ),
                   ),
                 ),
                 ),
-                Padding(padding: EdgeInsets.all(12)),
+                const Padding(padding: EdgeInsets.all(12)),
                 Visibility(
                 Visibility(
                   // hidden textForm for suggesting auto-fill service for saving
                   // hidden textForm for suggesting auto-fill service for saving
                   // password
                   // password
@@ -218,7 +218,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                           _isPasswordValid ? _validFieldValueColor : null,
                           _isPasswordValid ? _validFieldValueColor : null,
                       filled: true,
                       filled: true,
                       hintText: "Password",
                       hintText: "Password",
-                      contentPadding: EdgeInsets.all(20),
+                      contentPadding: const EdgeInsets.all(20),
                       border: UnderlineInputBorder(
                       border: UnderlineInputBorder(
                         borderSide: BorderSide.none,
                         borderSide: BorderSide.none,
                         borderRadius: BorderRadius.circular(6),
                         borderRadius: BorderRadius.circular(6),
@@ -281,7 +281,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                       fillColor: _passwordsMatch ? _validFieldValueColor : null,
                       fillColor: _passwordsMatch ? _validFieldValueColor : null,
                       filled: true,
                       filled: true,
                       hintText: "Confirm password",
                       hintText: "Confirm password",
-                      contentPadding: EdgeInsets.symmetric(
+                      contentPadding: const EdgeInsets.symmetric(
                         horizontal: 20,
                         horizontal: 20,
                         vertical: 20,
                         vertical: 20,
                       ),
                       ),
@@ -349,7 +349,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                     Navigator.of(context).push(
                     Navigator.of(context).push(
                       MaterialPageRoute(
                       MaterialPageRoute(
                         builder: (BuildContext context) {
                         builder: (BuildContext context) {
-                          return WebPage(
+                          return const WebPage(
                             "How it works",
                             "How it works",
                             "https://ente.io/architecture",
                             "https://ente.io/architecture",
                           );
                           );
@@ -358,7 +358,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                     );
                     );
                   },
                   },
                   child: Container(
                   child: Container(
-                    padding: EdgeInsets.symmetric(horizontal: 20),
+                    padding: const EdgeInsets.symmetric(horizontal: 20),
                     child: RichText(
                     child: RichText(
                       text: TextSpan(
                       text: TextSpan(
                         text: "How it works",
                         text: "How it works",
@@ -370,7 +370,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                     ),
                     ),
                   ),
                   ),
                 ),
                 ),
-                Padding(padding: EdgeInsets.all(20)),
+                const Padding(padding: EdgeInsets.all(20)),
               ],
               ],
             ),
             ),
           ),
           ),

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

@@ -48,7 +48,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
       appBar: AppBar(
       appBar: AppBar(
         elevation: 0,
         elevation: 0,
         leading: IconButton(
         leading: IconButton(
-          icon: Icon(Icons.arrow_back),
+          icon: const Icon(Icons.arrow_back),
           color: Theme.of(context).iconTheme.color,
           color: Theme.of(context).iconTheme.color,
           onPressed: () {
           onPressed: () {
             Navigator.of(context).pop();
             Navigator.of(context).pop();
@@ -80,7 +80,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
           Navigator.of(context).pushAndRemoveUntil(
           Navigator.of(context).pushAndRemoveUntil(
             MaterialPageRoute(
             MaterialPageRoute(
               builder: (BuildContext context) {
               builder: (BuildContext context) {
-                return HomeWidget();
+                return const HomeWidget();
               },
               },
             ),
             ),
             (route) => false,
             (route) => false,
@@ -113,7 +113,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
                   decoration: InputDecoration(
                   decoration: InputDecoration(
                     hintText: "Enter your password",
                     hintText: "Enter your password",
                     filled: true,
                     filled: true,
-                    contentPadding: EdgeInsets.all(20),
+                    contentPadding: const EdgeInsets.all(20),
                     border: UnderlineInputBorder(
                     border: UnderlineInputBorder(
                       borderSide: BorderSide.none,
                       borderSide: BorderSide.none,
                       borderRadius: BorderRadius.circular(6),
                       borderRadius: BorderRadius.circular(6),
@@ -135,7 +135,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
                           )
                           )
                         : null,
                         : null,
                   ),
                   ),
-                  style: TextStyle(
+                  style: const TextStyle(
                     fontSize: 14,
                     fontSize: 14,
                   ),
                   ),
                   controller: _passwordController,
                   controller: _passwordController,
@@ -149,8 +149,8 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
                   },
                   },
                 ),
                 ),
               ),
               ),
-              Padding(
-                padding: const EdgeInsets.symmetric(vertical: 18),
+              const Padding(
+                padding: EdgeInsets.symmetric(vertical: 18),
                 child: Divider(
                 child: Divider(
                   thickness: 1,
                   thickness: 1,
                 ),
                 ),
@@ -166,7 +166,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
                         Navigator.of(context).push(
                         Navigator.of(context).push(
                           MaterialPageRoute(
                           MaterialPageRoute(
                             builder: (BuildContext context) {
                             builder: (BuildContext context) {
-                              return RecoveryPage();
+                              return const RecoveryPage();
                             },
                             },
                           ),
                           ),
                         );
                         );

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

@@ -65,7 +65,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
                   totalSteps: 4,
                   totalSteps: 4,
                   currentStep: 3,
                   currentStep: 3,
                   selectedColor: Theme.of(context).buttonColor,
                   selectedColor: Theme.of(context).buttonColor,
-                  roundedEdges: Radius.circular(10),
+                  roundedEdges: const Radius.circular(10),
                   unselectedColor:
                   unselectedColor:
                       Theme.of(context).colorScheme.stepProgressUnselectedColor,
                       Theme.of(context).colorScheme.stepProgressUnselectedColor,
                 ),
                 ),
@@ -104,14 +104,14 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
                   "If you forget your password, the only way you can recover your data is with this key.",
                   "If you forget your password, the only way you can recover your data is with this key.",
               style: Theme.of(context).textTheme.subtitle1,
               style: Theme.of(context).textTheme.subtitle1,
             ),
             ),
-            Padding(padding: EdgeInsets.only(top: 24)),
+            const Padding(padding: EdgeInsets.only(top: 24)),
             DottedBorder(
             DottedBorder(
-              color: Color.fromRGBO(17, 127, 56, 1),
+              color: const Color.fromRGBO(17, 127, 56, 1),
               //color of dotted/dash line
               //color of dotted/dash line
               strokeWidth: 1,
               strokeWidth: 1,
               //thickness of dash/dots
               //thickness of dash/dots
               dashPattern: const [6, 6],
               dashPattern: const [6, 6],
-              radius: Radius.circular(8),
+              radius: const Radius.circular(8),
               //dash patterns, 10 is dash width, 6 is space width
               //dash patterns, 10 is dash width, 6 is space width
               child: SizedBox(
               child: SizedBox(
                 //inner container
                 //inner container
@@ -134,16 +134,16 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
                       child: Container(
                       child: Container(
                         decoration: BoxDecoration(
                         decoration: BoxDecoration(
                           border: Border.all(
                           border: Border.all(
-                            color: Color.fromRGBO(49, 155, 86, .2),
+                            color: const Color.fromRGBO(49, 155, 86, .2),
                           ),
                           ),
-                          borderRadius: BorderRadius.all(
+                          borderRadius: const BorderRadius.all(
                             Radius.circular(2),
                             Radius.circular(2),
                           ),
                           ),
                           color:
                           color:
                               Theme.of(context).colorScheme.recoveryKeyBoxColor,
                               Theme.of(context).colorScheme.recoveryKeyBoxColor,
                         ),
                         ),
                         height: 120,
                         height: 120,
-                        padding: EdgeInsets.all(20),
+                        padding: const EdgeInsets.all(20),
                         width: double.infinity,
                         width: double.infinity,
                         child: Text(
                         child: Text(
                           recoveryKey,
                           recoveryKey,
@@ -159,7 +159,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
               height: 80,
               height: 80,
               width: double.infinity,
               width: double.infinity,
               child: Padding(
               child: Padding(
-                padding: EdgeInsets.symmetric(vertical: 20),
+                padding: const EdgeInsets.symmetric(vertical: 20),
                 child: Text(
                 child: Text(
                   widget.subText ??
                   widget.subText ??
                       "We don’t store this key, please save this in a safe place.",
                       "We don’t store this key, please save this in a safe place.",
@@ -171,7 +171,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
               child: Container(
               child: Container(
                 alignment: Alignment.bottomCenter,
                 alignment: Alignment.bottomCenter,
                 width: double.infinity,
                 width: double.infinity,
-                padding: EdgeInsets.fromLTRB(10, 10, 10, 24),
+                padding: const EdgeInsets.fromLTRB(10, 10, 10, 24),
                 child: Column(
                 child: Column(
                   mainAxisAlignment: MainAxisAlignment.end,
                   mainAxisAlignment: MainAxisAlignment.end,
                   crossAxisAlignment: CrossAxisAlignment.stretch,
                   crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -194,10 +194,10 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
           onPressed: () async {
           onPressed: () async {
             await _saveKeys();
             await _saveKeys();
           },
           },
-          child: Text('Do this later'),
+          child: const Text('Do this later'),
         ),
         ),
       );
       );
-      childrens.add(SizedBox(height: 10));
+      childrens.add(const SizedBox(height: 10));
     }
     }
 
 
     childrens.add(
     childrens.add(
@@ -209,7 +209,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
       ),
       ),
     );
     );
     if (_hasTriedToSave) {
     if (_hasTriedToSave) {
-      childrens.add(SizedBox(height: 10));
+      childrens.add(const SizedBox(height: 10));
       childrens.add(
       childrens.add(
         ElevatedButton(
         ElevatedButton(
           child: Text(widget.doneText),
           child: Text(widget.doneText),
@@ -219,7 +219,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
         ),
         ),
       );
       );
     }
     }
-    childrens.add(SizedBox(height: 12));
+    childrens.add(const SizedBox(height: 12));
     return childrens;
     return childrens;
   }
   }
 
 
@@ -229,7 +229,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
     }
     }
     _recoveryKeyFile.writeAsStringSync(recoveryKey);
     _recoveryKeyFile.writeAsStringSync(recoveryKey);
     await Share.shareFiles([_recoveryKeyFile.path]);
     await Share.shareFiles([_recoveryKeyFile.path]);
-    Future.delayed(Duration(milliseconds: 500), () {
+    Future.delayed(const Duration(milliseconds: 500), () {
       if (mounted) {
       if (mounted) {
         setState(() {
         setState(() {
           _hasTriedToSave = true;
           _hasTriedToSave = true;

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

@@ -33,7 +33,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
       appBar: AppBar(
       appBar: AppBar(
         elevation: 0,
         elevation: 0,
         leading: IconButton(
         leading: IconButton(
-          icon: Icon(Icons.arrow_back),
+          icon: const Icon(Icons.arrow_back),
           color: Theme.of(context).iconTheme.color,
           color: Theme.of(context).iconTheme.color,
           onPressed: () {
           onPressed: () {
             Navigator.of(context).pop();
             Navigator.of(context).pop();
@@ -95,15 +95,15 @@ class _RecoveryPageState extends State<RecoveryPage> {
                     decoration: InputDecoration(
                     decoration: InputDecoration(
                       filled: true,
                       filled: true,
                       hintText: "Enter your recovery key",
                       hintText: "Enter your recovery key",
-                      contentPadding: EdgeInsets.all(20),
+                      contentPadding: const EdgeInsets.all(20),
                       border: UnderlineInputBorder(
                       border: UnderlineInputBorder(
                         borderSide: BorderSide.none,
                         borderSide: BorderSide.none,
                         borderRadius: BorderRadius.circular(6),
                         borderRadius: BorderRadius.circular(6),
                       ),
                       ),
                     ),
                     ),
-                    style: TextStyle(
+                    style: const TextStyle(
                       fontSize: 14,
                       fontSize: 14,
-                      fontFeatures: const [FontFeature.tabularFigures()],
+                      fontFeatures: [FontFeature.tabularFigures()],
                     ),
                     ),
                     controller: _recoveryKey,
                     controller: _recoveryKey,
                     autofocus: false,
                     autofocus: false,
@@ -115,8 +115,8 @@ class _RecoveryPageState extends State<RecoveryPage> {
                     },
                     },
                   ),
                   ),
                 ),
                 ),
-                Padding(
-                  padding: const EdgeInsets.symmetric(vertical: 18),
+                const Padding(
+                  padding: EdgeInsets.symmetric(vertical: 18),
                   child: Divider(
                   child: Divider(
                     thickness: 1,
                     thickness: 1,
                   ),
                   ),
@@ -133,7 +133,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
                         );
                         );
                       },
                       },
                       child: Container(
                       child: Container(
-                        padding: EdgeInsets.symmetric(horizontal: 20),
+                        padding: const EdgeInsets.symmetric(horizontal: 20),
                         child: Center(
                         child: Center(
                           child: Text(
                           child: Text(
                             "No recovery key?",
                             "No recovery key?",

+ 11 - 11
lib/ui/account/sessions_page.dart

@@ -31,7 +31,7 @@ class _SessionsPageState extends State<SessionsPage> {
     return Scaffold(
     return Scaffold(
       appBar: AppBar(
       appBar: AppBar(
         elevation: 0,
         elevation: 0,
-        title: Text("Active sessions"),
+        title: const Text("Active sessions"),
       ),
       ),
       body: _getBody(),
       body: _getBody(),
     );
     );
@@ -39,10 +39,10 @@ class _SessionsPageState extends State<SessionsPage> {
 
 
   Widget _getBody() {
   Widget _getBody() {
     if (_sessions == null) {
     if (_sessions == null) {
-      return Center(child: const EnteLoadingWidget());
+      return const Center(child: EnteLoadingWidget());
     }
     }
     List<Widget> rows = [];
     List<Widget> rows = [];
-    rows.add(Padding(padding: const EdgeInsets.all(4)));
+    rows.add(const Padding(padding: EdgeInsets.all(4)));
     for (final session in _sessions.sessions) {
     for (final session in _sessions.sessions) {
       rows.add(_getSessionWidget(session));
       rows.add(_getSessionWidget(session));
     }
     }
@@ -68,7 +68,7 @@ class _SessionsPageState extends State<SessionsPage> {
               crossAxisAlignment: CrossAxisAlignment.start,
               crossAxisAlignment: CrossAxisAlignment.start,
               children: [
               children: [
                 _getUAWidget(session),
                 _getUAWidget(session),
-                Padding(padding: EdgeInsets.all(4)),
+                const Padding(padding: EdgeInsets.all(4)),
                 Row(
                 Row(
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   children: [
                   children: [
@@ -84,7 +84,7 @@ class _SessionsPageState extends State<SessionsPage> {
                         ),
                         ),
                       ),
                       ),
                     ),
                     ),
-                    Padding(padding: EdgeInsets.all(8)),
+                    const Padding(padding: EdgeInsets.all(8)),
                     Flexible(
                     Flexible(
                       child: Text(
                       child: Text(
                         getFormattedTime(lastUsedTime),
                         getFormattedTime(lastUsedTime),
@@ -103,7 +103,7 @@ class _SessionsPageState extends State<SessionsPage> {
             ),
             ),
           ),
           ),
         ),
         ),
-        Divider(),
+        const Divider(),
       ],
       ],
     );
     );
   }
   }
@@ -144,17 +144,17 @@ class _SessionsPageState extends State<SessionsPage> {
         session.token == Configuration.instance.getToken();
         session.token == Configuration.instance.getToken();
     Widget text;
     Widget text;
     if (isLoggingOutFromThisDevice) {
     if (isLoggingOutFromThisDevice) {
-      text = Text(
+      text = const Text(
         "This will log you out of this device!",
         "This will log you out of this device!",
       );
       );
     } else {
     } else {
       text = SingleChildScrollView(
       text = SingleChildScrollView(
         child: Column(
         child: Column(
           children: [
           children: [
-            Text(
+            const Text(
               "This will log you out of the following device:",
               "This will log you out of the following device:",
             ),
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             Text(
             Text(
               session.ua,
               session.ua,
               style: Theme.of(context).textTheme.caption,
               style: Theme.of(context).textTheme.caption,
@@ -164,11 +164,11 @@ class _SessionsPageState extends State<SessionsPage> {
       );
       );
     }
     }
     AlertDialog alert = AlertDialog(
     AlertDialog alert = AlertDialog(
-      title: Text("Terminate session?"),
+      title: const Text("Terminate session?"),
       content: text,
       content: text,
       actions: [
       actions: [
         TextButton(
         TextButton(
-          child: Text(
+          child: const Text(
             "Terminate",
             "Terminate",
             style: TextStyle(
             style: TextStyle(
               color: Colors.red,
               color: Colors.red,

+ 11 - 11
lib/ui/account/two_factor_authentication_page.dart

@@ -19,7 +19,7 @@ class _TwoFactorAuthenticationPageState
     extends State<TwoFactorAuthenticationPage> {
     extends State<TwoFactorAuthenticationPage> {
   final _pinController = TextEditingController();
   final _pinController = TextEditingController();
   final _pinPutDecoration = BoxDecoration(
   final _pinPutDecoration = BoxDecoration(
-    border: Border.all(color: Color.fromRGBO(45, 194, 98, 1.0)),
+    border: Border.all(color: const Color.fromRGBO(45, 194, 98, 1.0)),
     borderRadius: BorderRadius.circular(15.0),
     borderRadius: BorderRadius.circular(15.0),
   );
   );
   String _code = "";
   String _code = "";
@@ -51,7 +51,7 @@ class _TwoFactorAuthenticationPageState
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return Scaffold(
     return Scaffold(
       appBar: AppBar(
       appBar: AppBar(
-        title: Text(
+        title: const Text(
           "Two-factor authentication",
           "Two-factor authentication",
         ),
         ),
       ),
       ),
@@ -65,7 +65,7 @@ class _TwoFactorAuthenticationPageState
       mainAxisAlignment: MainAxisAlignment.center,
       mainAxisAlignment: MainAxisAlignment.center,
       mainAxisSize: MainAxisSize.max,
       mainAxisSize: MainAxisSize.max,
       children: [
       children: [
-        Text(
+        const Text(
           "Enter the 6-digit code from\nyour authenticator app",
           "Enter the 6-digit code from\nyour authenticator app",
           style: TextStyle(
           style: TextStyle(
             height: 1.4,
             height: 1.4,
@@ -73,7 +73,7 @@ class _TwoFactorAuthenticationPageState
           ),
           ),
           textAlign: TextAlign.center,
           textAlign: TextAlign.center,
         ),
         ),
-        Padding(padding: EdgeInsets.all(32)),
+        const Padding(padding: EdgeInsets.all(32)),
         Padding(
         Padding(
           padding: const EdgeInsets.fromLTRB(40, 0, 40, 0),
           padding: const EdgeInsets.fromLTRB(40, 0, 40, 0),
           child: PinPut(
           child: PinPut(
@@ -94,10 +94,10 @@ class _TwoFactorAuthenticationPageState
             followingFieldDecoration: _pinPutDecoration.copyWith(
             followingFieldDecoration: _pinPutDecoration.copyWith(
               borderRadius: BorderRadius.circular(5.0),
               borderRadius: BorderRadius.circular(5.0),
               border: Border.all(
               border: Border.all(
-                color: Color.fromRGBO(45, 194, 98, 0.5),
+                color: const Color.fromRGBO(45, 194, 98, 0.5),
               ),
               ),
             ),
             ),
-            inputDecoration: InputDecoration(
+            inputDecoration: const InputDecoration(
               focusedBorder: InputBorder.none,
               focusedBorder: InputBorder.none,
               border: InputBorder.none,
               border: InputBorder.none,
               counterText: '',
               counterText: '',
@@ -105,7 +105,7 @@ class _TwoFactorAuthenticationPageState
             autofocus: true,
             autofocus: true,
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(24)),
+        const Padding(padding: EdgeInsets.all(24)),
         Container(
         Container(
           padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
           padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
           width: double.infinity,
           width: double.infinity,
@@ -116,18 +116,18 @@ class _TwoFactorAuthenticationPageState
                     _verifyTwoFactorCode(_code);
                     _verifyTwoFactorCode(_code);
                   }
                   }
                 : null,
                 : null,
-            child: Text("Verify"),
+            child: const Text("Verify"),
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(30)),
+        const Padding(padding: EdgeInsets.all(30)),
         GestureDetector(
         GestureDetector(
           behavior: HitTestBehavior.opaque,
           behavior: HitTestBehavior.opaque,
           onTap: () {
           onTap: () {
             UserService.instance.recoverTwoFactor(context, widget.sessionID);
             UserService.instance.recoverTwoFactor(context, widget.sessionID);
           },
           },
           child: Container(
           child: Container(
-            padding: EdgeInsets.all(10),
-            child: Center(
+            padding: const EdgeInsets.all(10),
+            child: const Center(
               child: Text(
               child: Text(
                 "Lost device?",
                 "Lost device?",
                 style: TextStyle(
                 style: TextStyle(

+ 7 - 7
lib/ui/account/two_factor_recovery_page.dart

@@ -27,7 +27,7 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return Scaffold(
     return Scaffold(
       appBar: AppBar(
       appBar: AppBar(
-        title: Text(
+        title: const Text(
           "Recover account",
           "Recover account",
           style: TextStyle(
           style: TextStyle(
             fontSize: 18,
             fontSize: 18,
@@ -42,13 +42,13 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
           Padding(
           Padding(
             padding: const EdgeInsets.fromLTRB(60, 0, 60, 0),
             padding: const EdgeInsets.fromLTRB(60, 0, 60, 0),
             child: TextFormField(
             child: TextFormField(
-              decoration: InputDecoration(
+              decoration: const InputDecoration(
                 hintText: "Enter your recovery key",
                 hintText: "Enter your recovery key",
                 contentPadding: EdgeInsets.all(20),
                 contentPadding: EdgeInsets.all(20),
               ),
               ),
-              style: TextStyle(
+              style: const TextStyle(
                 fontSize: 14,
                 fontSize: 14,
-                fontFeatures: const [FontFeature.tabularFigures()],
+                fontFeatures: [FontFeature.tabularFigures()],
               ),
               ),
               controller: _recoveryKey,
               controller: _recoveryKey,
               autofocus: false,
               autofocus: false,
@@ -60,7 +60,7 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
               },
               },
             ),
             ),
           ),
           ),
-          Padding(padding: EdgeInsets.all(24)),
+          const Padding(padding: EdgeInsets.all(24)),
           Container(
           Container(
             padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
             padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
             width: double.infinity,
             width: double.infinity,
@@ -77,7 +77,7 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
                       );
                       );
                     }
                     }
                   : null,
                   : null,
-              child: Text("Recover"),
+              child: const Text("Recover"),
             ),
             ),
           ),
           ),
           GestureDetector(
           GestureDetector(
@@ -90,7 +90,7 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
               );
               );
             },
             },
             child: Container(
             child: Container(
-              padding: EdgeInsets.all(40),
+              padding: const EdgeInsets.all(40),
               child: Center(
               child: Center(
                 child: Text(
                 child: Text(
                   "No recovery key?",
                   "No recovery key?",

+ 18 - 18
lib/ui/account/two_factor_setup_page.dart

@@ -26,7 +26,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
   TabController _tabController;
   TabController _tabController;
   final _pinController = TextEditingController();
   final _pinController = TextEditingController();
   final _pinPutDecoration = BoxDecoration(
   final _pinPutDecoration = BoxDecoration(
-    border: Border.all(color: Color.fromRGBO(45, 194, 98, 1.0)),
+    border: Border.all(color: const Color.fromRGBO(45, 194, 98, 1.0)),
     borderRadius: BorderRadius.circular(15.0),
     borderRadius: BorderRadius.circular(15.0),
   );
   );
   String _code = "";
   String _code = "";
@@ -66,7 +66,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
     return Scaffold(
     return Scaffold(
       appBar: AppBar(
       appBar: AppBar(
         elevation: 0,
         elevation: 0,
-        title: Text(
+        title: const Text(
           "Two-factor setup",
           "Two-factor setup",
         ),
         ),
       ),
       ),
@@ -133,8 +133,8 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
       child: Column(
       child: Column(
         mainAxisAlignment: MainAxisAlignment.center,
         mainAxisAlignment: MainAxisAlignment.center,
         children: [
         children: [
-          Padding(padding: EdgeInsets.all(12)),
-          Text(
+          const Padding(padding: EdgeInsets.all(12)),
+          const Text(
             "Copy-paste this code\nto your authenticator app",
             "Copy-paste this code\nto your authenticator app",
             style: TextStyle(
             style: TextStyle(
               height: 1.4,
               height: 1.4,
@@ -142,11 +142,11 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
             ),
             ),
             textAlign: TextAlign.center,
             textAlign: TextAlign.center,
           ),
           ),
-          Padding(padding: EdgeInsets.all(16)),
+          const Padding(padding: EdgeInsets.all(16)),
           Padding(
           Padding(
             padding: const EdgeInsets.only(left: 10, right: 10),
             padding: const EdgeInsets.only(left: 10, right: 10),
             child: Container(
             child: Container(
-              padding: EdgeInsets.all(16),
+              padding: const EdgeInsets.all(16),
               color: textColor.withOpacity(0.1),
               color: textColor.withOpacity(0.1),
               child: Center(
               child: Center(
                 child: Text(
                 child: Text(
@@ -160,7 +160,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
               ),
               ),
             ),
             ),
           ),
           ),
-          Padding(padding: EdgeInsets.all(6)),
+          const Padding(padding: EdgeInsets.all(6)),
           Text(
           Text(
             "tap to copy",
             "tap to copy",
             style: TextStyle(color: textColor.withOpacity(0.5)),
             style: TextStyle(color: textColor.withOpacity(0.5)),
@@ -174,8 +174,8 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
     return Center(
     return Center(
       child: Column(
       child: Column(
         children: [
         children: [
-          Padding(padding: EdgeInsets.all(12)),
-          Text(
+          const Padding(padding: EdgeInsets.all(12)),
+          const Text(
             "Scan this barcode with\nyour authenticator app",
             "Scan this barcode with\nyour authenticator app",
             style: TextStyle(
             style: TextStyle(
               height: 1.4,
               height: 1.4,
@@ -183,7 +183,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
             ),
             ),
             textAlign: TextAlign.center,
             textAlign: TextAlign.center,
           ),
           ),
-          Padding(padding: EdgeInsets.all(12)),
+          const Padding(padding: EdgeInsets.all(12)),
           Image(
           Image(
             image: _imageProvider,
             image: _imageProvider,
             height: 180,
             height: 180,
@@ -197,8 +197,8 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
   Widget _getVerificationWidget() {
   Widget _getVerificationWidget() {
     return Column(
     return Column(
       children: [
       children: [
-        Padding(padding: EdgeInsets.all(12)),
-        Text(
+        const Padding(padding: EdgeInsets.all(12)),
+        const Text(
           "Enter the 6-digit code from\nyour authenticator app",
           "Enter the 6-digit code from\nyour authenticator app",
           style: TextStyle(
           style: TextStyle(
             height: 1.4,
             height: 1.4,
@@ -206,7 +206,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
           ),
           ),
           textAlign: TextAlign.center,
           textAlign: TextAlign.center,
         ),
         ),
-        Padding(padding: EdgeInsets.all(16)),
+        const Padding(padding: EdgeInsets.all(16)),
         Padding(
         Padding(
           padding: const EdgeInsets.fromLTRB(40, 0, 40, 0),
           padding: const EdgeInsets.fromLTRB(40, 0, 40, 0),
           child: PinPut(
           child: PinPut(
@@ -227,26 +227,26 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
             followingFieldDecoration: _pinPutDecoration.copyWith(
             followingFieldDecoration: _pinPutDecoration.copyWith(
               borderRadius: BorderRadius.circular(5.0),
               borderRadius: BorderRadius.circular(5.0),
               border: Border.all(
               border: Border.all(
-                color: Color.fromRGBO(45, 194, 98, 0.5),
+                color: const Color.fromRGBO(45, 194, 98, 0.5),
               ),
               ),
             ),
             ),
-            inputDecoration: InputDecoration(
+            inputDecoration: const InputDecoration(
               focusedBorder: InputBorder.none,
               focusedBorder: InputBorder.none,
               border: InputBorder.none,
               border: InputBorder.none,
               counterText: '',
               counterText: '',
             ),
             ),
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(24)),
+        const Padding(padding: EdgeInsets.all(24)),
         OutlinedButton(
         OutlinedButton(
           onPressed: _code.length == 6
           onPressed: _code.length == 6
               ? () async {
               ? () async {
                   _enableTwoFactor(_code);
                   _enableTwoFactor(_code);
                 }
                 }
               : null,
               : null,
-          child: Text("Confirm"),
+          child: const Text("Confirm"),
         ),
         ),
-        Padding(padding: EdgeInsets.only(bottom: 24)),
+        const Padding(padding: EdgeInsets.only(bottom: 24)),
       ],
       ],
     );
     );
   }
   }

+ 15 - 15
lib/ui/backup_folder_selection_page.dart

@@ -65,17 +65,17 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
           ? null
           ? null
           : AppBar(
           : AppBar(
               elevation: 0,
               elevation: 0,
-              title: Text(""),
+              title: const Text(""),
             ),
             ),
       body: Column(
       body: Column(
         mainAxisAlignment: MainAxisAlignment.center,
         mainAxisAlignment: MainAxisAlignment.center,
         children: [
         children: [
-          SizedBox(
+          const SizedBox(
             height: 0,
             height: 0,
           ),
           ),
           SafeArea(
           SafeArea(
             child: Container(
             child: Container(
-              padding: EdgeInsets.fromLTRB(24, 32, 24, 8),
+              padding: const EdgeInsets.fromLTRB(24, 32, 24, 8),
               child: Text(
               child: Text(
                 'Select folders for backup',
                 'Select folders for backup',
                 textAlign: TextAlign.left,
                 textAlign: TextAlign.left,
@@ -95,7 +95,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
               style: Theme.of(context).textTheme.caption.copyWith(height: 1.3),
               style: Theme.of(context).textTheme.caption.copyWith(height: 1.3),
             ),
             ),
           ),
           ),
-          Padding(
+          const Padding(
             padding: EdgeInsets.all(10),
             padding: EdgeInsets.all(10),
           ),
           ),
           _latestFiles == null
           _latestFiles == null
@@ -111,7 +111,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
                             ? "Unselect all"
                             ? "Unselect all"
                             : "Select all",
                             : "Select all",
                         textAlign: TextAlign.right,
                         textAlign: TextAlign.right,
-                        style: TextStyle(
+                        style: const TextStyle(
                           decoration: TextDecoration.underline,
                           decoration: TextDecoration.underline,
                           fontSize: 16,
                           fontSize: 16,
                         ),
                         ),
@@ -147,13 +147,13 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
                       BoxShadow(
                       BoxShadow(
                         color: Theme.of(context).backgroundColor,
                         color: Theme.of(context).backgroundColor,
                         blurRadius: 24,
                         blurRadius: 24,
-                        offset: Offset(0, -8),
+                        offset: const Offset(0, -8),
                         spreadRadius: 4,
                         spreadRadius: 4,
                       )
                       )
                     ],
                     ],
                   ),
                   ),
                   padding: widget.isOnboarding
                   padding: widget.isOnboarding
-                      ? EdgeInsets.only(left: 20, right: 20)
+                      ? const EdgeInsets.only(left: 20, right: 20)
                       : EdgeInsets.only(
                       : EdgeInsets.only(
                           top: 16,
                           top: 16,
                           left: 20,
                           left: 20,
@@ -206,7 +206,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
     _sortFiles();
     _sortFiles();
     final scrollController = ScrollController();
     final scrollController = ScrollController();
     return Container(
     return Container(
-      padding: EdgeInsets.symmetric(horizontal: 20),
+      padding: const EdgeInsets.symmetric(horizontal: 20),
       child: Scrollbar(
       child: Scrollbar(
         controller: scrollController,
         controller: scrollController,
         thumbVisibility: true,
         thumbVisibility: true,
@@ -262,15 +262,15 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
           border: Border.all(
           border: Border.all(
             color: Theme.of(context).colorScheme.boxUnSelectColor,
             color: Theme.of(context).colorScheme.boxUnSelectColor,
           ),
           ),
-          borderRadius: BorderRadius.all(
+          borderRadius: const BorderRadius.all(
             Radius.circular(12),
             Radius.circular(12),
           ),
           ),
           // color: isSelected
           // color: isSelected
           //     ? Theme.of(context).colorScheme.boxSelectColor
           //     ? Theme.of(context).colorScheme.boxSelectColor
           //     : Theme.of(context).colorScheme.boxUnSelectColor,
           //     : Theme.of(context).colorScheme.boxUnSelectColor,
           gradient: isSelected
           gradient: isSelected
-              ? LinearGradient(
-                  colors: const [Color(0xFF00DD4D), Color(0xFF43BA6C)],
+              ? const LinearGradient(
+                  colors: [Color(0xFF00DD4D), Color(0xFF43BA6C)],
                 ) //same for both themes
                 ) //same for both themes
               : LinearGradient(
               : LinearGradient(
                   colors: [
                   colors: [
@@ -279,7 +279,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
                   ],
                   ],
                 ),
                 ),
         ),
         ),
-        padding: EdgeInsets.fromLTRB(8, 4, 4, 4),
+        padding: const EdgeInsets.fromLTRB(8, 4, 4, 4),
         child: InkWell(
         child: InkWell(
           child: Row(
           child: Row(
             mainAxisAlignment: MainAxisAlignment.spaceBetween,
             mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -303,7 +303,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
                     crossAxisAlignment: CrossAxisAlignment.start,
                     crossAxisAlignment: CrossAxisAlignment.start,
                     children: [
                     children: [
                       Container(
                       Container(
-                        constraints: BoxConstraints(maxWidth: 180),
+                        constraints: const BoxConstraints(maxWidth: 180),
                         child: Text(
                         child: Text(
                           file.deviceFolder,
                           file.deviceFolder,
                           textAlign: TextAlign.left,
                           textAlign: TextAlign.left,
@@ -322,7 +322,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
                           maxLines: 2,
                           maxLines: 2,
                         ),
                         ),
                       ),
                       ),
-                      Padding(padding: EdgeInsets.only(top: 2)),
+                      const Padding(padding: EdgeInsets.only(top: 2)),
                       Text(
                       Text(
                         _itemCount[file.deviceFolder].toString() +
                         _itemCount[file.deviceFolder].toString() +
                             " item" +
                             " item" +
@@ -391,7 +391,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
             Padding(
             Padding(
               padding: const EdgeInsets.all(9),
               padding: const EdgeInsets.all(9),
               child: isSelected
               child: isSelected
-                  ? Icon(
+                  ? const Icon(
                       Icons.local_police,
                       Icons.local_police,
                       color: Colors.white,
                       color: Colors.white,
                     )
                     )

+ 21 - 21
lib/ui/collections_gallery_widget.dart

@@ -150,7 +150,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
         child: Column(
         child: Column(
           children: [
           children: [
             const SizedBox(height: 12),
             const SizedBox(height: 12),
-            SectionTitle("On device"),
+            const SectionTitle("On device"),
             const SizedBox(height: 12),
             const SizedBox(height: 12),
             items.folders.isEmpty
             items.folders.isEmpty
                 ? const Padding(
                 ? const Padding(
@@ -168,8 +168,8 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
                             : ListView.builder(
                             : ListView.builder(
                                 shrinkWrap: true,
                                 shrinkWrap: true,
                                 scrollDirection: Axis.horizontal,
                                 scrollDirection: Axis.horizontal,
-                                padding: EdgeInsets.fromLTRB(6, 0, 6, 0),
-                                physics: ScrollPhysics(),
+                                padding: const EdgeInsets.fromLTRB(6, 0, 6, 0),
+                                physics: const ScrollPhysics(),
                                 // to disable GridView's scrolling
                                 // to disable GridView's scrolling
                                 itemBuilder: (context, index) {
                                 itemBuilder: (context, index) {
                                   return DeviceFolderIcon(items.folders[index]);
                                   return DeviceFolderIcon(items.folders[index]);
@@ -185,7 +185,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
               mainAxisAlignment: MainAxisAlignment.spaceBetween,
               mainAxisAlignment: MainAxisAlignment.spaceBetween,
               crossAxisAlignment: CrossAxisAlignment.end,
               crossAxisAlignment: CrossAxisAlignment.end,
               children: [
               children: [
-                EnteSectionTitle(),
+                const EnteSectionTitle(),
                 _sortMenu(),
                 _sortMenu(),
               ],
               ],
             ),
             ),
@@ -195,7 +195,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
                     padding: const EdgeInsets.symmetric(horizontal: 16),
                     padding: const EdgeInsets.symmetric(horizontal: 16),
                     child: GridView.builder(
                     child: GridView.builder(
                       shrinkWrap: true,
                       shrinkWrap: true,
-                      physics: ScrollPhysics(),
+                      physics: const ScrollPhysics(),
                       // to disable GridView's scrolling
                       // to disable GridView's scrolling
                       itemBuilder: (context, index) {
                       itemBuilder: (context, index) {
                         return _buildCollection(
                         return _buildCollection(
@@ -229,7 +229,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
                       shape: RoundedRectangleBorder(
                       shape: RoundedRectangleBorder(
                         borderRadius: BorderRadius.circular(8),
                         borderRadius: BorderRadius.circular(8),
                       ),
                       ),
-                      padding: EdgeInsets.all(0),
+                      padding: const EdgeInsets.all(0),
                       side: BorderSide(
                       side: BorderSide(
                         width: 0.5,
                         width: 0.5,
                         color:
                         color:
@@ -250,7 +250,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
                                   Icons.delete,
                                   Icons.delete,
                                   color: Theme.of(context).iconTheme.color,
                                   color: Theme.of(context).iconTheme.color,
                                 ),
                                 ),
-                                Padding(padding: EdgeInsets.all(6)),
+                                const Padding(padding: EdgeInsets.all(6)),
                                 FutureBuilder<int>(
                                 FutureBuilder<int>(
                                   future: TrashDB.instance.count(),
                                   future: TrashDB.instance.count(),
                                   builder: (context, snapshot) {
                                   builder: (context, snapshot) {
@@ -265,7 +265,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
                                                   .textTheme
                                                   .textTheme
                                                   .subtitle1,
                                                   .subtitle1,
                                             ),
                                             ),
-                                            TextSpan(text: "  \u2022  "),
+                                            const TextSpan(text: "  \u2022  "),
                                             TextSpan(
                                             TextSpan(
                                               text: snapshot.data.toString(),
                                               text: snapshot.data.toString(),
                                             ),
                                             ),
@@ -308,14 +308,14 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
                       );
                       );
                     },
                     },
                   ),
                   ),
-                  SizedBox(height: 12),
+                  const SizedBox(height: 12),
                   OutlinedButton(
                   OutlinedButton(
                     style: OutlinedButton.styleFrom(
                     style: OutlinedButton.styleFrom(
                       backgroundColor: Theme.of(context).backgroundColor,
                       backgroundColor: Theme.of(context).backgroundColor,
                       shape: RoundedRectangleBorder(
                       shape: RoundedRectangleBorder(
                         borderRadius: BorderRadius.circular(8),
                         borderRadius: BorderRadius.circular(8),
                       ),
                       ),
-                      padding: EdgeInsets.all(0),
+                      padding: const EdgeInsets.all(0),
                       side: BorderSide(
                       side: BorderSide(
                         width: 0.5,
                         width: 0.5,
                         color:
                         color:
@@ -336,7 +336,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
                                   Icons.visibility_off,
                                   Icons.visibility_off,
                                   color: Theme.of(context).iconTheme.color,
                                   color: Theme.of(context).iconTheme.color,
                                 ),
                                 ),
-                                Padding(padding: EdgeInsets.all(6)),
+                                const Padding(padding: EdgeInsets.all(6)),
                                 FutureBuilder<int>(
                                 FutureBuilder<int>(
                                   future:
                                   future:
                                       FilesDB.instance.fileCountWithVisibility(
                                       FilesDB.instance.fileCountWithVisibility(
@@ -355,7 +355,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
                                                   .textTheme
                                                   .textTheme
                                                   .subtitle1,
                                                   .subtitle1,
                                             ),
                                             ),
-                                            TextSpan(text: "  \u2022  "),
+                                            const TextSpan(text: "  \u2022  "),
                                             TextSpan(
                                             TextSpan(
                                               text: snapshot.data.toString(),
                                               text: snapshot.data.toString(),
                                             ),
                                             ),
@@ -401,7 +401,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
                 ],
                 ],
               ),
               ),
             ),
             ),
-            Padding(padding: EdgeInsets.fromLTRB(12, 12, 12, 36)),
+            const Padding(padding: EdgeInsets.fromLTRB(12, 12, 12, 36)),
           ],
           ],
         ),
         ),
       ),
       ),
@@ -433,14 +433,14 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
     return Padding(
     return Padding(
       padding: const EdgeInsets.only(right: 24),
       padding: const EdgeInsets.only(right: 24),
       child: PopupMenuButton(
       child: PopupMenuButton(
-        offset: Offset(10, 50),
+        offset: const Offset(10, 50),
         initialValue: sortKey?.index ?? 0,
         initialValue: sortKey?.index ?? 0,
         child: Align(
         child: Align(
           child: Row(
           child: Row(
             mainAxisAlignment: MainAxisAlignment.end,
             mainAxisAlignment: MainAxisAlignment.end,
             crossAxisAlignment: CrossAxisAlignment.center,
             crossAxisAlignment: CrossAxisAlignment.center,
             children: [
             children: [
-              Padding(
+              const Padding(
                 padding: EdgeInsets.only(left: 5.0),
                 padding: EdgeInsets.only(left: 5.0),
               ),
               ),
               Container(
               Container(
@@ -487,14 +487,14 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
     } else {
     } else {
       return InkWell(
       return InkWell(
         child: Container(
         child: Container(
-          margin: EdgeInsets.fromLTRB(30, 30, 30, 54),
+          margin: const EdgeInsets.fromLTRB(30, 30, 30, 54),
           decoration: BoxDecoration(
           decoration: BoxDecoration(
             color: Theme.of(context).backgroundColor,
             color: Theme.of(context).backgroundColor,
             boxShadow: [
             boxShadow: [
               BoxShadow(
               BoxShadow(
                 blurRadius: 2,
                 blurRadius: 2,
                 spreadRadius: 0,
                 spreadRadius: 0,
-                offset: Offset(0, 0),
+                offset: const Offset(0, 0),
                 color: Theme.of(context).iconTheme.color.withOpacity(0.3),
                 color: Theme.of(context).iconTheme.color.withOpacity(0.3),
               )
               )
             ],
             ],
@@ -665,7 +665,7 @@ class CollectionItem extends StatelessWidget {
               ),
               ),
             ),
             ),
           ),
           ),
-          SizedBox(height: 4),
+          const SizedBox(height: 4),
           Row(
           Row(
             children: [
             children: [
               Container(
               Container(
@@ -686,7 +686,7 @@ class CollectionItem extends StatelessWidget {
                           color: albumTitleTextStyle.color.withOpacity(0.5),
                           color: albumTitleTextStyle.color.withOpacity(0.5),
                         ),
                         ),
                         children: [
                         children: [
-                          TextSpan(text: "  \u2022  "),
+                          const TextSpan(text: "  \u2022  "),
                           TextSpan(text: snapshot.data.toString()),
                           TextSpan(text: snapshot.data.toString()),
                         ],
                         ],
                       ),
                       ),
@@ -722,7 +722,7 @@ class SectionTitle extends StatelessWidget {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return Container(
     return Container(
-      margin: EdgeInsets.fromLTRB(16, 12, 0, 0),
+      margin: const EdgeInsets.fromLTRB(16, 12, 0, 0),
       child: Column(
       child: Column(
         children: [
         children: [
           Align(
           Align(
@@ -750,7 +750,7 @@ class EnteSectionTitle extends StatelessWidget {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return Container(
     return Container(
-      margin: EdgeInsets.fromLTRB(16, 12, 0, 0),
+      margin: const EdgeInsets.fromLTRB(16, 12, 0, 0),
       child: Column(
       child: Column(
         children: [
         children: [
           Align(
           Align(

+ 1 - 1
lib/ui/common/dialogs.dart

@@ -29,7 +29,7 @@ Future<DialogUserChoice> showChoiceDialog<T>(
     ),
     ),
     content: Text(
     content: Text(
       content,
       content,
-      style: TextStyle(
+      style: const TextStyle(
         height: 1.4,
         height: 1.4,
       ),
       ),
     ),
     ),

+ 3 - 3
lib/ui/common/dynamic_fab.dart

@@ -27,7 +27,7 @@ class DynamicFAB extends StatelessWidget {
               color: Theme.of(context).backgroundColor,
               color: Theme.of(context).backgroundColor,
               spreadRadius: 200,
               spreadRadius: 200,
               blurRadius: 100,
               blurRadius: 100,
-              offset: Offset(0, 230),
+              offset: const Offset(0, 230),
             )
             )
           ],
           ],
         ),
         ),
@@ -48,7 +48,7 @@ class DynamicFAB extends StatelessWidget {
                     },
                     },
               child: Transform.rotate(
               child: Transform.rotate(
                 angle: isFormValid ? 0 : math.pi / 2,
                 angle: isFormValid ? 0 : math.pi / 2,
-                child: Icon(
+                child: const Icon(
                   Icons.chevron_right,
                   Icons.chevron_right,
                   size: 36,
                   size: 36,
                 ),
                 ),
@@ -61,7 +61,7 @@ class DynamicFAB extends StatelessWidget {
       return Container(
       return Container(
         width: double.infinity,
         width: double.infinity,
         height: 56,
         height: 56,
-        padding: EdgeInsets.symmetric(horizontal: 20),
+        padding: const EdgeInsets.symmetric(horizontal: 20),
         child: OutlinedButton(
         child: OutlinedButton(
           onPressed: isFormValid //var here
           onPressed: isFormValid //var here
               ? onPressedFunction
               ? onPressedFunction

+ 4 - 4
lib/ui/common/gradient_button.dart

@@ -32,7 +32,7 @@ class GradientButton extends StatelessWidget {
     } else if (iconData == null) {
     } else if (iconData == null) {
       buttonContent = Text(
       buttonContent = Text(
         text,
         text,
-        style: TextStyle(
+        style: const TextStyle(
           color: Colors.white,
           color: Colors.white,
           fontWeight: FontWeight.w600,
           fontWeight: FontWeight.w600,
           fontFamily: 'Inter-SemiBold',
           fontFamily: 'Inter-SemiBold',
@@ -51,7 +51,7 @@ class GradientButton extends StatelessWidget {
           Padding(padding: EdgeInsets.all(paddingValue)),
           Padding(padding: EdgeInsets.all(paddingValue)),
           Text(
           Text(
             text,
             text,
-            style: TextStyle(
+            style: const TextStyle(
               color: Colors.white,
               color: Colors.white,
               fontWeight: FontWeight.w600,
               fontWeight: FontWeight.w600,
               fontFamily: 'Inter-SemiBold',
               fontFamily: 'Inter-SemiBold',
@@ -67,8 +67,8 @@ class GradientButton extends StatelessWidget {
         height: 56,
         height: 56,
         decoration: BoxDecoration(
         decoration: BoxDecoration(
           gradient: LinearGradient(
           gradient: LinearGradient(
-            begin: Alignment(0.1, -0.9),
-            end: Alignment(-0.6, 0.9),
+            begin: const Alignment(0.1, -0.9),
+            end: const Alignment(-0.6, 0.9),
             colors: linearGradientColors,
             colors: linearGradientColors,
           ),
           ),
           borderRadius: BorderRadius.circular(8),
           borderRadius: BorderRadius.circular(8),

+ 1 - 1
lib/ui/common/linear_progress_dialog.dart

@@ -31,7 +31,7 @@ class LinearProgressDialogState extends State<LinearProgressDialog> {
       child: AlertDialog(
       child: AlertDialog(
         title: Text(
         title: Text(
           widget.message,
           widget.message,
-          style: TextStyle(
+          style: const TextStyle(
             fontSize: 16,
             fontSize: 16,
           ),
           ),
           textAlign: TextAlign.center,
           textAlign: TextAlign.center,

+ 2 - 2
lib/ui/common/loading_widget.dart

@@ -7,8 +7,8 @@ class EnteLoadingWidget extends StatelessWidget {
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return Center(
     return Center(
       child: SizedBox.fromSize(
       child: SizedBox.fromSize(
-        size: Size.square(30),
-        child: CupertinoActivityIndicator(),
+        size: const Size.square(30),
+        child: const CupertinoActivityIndicator(),
       ),
       ),
     );
     );
   }
   }

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

@@ -18,12 +18,12 @@ ProgressDialogType _progressDialogType;
 bool _barrierDismissible = true, _showLogs = false;
 bool _barrierDismissible = true, _showLogs = false;
 Color _barrierColor;
 Color _barrierColor;
 
 
-TextStyle _progressTextStyle = TextStyle(
+TextStyle _progressTextStyle = const TextStyle(
       color: Colors.black,
       color: Colors.black,
       fontSize: 12.0,
       fontSize: 12.0,
       fontWeight: FontWeight.w400,
       fontWeight: FontWeight.w400,
     ),
     ),
-    _messageStyle = TextStyle(
+    _messageStyle = const TextStyle(
       color: Colors.black,
       color: Colors.black,
       fontSize: 18.0,
       fontSize: 18.0,
       fontWeight: FontWeight.w600,
       fontWeight: FontWeight.w600,
@@ -155,7 +155,7 @@ class ProgressDialog {
               child: Dialog(
               child: Dialog(
                 backgroundColor: _backgroundColor,
                 backgroundColor: _backgroundColor,
                 insetAnimationCurve: _insetAnimCurve,
                 insetAnimationCurve: _insetAnimCurve,
-                insetAnimationDuration: Duration(milliseconds: 100),
+                insetAnimationDuration: const Duration(milliseconds: 100),
                 elevation: _dialogElevation,
                 elevation: _dialogElevation,
                 shape: RoundedRectangleBorder(
                 shape: RoundedRectangleBorder(
                   borderRadius:
                   borderRadius:
@@ -168,7 +168,7 @@ class ProgressDialog {
         );
         );
         // Delaying the function for 200 milliseconds
         // Delaying the function for 200 milliseconds
         // [Default transitionDuration of DialogRoute]
         // [Default transitionDuration of DialogRoute]
-        await Future.delayed(Duration(milliseconds: 200));
+        await Future.delayed(const Duration(milliseconds: 200));
         if (_showLogs) debugPrint('ProgressDialog shown');
         if (_showLogs) debugPrint('ProgressDialog shown');
         _isShowing = true;
         _isShowing = true;
         return true;
         return true;
@@ -235,7 +235,7 @@ class _BodyState extends State<_Body> {
               child: Column(
               child: Column(
                 mainAxisSize: MainAxisSize.min,
                 mainAxisSize: MainAxisSize.min,
                 children: <Widget>[
                 children: <Widget>[
-                  SizedBox(height: 8.0),
+                  const SizedBox(height: 8.0),
                   Row(
                   Row(
                     children: <Widget>[
                     children: <Widget>[
                       Expanded(
                       Expanded(
@@ -247,7 +247,7 @@ class _BodyState extends State<_Body> {
                       ),
                       ),
                     ],
                     ],
                   ),
                   ),
-                  SizedBox(height: 4.0),
+                  const SizedBox(height: 4.0),
                   Align(
                   Align(
                     alignment: Alignment.bottomRight,
                     alignment: Alignment.bottomRight,
                     child: Text(
                     child: Text(

+ 4 - 4
lib/ui/common/rename_dialog.dart

@@ -25,7 +25,7 @@ class _RenameDialogState extends State<RenameDialog> {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return AlertDialog(
     return AlertDialog(
-      title: Text("Enter a new name"),
+      title: const Text("Enter a new name"),
       content: SingleChildScrollView(
       content: SingleChildScrollView(
         child: Column(
         child: Column(
           mainAxisAlignment: MainAxisAlignment.start,
           mainAxisAlignment: MainAxisAlignment.start,
@@ -34,10 +34,10 @@ class _RenameDialogState extends State<RenameDialog> {
             TextFormField(
             TextFormField(
               decoration: InputDecoration(
               decoration: InputDecoration(
                 hintText: '${widget.type} name',
                 hintText: '${widget.type} name',
-                hintStyle: TextStyle(
+                hintStyle: const TextStyle(
                   color: Colors.white30,
                   color: Colors.white30,
                 ),
                 ),
-                contentPadding: EdgeInsets.all(12),
+                contentPadding: const EdgeInsets.all(12),
               ),
               ),
               onChanged: (value) {
               onChanged: (value) {
                 setState(() {
                 setState(() {
@@ -54,7 +54,7 @@ class _RenameDialogState extends State<RenameDialog> {
       ),
       ),
       actions: [
       actions: [
         TextButton(
         TextButton(
-          child: Text(
+          child: const Text(
             "Cancel",
             "Cancel",
             style: TextStyle(
             style: TextStyle(
               color: Colors.redAccent,
               color: Colors.redAccent,

+ 3 - 7
lib/ui/common/web_page.dart

@@ -19,14 +19,10 @@ class _WebPageState extends State<WebPage> {
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return Scaffold(
     return Scaffold(
       appBar: AppBar(
       appBar: AppBar(
-        backgroundColor: Color.fromRGBO(
-          10,
-          20,
-          20,
-          1.0,
-        ), // force dark theme for appBar till website/family plans add supports for light theme
+        // force dark theme for appBar till website/family plans add supports for light theme
+        backgroundColor: const Color.fromRGBO(10, 20, 20, 1.0),
         foregroundColor: Colors.white,
         foregroundColor: Colors.white,
-        iconTheme: IconThemeData(color: Colors.white),
+        iconTheme: const IconThemeData(color: Colors.white),
         title: Text(widget.title),
         title: Text(widget.title),
         actions: [_hasLoadedPage ? Container() : const EnteLoadingWidget()],
         actions: [_hasLoadedPage ? Container() : const EnteLoadingWidget()],
       ),
       ),

+ 8 - 9
lib/ui/create_collection_page.dart

@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
 import 'package:logging/logging.dart';
 import 'package:logging/logging.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/db/files_db.dart';
 import 'package:photos/db/files_db.dart';
-import 'package:photos/ente_theme_data.dart';
 import 'package:photos/models/collection.dart';
 import 'package:photos/models/collection.dart';
 import 'package:photos/models/collection_items.dart';
 import 'package:photos/models/collection_items.dart';
 import 'package:photos/models/file.dart';
 import 'package:photos/models/file.dart';
@@ -98,8 +97,8 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
               ),
               ),
             ],
             ],
           ),
           ),
-          Padding(
-            padding: const EdgeInsets.fromLTRB(40, 24, 40, 20),
+          const Padding(
+            padding: EdgeInsets.fromLTRB(40, 24, 40, 20),
             child: Align(
             child: Align(
               alignment: Alignment.centerLeft,
               alignment: Alignment.centerLeft,
               child: Text(
               child: Text(
@@ -132,7 +131,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
             },
             },
             itemCount: snapshot.data.length,
             itemCount: snapshot.data.length,
             shrinkWrap: true,
             shrinkWrap: true,
-            physics: NeverScrollableScrollPhysics(),
+            physics: const NeverScrollableScrollPhysics(),
           );
           );
         } else {
         } else {
           return const EnteLoadingWidget();
           return const EnteLoadingWidget();
@@ -143,7 +142,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
 
 
   Widget _buildCollectionItem(CollectionWithThumbnail item) {
   Widget _buildCollectionItem(CollectionWithThumbnail item) {
     return Container(
     return Container(
-      padding: EdgeInsets.only(left: 24, bottom: 16),
+      padding: const EdgeInsets.only(left: 24, bottom: 16),
       child: GestureDetector(
       child: GestureDetector(
         behavior: HitTestBehavior.translucent,
         behavior: HitTestBehavior.translucent,
         child: Row(
         child: Row(
@@ -157,11 +156,11 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
                 child: ThumbnailWidget(item.thumbnail),
                 child: ThumbnailWidget(item.thumbnail),
               ),
               ),
             ),
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             Expanded(
             Expanded(
               child: Text(
               child: Text(
                 item.collection.name,
                 item.collection.name,
-                style: TextStyle(
+                style: const TextStyle(
                   fontSize: 16,
                   fontSize: 16,
                 ),
                 ),
               ),
               ),
@@ -203,9 +202,9 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
 
 
   void _showNameAlbumDialog() async {
   void _showNameAlbumDialog() async {
     AlertDialog alert = AlertDialog(
     AlertDialog alert = AlertDialog(
-      title: Text("Album title"),
+      title: const Text("Album title"),
       content: TextFormField(
       content: TextFormField(
-        decoration: InputDecoration(
+        decoration: const InputDecoration(
           hintText: "Christmas 2020 / Dinner at Alice's",
           hintText: "Christmas 2020 / Dinner at Alice's",
           contentPadding: EdgeInsets.all(8),
           contentPadding: EdgeInsets.all(8),
         ),
         ),

+ 6 - 6
lib/ui/grant_permissions_widget.dart

@@ -57,7 +57,7 @@ class GrantPermissionsWidget extends StatelessWidget {
                           .headline5
                           .headline5
                           .copyWith(fontWeight: FontWeight.w700),
                           .copyWith(fontWeight: FontWeight.w700),
                       children: [
                       children: [
-                        TextSpan(text: 'ente '),
+                        const TextSpan(text: 'ente '),
                         TextSpan(
                         TextSpan(
                           text: "needs permission to ",
                           text: "needs permission to ",
                           style: Theme.of(context)
                           style: Theme.of(context)
@@ -65,7 +65,7 @@ class GrantPermissionsWidget extends StatelessWidget {
                               .headline5
                               .headline5
                               .copyWith(fontWeight: FontWeight.w400),
                               .copyWith(fontWeight: FontWeight.w400),
                         ),
                         ),
-                        TextSpan(text: 'preserve your photos'),
+                        const TextSpan(text: 'preserve your photos'),
                       ],
                       ],
                     ),
                     ),
                   ),
                   ),
@@ -82,7 +82,7 @@ class GrantPermissionsWidget extends StatelessWidget {
               color: Theme.of(context).backgroundColor,
               color: Theme.of(context).backgroundColor,
               spreadRadius: 190,
               spreadRadius: 190,
               blurRadius: 30,
               blurRadius: 30,
-              offset: Offset(0, 170),
+              offset: const Offset(0, 170),
             )
             )
           ],
           ],
         ),
         ),
@@ -93,7 +93,7 @@ class GrantPermissionsWidget extends StatelessWidget {
           bottom: Platform.isIOS ? 40 : 16,
           bottom: Platform.isIOS ? 40 : 16,
         ),
         ),
         child: OutlinedButton(
         child: OutlinedButton(
-          child: Text("Grant permission"),
+          child: const Text("Grant permission"),
           onPressed: () async {
           onPressed: () async {
             final state = await PhotoManager.requestPermissionExtend();
             final state = await PhotoManager.requestPermissionExtend();
             if (state == PermissionState.authorized ||
             if (state == PermissionState.authorized ||
@@ -101,8 +101,8 @@ class GrantPermissionsWidget extends StatelessWidget {
               await SyncService.instance.onPermissionGranted(state);
               await SyncService.instance.onPermissionGranted(state);
             } else if (state == PermissionState.denied) {
             } else if (state == PermissionState.denied) {
               AlertDialog alert = AlertDialog(
               AlertDialog alert = AlertDialog(
-                title: Text("Please grant permissions"),
-                content: Text(
+                title: const Text("Please grant permissions"),
+                content: const Text(
                   "ente can encrypt and preserve files only if you grant access to them",
                   "ente can encrypt and preserve files only if you grant access to them",
                 ),
                 ),
                 actions: [
                 actions: [

+ 19 - 19
lib/ui/header_error_widget.dart

@@ -15,7 +15,7 @@ class HeaderErrorWidget extends StatelessWidget {
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     if (_error is NoActiveSubscriptionError) {
     if (_error is NoActiveSubscriptionError) {
       return Container(
       return Container(
-        margin: EdgeInsets.only(top: 8),
+        margin: const EdgeInsets.only(top: 8),
         child: Column(
         child: Column(
           children: [
           children: [
             Row(
             Row(
@@ -30,13 +30,13 @@ class HeaderErrorWidget extends StatelessWidget {
                 Text("Your subscription has expired"),
                 Text("Your subscription has expired"),
               ],
               ],
             ),
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             Container(
             Container(
               width: 400,
               width: 400,
               height: 52,
               height: 52,
               padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
               padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
               child: OutlinedButton(
               child: OutlinedButton(
-                child: Text("Subscribe"),
+                child: const Text("Subscribe"),
                 onPressed: () {
                 onPressed: () {
                   Navigator.of(context).push(
                   Navigator.of(context).push(
                     MaterialPageRoute(
                     MaterialPageRoute(
@@ -48,18 +48,18 @@ class HeaderErrorWidget extends StatelessWidget {
                 },
                 },
               ),
               ),
             ),
             ),
-            Padding(padding: EdgeInsets.all(12)),
-            Divider(
+            const Padding(padding: EdgeInsets.all(12)),
+            const Divider(
               thickness: 2,
               thickness: 2,
               height: 0,
               height: 0,
             ),
             ),
-            Padding(padding: EdgeInsets.all(12)),
+            const Padding(padding: EdgeInsets.all(12)),
           ],
           ],
         ),
         ),
       );
       );
     } else if (_error is StorageLimitExceededError) {
     } else if (_error is StorageLimitExceededError) {
       return Container(
       return Container(
-        margin: EdgeInsets.only(top: 8),
+        margin: const EdgeInsets.only(top: 8),
         child: Column(
         child: Column(
           children: [
           children: [
             Row(
             Row(
@@ -74,13 +74,13 @@ class HeaderErrorWidget extends StatelessWidget {
                 Text("Storage limit exceeded"),
                 Text("Storage limit exceeded"),
               ],
               ],
             ),
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             Container(
             Container(
               width: 400,
               width: 400,
               height: 52,
               height: 52,
               padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
               padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
               child: OutlinedButton(
               child: OutlinedButton(
-                child: Text("Upgrade"),
+                child: const Text("Upgrade"),
                 onPressed: () {
                 onPressed: () {
                   Navigator.of(context).push(
                   Navigator.of(context).push(
                     MaterialPageRoute(
                     MaterialPageRoute(
@@ -92,12 +92,12 @@ class HeaderErrorWidget extends StatelessWidget {
                 },
                 },
               ),
               ),
             ),
             ),
-            Padding(padding: EdgeInsets.all(12)),
-            Divider(
+            const Padding(padding: EdgeInsets.all(12)),
+            const Divider(
               thickness: 2,
               thickness: 2,
               height: 0,
               height: 0,
             ),
             ),
-            Padding(padding: EdgeInsets.all(12)),
+            const Padding(padding: EdgeInsets.all(12)),
           ],
           ],
         ),
         ),
       );
       );
@@ -109,13 +109,13 @@ class HeaderErrorWidget extends StatelessWidget {
               Icons.error_outline,
               Icons.error_outline,
               color: Colors.red[400],
               color: Colors.red[400],
             ),
             ),
-            Padding(padding: EdgeInsets.all(4)),
-            Text(
+            const Padding(padding: EdgeInsets.all(4)),
+            const Text(
               "We could not backup your data.\nWe will retry later.",
               "We could not backup your data.\nWe will retry later.",
               style: TextStyle(height: 1.4),
               style: TextStyle(height: 1.4),
               textAlign: TextAlign.center,
               textAlign: TextAlign.center,
             ),
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             InkWell(
             InkWell(
               child: OutlinedButton(
               child: OutlinedButton(
                 style: OutlinedButton.styleFrom(
                 style: OutlinedButton.styleFrom(
@@ -124,7 +124,7 @@ class HeaderErrorWidget extends StatelessWidget {
                   shape: RoundedRectangleBorder(
                   shape: RoundedRectangleBorder(
                     borderRadius: BorderRadius.circular(10),
                     borderRadius: BorderRadius.circular(10),
                   ),
                   ),
-                  padding: EdgeInsets.fromLTRB(50, 16, 50, 16),
+                  padding: const EdgeInsets.fromLTRB(50, 16, 50, 16),
                   side: BorderSide(
                   side: BorderSide(
                     width: 2,
                     width: 2,
                     color: Colors.orange[600],
                     color: Colors.orange[600],
@@ -149,12 +149,12 @@ class HeaderErrorWidget extends StatelessWidget {
                 },
                 },
               ),
               ),
             ),
             ),
-            Padding(padding: EdgeInsets.all(16)),
-            Divider(
+            const Padding(padding: EdgeInsets.all(16)),
+            const Divider(
               thickness: 2,
               thickness: 2,
               height: 0,
               height: 0,
             ),
             ),
-            Padding(padding: EdgeInsets.all(12)),
+            const Padding(padding: EdgeInsets.all(12)),
           ],
           ],
         ),
         ),
       );
       );

+ 25 - 22
lib/ui/home_widget.dart

@@ -108,7 +108,7 @@ class _HomeWidgetState extends State<HomeWidget> {
         _selectedTabIndex = event.selectedIndex;
         _selectedTabIndex = event.selectedIndex;
         _pageController.animateToPage(
         _pageController.animateToPage(
           event.selectedIndex,
           event.selectedIndex,
-          duration: Duration(milliseconds: 100),
+          duration: const Duration(milliseconds: 100),
           curve: Curves.easeIn,
           curve: Curves.easeIn,
         );
         );
       }
       }
@@ -124,8 +124,8 @@ class _HomeWidgetState extends State<HomeWidget> {
     _triggerLogoutEvent =
     _triggerLogoutEvent =
         Bus.instance.on<TriggerLogoutEvent>().listen((event) async {
         Bus.instance.on<TriggerLogoutEvent>().listen((event) async {
       AlertDialog alert = AlertDialog(
       AlertDialog alert = AlertDialog(
-        title: Text("Session expired"),
-        content: Text("Please login again"),
+        title: const Text("Session expired"),
+        content: const Text("Please login again"),
         actions: [
         actions: [
           TextButton(
           TextButton(
             child: Text(
             child: Text(
@@ -168,12 +168,12 @@ class _HomeWidgetState extends State<HomeWidget> {
     _firstImportEvent =
     _firstImportEvent =
         Bus.instance.on<SyncStatusUpdate>().listen((event) async {
         Bus.instance.on<SyncStatusUpdate>().listen((event) async {
       if (mounted && event.status == SyncStatus.completedFirstGalleryImport) {
       if (mounted && event.status == SyncStatus.completedFirstGalleryImport) {
-        Duration delayInRefresh = Duration(milliseconds: 0);
+        Duration delayInRefresh = const Duration(milliseconds: 0);
         // Loading page will redirect to BackupFolderSelectionPage.
         // Loading page will redirect to BackupFolderSelectionPage.
         // To avoid showing folder hook in middle during routing,
         // To avoid showing folder hook in middle during routing,
         // delay state refresh for home page
         // delay state refresh for home page
         if (!LocalSyncService.instance.hasGrantedLimitedPermissions()) {
         if (!LocalSyncService.instance.hasGrantedLimitedPermissions()) {
-          delayInRefresh = Duration(milliseconds: 250);
+          delayInRefresh = const Duration(milliseconds: 250);
         }
         }
         Future.delayed(
         Future.delayed(
           delayInRefresh,
           delayInRefresh,
@@ -256,7 +256,7 @@ class _HomeWidgetState extends State<HomeWidget> {
     return WillPopScope(
     return WillPopScope(
       child: Scaffold(
       child: Scaffold(
         appBar: PreferredSize(
         appBar: PreferredSize(
-          preferredSize: Size.fromHeight(0),
+          preferredSize: const Size.fromHeight(0),
           child: Container(),
           child: Container(),
         ),
         ),
         body: _getBody(),
         body: _getBody(),
@@ -280,13 +280,13 @@ class _HomeWidgetState extends State<HomeWidget> {
 
 
   Widget _getBody() {
   Widget _getBody() {
     if (!Configuration.instance.hasConfiguredAccount()) {
     if (!Configuration.instance.hasConfiguredAccount()) {
-      return LandingPageWidget();
+      return const LandingPageWidget();
     }
     }
     if (!LocalSyncService.instance.hasGrantedPermissions()) {
     if (!LocalSyncService.instance.hasGrantedPermissions()) {
-      return GrantPermissionsWidget();
+      return const GrantPermissionsWidget();
     }
     }
     if (!LocalSyncService.instance.hasCompletedFirstImport()) {
     if (!LocalSyncService.instance.hasCompletedFirstImport()) {
-      return LoadingPhotosWidget();
+      return const LoadingPhotosWidget();
     }
     }
     if (_sharedFiles != null && _sharedFiles.isNotEmpty) {
     if (_sharedFiles != null && _sharedFiles.isNotEmpty) {
       ReceiveSharingIntent.reset();
       ReceiveSharingIntent.reset();
@@ -318,11 +318,14 @@ class _HomeWidgetState extends State<HomeWidget> {
             _settingsPage,
             _settingsPage,
           ],
           ],
         ),
         ),
-        Align(alignment: Alignment.bottomCenter, child: BottomShadowWidget()),
+        const Align(
+          alignment: Alignment.bottomCenter,
+          child: BottomShadowWidget(),
+        ),
         Align(
         Align(
           alignment: Alignment.bottomCenter,
           alignment: Alignment.bottomCenter,
           child: SafeArea(
           child: SafeArea(
-            minimum: EdgeInsets.only(bottom: 8),
+            minimum: const EdgeInsets.only(bottom: 8),
             child: HomeBottomNavigationBar(
             child: HomeBottomNavigationBar(
               _selectedFiles,
               _selectedFiles,
               selectedTabIndex: _selectedTabIndex,
               selectedTabIndex: _selectedTabIndex,
@@ -444,7 +447,7 @@ class _HomeWidgetState extends State<HomeWidget> {
       tagPrefix: "home_gallery",
       tagPrefix: "home_gallery",
       selectedFiles: _selectedFiles,
       selectedFiles: _selectedFiles,
       header: header,
       header: header,
-      footer: GalleryFooterWidget(),
+      footer: const GalleryFooterWidget(),
     );
     );
     return Stack(
     return Stack(
       children: [
       children: [
@@ -492,7 +495,7 @@ class _HomeWidgetState extends State<HomeWidget> {
                     } else {
                     } else {
                       routeToPage(
                       routeToPage(
                         context,
                         context,
-                        BackupFolderSelectionPage(
+                        const BackupFolderSelectionPage(
                           buttonText: "Start backup",
                           buttonText: "Start backup",
                         ),
                         ),
                       );
                       );
@@ -504,7 +507,7 @@ class _HomeWidgetState extends State<HomeWidget> {
             ),
             ),
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(50)),
+        const Padding(padding: EdgeInsets.all(50)),
       ],
       ],
     );
     );
   }
   }
@@ -607,11 +610,11 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     bool filesAreSelected = widget.selectedFiles.files.isNotEmpty;
     bool filesAreSelected = widget.selectedFiles.files.isNotEmpty;
     return AnimatedContainer(
     return AnimatedContainer(
-      duration: Duration(milliseconds: 300),
+      duration: const Duration(milliseconds: 300),
       curve: Curves.easeInOut,
       curve: Curves.easeInOut,
       height: filesAreSelected ? 0 : 52,
       height: filesAreSelected ? 0 : 52,
       child: AnimatedOpacity(
       child: AnimatedOpacity(
-        duration: Duration(milliseconds: 100),
+        duration: const Duration(milliseconds: 100),
         opacity: filesAreSelected ? 0.0 : 1.0,
         opacity: filesAreSelected ? 0.0 : 1.0,
         curve: Curves.easeIn,
         curve: Curves.easeIn,
         child: IgnorePointer(
         child: IgnorePointer(
@@ -642,8 +645,8 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                                 .colorScheme
                                 .colorScheme
                                 .gNavBarActiveColor,
                                 .gNavBarActiveColor,
                             iconSize: 24,
                             iconSize: 24,
-                            padding: EdgeInsets.fromLTRB(16, 8, 16, 8),
-                            duration: Duration(milliseconds: 200),
+                            padding: const EdgeInsets.fromLTRB(16, 8, 16, 8),
+                            duration: const Duration(milliseconds: 200),
                             gap: 0,
                             gap: 0,
                             tabBorderRadius: 24,
                             tabBorderRadius: 24,
                             tabBackgroundColor: Theme.of(context)
                             tabBackgroundColor: Theme.of(context)
@@ -652,7 +655,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                             haptic: false,
                             haptic: false,
                             tabs: [
                             tabs: [
                               GButton(
                               GButton(
-                                margin: EdgeInsets.fromLTRB(6, 6, 0, 6),
+                                margin: const EdgeInsets.fromLTRB(6, 6, 0, 6),
                                 icon: Icons.home,
                                 icon: Icons.home,
                                 iconColor:
                                 iconColor:
                                     Theme.of(context).colorScheme.gNavIconColor,
                                     Theme.of(context).colorScheme.gNavIconColor,
@@ -667,7 +670,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                                 },
                                 },
                               ),
                               ),
                               GButton(
                               GButton(
-                                margin: EdgeInsets.fromLTRB(0, 6, 0, 6),
+                                margin: const EdgeInsets.fromLTRB(0, 6, 0, 6),
                                 icon: Icons.photo_library,
                                 icon: Icons.photo_library,
                                 iconColor:
                                 iconColor:
                                     Theme.of(context).colorScheme.gNavIconColor,
                                     Theme.of(context).colorScheme.gNavIconColor,
@@ -682,7 +685,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                                 },
                                 },
                               ),
                               ),
                               GButton(
                               GButton(
-                                margin: EdgeInsets.fromLTRB(0, 6, 0, 6),
+                                margin: const EdgeInsets.fromLTRB(0, 6, 0, 6),
                                 icon: Icons.folder_shared,
                                 icon: Icons.folder_shared,
                                 iconColor:
                                 iconColor:
                                     Theme.of(context).colorScheme.gNavIconColor,
                                     Theme.of(context).colorScheme.gNavIconColor,
@@ -697,7 +700,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                                 },
                                 },
                               ),
                               ),
                               GButton(
                               GButton(
-                                margin: EdgeInsets.fromLTRB(0, 6, 6, 6),
+                                margin: const EdgeInsets.fromLTRB(0, 6, 6, 6),
                                 icon: Icons.person,
                                 icon: Icons.person,
                                 iconColor:
                                 iconColor:
                                     Theme.of(context).colorScheme.gNavIconColor,
                                     Theme.of(context).colorScheme.gNavIconColor,

+ 6 - 6
lib/ui/huge_listview/draggable_scrollbar.dart

@@ -39,8 +39,8 @@ class DraggableScrollbar extends StatefulWidget {
 
 
 class DraggableScrollbarState extends State<DraggableScrollbar>
 class DraggableScrollbarState extends State<DraggableScrollbar>
     with TickerProviderStateMixin {
     with TickerProviderStateMixin {
-  static final thumbAnimationDuration = Duration(milliseconds: 1000);
-  static final labelAnimationDuration = Duration(milliseconds: 1000);
+  static const thumbAnimationDuration = Duration(milliseconds: 1000);
+  static const labelAnimationDuration = Duration(milliseconds: 1000);
   double thumbOffset = 0.0;
   double thumbOffset = 0.0;
   bool isDragging = false;
   bool isDragging = false;
   int currentFirstIndex;
   int currentFirstIndex;
@@ -194,28 +194,28 @@ class DraggableScrollbarState extends State<DraggableScrollbar>
         onDragUpdate(
         onDragUpdate(
           DragUpdateDetails(
           DragUpdateDetails(
             globalPosition: Offset.zero,
             globalPosition: Offset.zero,
-            delta: Offset(0, 2),
+            delta: const Offset(0, 2),
           ),
           ),
         );
         );
       } else if (value.logicalKey == LogicalKeyboardKey.arrowUp) {
       } else if (value.logicalKey == LogicalKeyboardKey.arrowUp) {
         onDragUpdate(
         onDragUpdate(
           DragUpdateDetails(
           DragUpdateDetails(
             globalPosition: Offset.zero,
             globalPosition: Offset.zero,
-            delta: Offset(0, -2),
+            delta: const Offset(0, -2),
           ),
           ),
         );
         );
       } else if (value.logicalKey == LogicalKeyboardKey.pageDown) {
       } else if (value.logicalKey == LogicalKeyboardKey.pageDown) {
         onDragUpdate(
         onDragUpdate(
           DragUpdateDetails(
           DragUpdateDetails(
             globalPosition: Offset.zero,
             globalPosition: Offset.zero,
-            delta: Offset(0, 25),
+            delta: const Offset(0, 25),
           ),
           ),
         );
         );
       } else if (value.logicalKey == LogicalKeyboardKey.pageUp) {
       } else if (value.logicalKey == LogicalKeyboardKey.pageUp) {
         onDragUpdate(
         onDragUpdate(
           DragUpdateDetails(
           DragUpdateDetails(
             globalPosition: Offset.zero,
             globalPosition: Offset.zero,
-            delta: Offset(0, -25),
+            delta: const Offset(0, -25),
           ),
           ),
         );
         );
       }
       }

+ 4 - 4
lib/ui/huge_listview/lazy_loading_gallery.dart

@@ -284,15 +284,15 @@ class _LazyLoadingGridViewState extends State<LazyLoadingGridView> {
     return GridView.builder(
     return GridView.builder(
       shrinkWrap: true,
       shrinkWrap: true,
       physics:
       physics:
-          NeverScrollableScrollPhysics(), // to disable GridView's scrolling
+          const NeverScrollableScrollPhysics(), // to disable GridView's scrolling
       itemBuilder: (context, index) {
       itemBuilder: (context, index) {
         return _buildFile(context, widget.files[index]);
         return _buildFile(context, widget.files[index]);
       },
       },
       itemCount: widget.files.length,
       itemCount: widget.files.length,
-      gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+      gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
         crossAxisCount: 4,
         crossAxisCount: 4,
       ),
       ),
-      padding: EdgeInsets.all(0),
+      padding: const EdgeInsets.all(0),
     );
     );
   }
   }
 
 
@@ -338,7 +338,7 @@ class _LazyLoadingGridViewState extends State<LazyLoadingGridView> {
               ),
               ),
               Visibility(
               Visibility(
                 visible: widget.selectedFiles.isFileSelected(file),
                 visible: widget.selectedFiles.isFileSelected(file),
-                child: Positioned(
+                child: const Positioned(
                   right: 4,
                   right: 4,
                   top: 4,
                   top: 4,
                   child: Icon(
                   child: Icon(

+ 3 - 3
lib/ui/huge_listview/place_holder_widget.dart

@@ -14,9 +14,9 @@ class PlaceHolderWidget extends StatelessWidget {
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     if (!_gridViewCache.containsKey(count)) {
     if (!_gridViewCache.containsKey(count)) {
       _gridViewCache[count] = GridView.builder(
       _gridViewCache[count] = GridView.builder(
-        padding: EdgeInsets.all(0),
+        padding: const EdgeInsets.all(0),
         shrinkWrap: true,
         shrinkWrap: true,
-        physics: NeverScrollableScrollPhysics(),
+        physics: const NeverScrollableScrollPhysics(),
         itemBuilder: (context, index) {
         itemBuilder: (context, index) {
           return Container(
           return Container(
             margin: const EdgeInsets.all(2.0),
             margin: const EdgeInsets.all(2.0),
@@ -24,7 +24,7 @@ class PlaceHolderWidget extends StatelessWidget {
           );
           );
         },
         },
         itemCount: count,
         itemCount: count,
-        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+        gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
           crossAxisCount: 4,
           crossAxisCount: 4,
         ),
         ),
       );
       );

+ 6 - 6
lib/ui/huge_listview/scroll_bar_thumb.dart

@@ -32,7 +32,7 @@ class ScrollBarThumb extends StatelessWidget {
         FadeTransition(
         FadeTransition(
           opacity: labelAnimation,
           opacity: labelAnimation,
           child: Container(
           child: Container(
-            padding: EdgeInsets.fromLTRB(20, 12, 20, 12),
+            padding: const EdgeInsets.fromLTRB(20, 12, 20, 12),
             decoration: BoxDecoration(
             decoration: BoxDecoration(
               borderRadius: BorderRadius.circular(10),
               borderRadius: BorderRadius.circular(10),
               color: backgroundColor,
               color: backgroundColor,
@@ -48,7 +48,7 @@ class ScrollBarThumb extends StatelessWidget {
             ),
             ),
           ),
           ),
         ),
         ),
-        Padding(
+        const Padding(
           padding: EdgeInsets.all(12),
           padding: EdgeInsets.all(12),
         ),
         ),
         GestureDetector(
         GestureDetector(
@@ -65,8 +65,8 @@ class ScrollBarThumb extends StatelessWidget {
                 borderRadius: BorderRadius.only(
                 borderRadius: BorderRadius.only(
                   topLeft: Radius.circular(height),
                   topLeft: Radius.circular(height),
                   bottomLeft: Radius.circular(height),
                   bottomLeft: Radius.circular(height),
-                  topRight: Radius.circular(4.0),
-                  bottomRight: Radius.circular(4.0),
+                  topRight: const Radius.circular(4.0),
+                  bottomRight: const Radius.circular(4.0),
                 ),
                 ),
                 child: Container(
                 child: Container(
                   constraints: BoxConstraints.tight(Size(height * 0.6, height)),
                   constraints: BoxConstraints.tight(Size(height * 0.6, height)),
@@ -143,8 +143,8 @@ class SlideFadeTransition extends StatelessWidget {
       builder: (context, child) => animation.value == 0.0 ? Container() : child,
       builder: (context, child) => animation.value == 0.0 ? Container() : child,
       child: SlideTransition(
       child: SlideTransition(
         position: Tween(
         position: Tween(
-          begin: Offset(0.3, 0.0),
-          end: Offset(0.0, 0.0),
+          begin: const Offset(0.3, 0.0),
+          end: const Offset(0.0, 0.0),
         ).animate(animation),
         ).animate(animation),
         child: FadeTransition(
         child: FadeTransition(
           opacity: animation,
           opacity: animation,

+ 18 - 18
lib/ui/landing_page_widget.dart

@@ -31,8 +31,8 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
       child: SingleChildScrollView(
       child: SingleChildScrollView(
         child: Column(
         child: Column(
           children: [
           children: [
-            Padding(padding: const EdgeInsets.all(12)),
-            Text(
+            const Padding(padding: EdgeInsets.all(12)),
+            const Text(
               "ente",
               "ente",
               style: TextStyle(
               style: TextStyle(
                 fontWeight: FontWeight.bold,
                 fontWeight: FontWeight.bold,
@@ -40,11 +40,11 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
                 fontSize: 42,
                 fontSize: 42,
               ),
               ),
             ),
             ),
-            Padding(
+            const Padding(
               padding: EdgeInsets.all(28),
               padding: EdgeInsets.all(28),
             ),
             ),
             _getFeatureSlider(),
             _getFeatureSlider(),
-            Padding(
+            const Padding(
               padding: EdgeInsets.all(12),
               padding: EdgeInsets.all(12),
             ),
             ),
             DotsIndicator(
             DotsIndicator(
@@ -60,25 +60,25 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
                 shape: RoundedRectangleBorder(
                 shape: RoundedRectangleBorder(
                   borderRadius: BorderRadius.circular(3),
                   borderRadius: BorderRadius.circular(3),
                 ),
                 ),
-                size: Size(100, 5),
-                activeSize: Size(100, 5),
-                spacing: EdgeInsets.all(3),
+                size: const Size(100, 5),
+                activeSize: const Size(100, 5),
+                spacing: const EdgeInsets.all(3),
               ),
               ),
             ),
             ),
-            Padding(
+            const Padding(
               padding: EdgeInsets.all(28),
               padding: EdgeInsets.all(28),
             ),
             ),
             _getSignUpButton(context),
             _getSignUpButton(context),
             Container(
             Container(
               width: double.infinity,
               width: double.infinity,
-              padding: EdgeInsets.fromLTRB(20, 12, 20, 28),
+              padding: const EdgeInsets.fromLTRB(20, 12, 20, 28),
               child: Hero(
               child: Hero(
                 tag: "log_in",
                 tag: "log_in",
                 child: ElevatedButton(
                 child: ElevatedButton(
                   style:
                   style:
                       Theme.of(context).colorScheme.optionalActionButtonStyle,
                       Theme.of(context).colorScheme.optionalActionButtonStyle,
                   onPressed: _navigateToSignInPage,
                   onPressed: _navigateToSignInPage,
-                  child: Text(
+                  child: const Text(
                     "Existing user",
                     "Existing user",
                     style: TextStyle(
                     style: TextStyle(
                       color: Colors.black, // same for both themes
                       color: Colors.black, // same for both themes
@@ -87,7 +87,7 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
                 ),
                 ),
               ),
               ),
             ),
             ),
-            Padding(
+            const Padding(
               padding: EdgeInsets.all(20),
               padding: EdgeInsets.all(20),
             ),
             ),
           ],
           ],
@@ -99,7 +99,7 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
   Widget _getSignUpButton(BuildContext context) {
   Widget _getSignUpButton(BuildContext context) {
     return Container(
     return Container(
       width: double.infinity,
       width: double.infinity,
-      padding: EdgeInsets.symmetric(horizontal: 20),
+      padding: const EdgeInsets.symmetric(horizontal: 20),
       child: GradientButton(
       child: GradientButton(
         onTap: _navigateToSignUpPage,
         onTap: _navigateToSignUpPage,
         text: "New to ente",
         text: "New to ente",
@@ -109,16 +109,16 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
 
 
   Widget _getFeatureSlider() {
   Widget _getFeatureSlider() {
     return ConstrainedBox(
     return ConstrainedBox(
-      constraints: BoxConstraints(maxHeight: 320),
+      constraints: const BoxConstraints(maxHeight: 320),
       child: PageView(
       child: PageView(
         children: [
         children: [
-          FeatureItemWidget(
+          const FeatureItemWidget(
             "assets/onboarding_lock.png",
             "assets/onboarding_lock.png",
             "Private backups",
             "Private backups",
             "for your memories",
             "for your memories",
             "End-to-end encrypted by default",
             "End-to-end encrypted by default",
           ),
           ),
-          FeatureItemWidget(
+          const FeatureItemWidget(
             "assets/onboarding_safe.png",
             "assets/onboarding_safe.png",
             "Safely stored",
             "Safely stored",
             "at a fallout shelter",
             "at a fallout shelter",
@@ -218,7 +218,7 @@ class FeatureItemWidget extends StatelessWidget {
           assetPath,
           assetPath,
           height: 160,
           height: 160,
         ),
         ),
-        Padding(padding: EdgeInsets.all(16)),
+        const Padding(padding: EdgeInsets.all(16)),
         Column(
         Column(
           crossAxisAlignment: CrossAxisAlignment.center,
           crossAxisAlignment: CrossAxisAlignment.center,
           mainAxisAlignment: MainAxisAlignment.start,
           mainAxisAlignment: MainAxisAlignment.start,
@@ -227,12 +227,12 @@ class FeatureItemWidget extends StatelessWidget {
               featureTitleFirstLine,
               featureTitleFirstLine,
               style: Theme.of(context).textTheme.headline5,
               style: Theme.of(context).textTheme.headline5,
             ),
             ),
-            Padding(padding: EdgeInsets.all(2)),
+            const Padding(padding: EdgeInsets.all(2)),
             Text(
             Text(
               featureTitleSecondLine,
               featureTitleSecondLine,
               style: Theme.of(context).textTheme.headline5,
               style: Theme.of(context).textTheme.headline5,
             ),
             ),
-            Padding(padding: EdgeInsets.all(12)),
+            const Padding(padding: EdgeInsets.all(12)),
             Text(
             Text(
               subText,
               subText,
               textAlign: TextAlign.center,
               textAlign: TextAlign.center,

+ 5 - 5
lib/ui/loading_photos_widget.dart

@@ -45,7 +45,7 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
         } else {
         } else {
           routeToPage(
           routeToPage(
             context,
             context,
-            BackupFolderSelectionPage(
+            const BackupFolderSelectionPage(
               isOnboarding: true,
               isOnboarding: true,
               buttonText: "Start backup",
               buttonText: "Start backup",
             ),
             ),
@@ -53,7 +53,7 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
         }
         }
       }
       }
     });
     });
-    Timer.periodic(Duration(seconds: 5), (Timer timer) {
+    Timer.periodic(const Duration(seconds: 5), (Timer timer) {
       if (!mounted) {
       if (!mounted) {
         return;
         return;
       }
       }
@@ -65,7 +65,7 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
 
 
       _pageController.animateToPage(
       _pageController.animateToPage(
         _currentPage,
         _currentPage,
-        duration: Duration(milliseconds: 300),
+        duration: const Duration(milliseconds: 300),
         curve: Curves.easeIn,
         curve: Curves.easeIn,
       );
       );
     });
     });
@@ -149,9 +149,9 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
                               return _getMessage(_messages[index]);
                               return _getMessage(_messages[index]);
                             },
                             },
                             itemCount: _messages.length,
                             itemCount: _messages.length,
-                            physics: NeverScrollableScrollPhysics(),
+                            physics: const NeverScrollableScrollPhysics(),
                           ),
                           ),
-                          Positioned(
+                          const Positioned(
                             bottom: 0,
                             bottom: 0,
                             left: 0,
                             left: 0,
                             right: 0,
                             right: 0,

+ 13 - 13
lib/ui/memories_widget.dart

@@ -25,7 +25,7 @@ class MemoriesWidget extends StatelessWidget {
             crossAxisAlignment: CrossAxisAlignment.start,
             crossAxisAlignment: CrossAxisAlignment.start,
             children: [
             children: [
               _buildMemories(snapshot.data),
               _buildMemories(snapshot.data),
-              Divider(),
+              const Divider(),
             ],
             ],
           );
           );
         }
         }
@@ -106,7 +106,7 @@ class _MemoryWidgetState extends State<MemoryWidget> {
           child: Column(
           child: Column(
             children: [
             children: [
               _buildMemoryItem(context, index),
               _buildMemoryItem(context, index),
-              Padding(padding: EdgeInsets.all(4)),
+              const Padding(padding: EdgeInsets.all(4)),
               Hero(
               Hero(
                 tag: title,
                 tag: title,
                 child: Material(
                 child: Material(
@@ -134,7 +134,7 @@ class _MemoryWidgetState extends State<MemoryWidget> {
     return Container(
     return Container(
       decoration: BoxDecoration(
       decoration: BoxDecoration(
         border: isSeen
         border: isSeen
-            ? Border()
+            ? const Border()
             : Border.all(
             : Border.all(
                 color: Theme.of(context).buttonColor,
                 color: Theme.of(context).buttonColor,
                 width: isSeen ? 0 : 2,
                 width: isSeen ? 0 : 2,
@@ -218,7 +218,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
   void initState() {
   void initState() {
     super.initState();
     super.initState();
     _index = widget.index;
     _index = widget.index;
-    Future.delayed(Duration(seconds: 3), () {
+    Future.delayed(const Duration(seconds: 3), () {
       if (mounted) {
       if (mounted) {
         setState(() {
         setState(() {
           _opacity = 0;
           _opacity = 0;
@@ -246,7 +246,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
               selectedColor: Colors.white, //same for both themes
               selectedColor: Colors.white, //same for both themes
               unselectedColor: Colors.white.withOpacity(0.4),
               unselectedColor: Colors.white.withOpacity(0.4),
             ),
             ),
-            SizedBox(
+            const SizedBox(
               height: 18,
               height: 18,
             ),
             ),
             Row(
             Row(
@@ -257,7 +257,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
                     onTap: () {
                     onTap: () {
                       Navigator.pop(context);
                       Navigator.pop(context);
                     },
                     },
-                    child: Icon(
+                    child: const Icon(
                       Icons.close,
                       Icons.close,
                       color: Colors.white, //same for both themes
                       color: Colors.white, //same for both themes
                     ),
                     ),
@@ -290,7 +290,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
             ),
             ),
           ),
           ),
         ),
         ),
-        backgroundColor: Color(0x00000000),
+        backgroundColor: const Color(0x00000000),
         elevation: 0,
         elevation: 0,
       ),
       ),
       extendBodyBehindAppBar: true,
       extendBodyBehindAppBar: true,
@@ -314,7 +314,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
       tag: widget.title,
       tag: widget.title,
       child: Container(
       child: Container(
         alignment: Alignment.bottomCenter,
         alignment: Alignment.bottomCenter,
-        padding: EdgeInsets.fromLTRB(0, 0, 0, 28),
+        padding: const EdgeInsets.fromLTRB(0, 0, 0, 28),
         child: _showCounter
         child: _showCounter
             ? Text(
             ? Text(
                 '${_index + 1}/${widget.memories.length}',
                 '${_index + 1}/${widget.memories.length}',
@@ -325,7 +325,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
               )
               )
             : AnimatedOpacity(
             : AnimatedOpacity(
                 opacity: _opacity,
                 opacity: _opacity,
-                duration: Duration(milliseconds: 500),
+                duration: const Duration(milliseconds: 500),
                 child: Text(
                 child: Text(
                   widget.title,
                   widget.title,
                   style: Theme.of(context)
                   style: Theme.of(context)
@@ -342,7 +342,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
     final file = widget.memories[_index].file;
     final file = widget.memories[_index].file;
     return Container(
     return Container(
       alignment: Alignment.bottomRight,
       alignment: Alignment.bottomRight,
-      padding: EdgeInsets.fromLTRB(0, 0, 26, 20),
+      padding: const EdgeInsets.fromLTRB(0, 0, 26, 20),
       child: IconButton(
       child: IconButton(
         icon: Icon(
         icon: Icon(
           Icons.adaptive.share,
           Icons.adaptive.share,
@@ -392,7 +392,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
               _shouldDisableScroll = value;
               _shouldDisableScroll = value;
             });
             });
           },
           },
-          backgroundDecoration: BoxDecoration(
+          backgroundDecoration: const BoxDecoration(
             color: Colors.transparent,
             color: Colors.transparent,
           ),
           ),
         );
         );
@@ -407,8 +407,8 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
         });
         });
       },
       },
       physics: _shouldDisableScroll
       physics: _shouldDisableScroll
-          ? NeverScrollableScrollPhysics()
-          : PageScrollPhysics(),
+          ? const NeverScrollableScrollPhysics()
+          : const PageScrollPhysics(),
     );
     );
   }
   }
 }
 }

+ 5 - 5
lib/ui/payment/billing_questions_widget.dart

@@ -27,8 +27,8 @@ class BillingQuestionsWidget extends StatelessWidget {
         if (snapshot.hasData) {
         if (snapshot.hasData) {
           final faqs = <Widget>[];
           final faqs = <Widget>[];
           faqs.add(
           faqs.add(
-            Padding(
-              padding: const EdgeInsets.all(24),
+            const Padding(
+              padding: EdgeInsets.all(24),
               child: Text(
               child: Text(
                 "FAQs",
                 "FAQs",
                 style: TextStyle(
                 style: TextStyle(
@@ -42,7 +42,7 @@ class BillingQuestionsWidget extends StatelessWidget {
             faqs.add(FaqWidget(faq: faq));
             faqs.add(FaqWidget(faq: faq));
           }
           }
           faqs.add(
           faqs.add(
-            Padding(
+            const Padding(
               padding: EdgeInsets.all(16),
               padding: EdgeInsets.all(16),
             ),
             ),
           );
           );
@@ -70,7 +70,7 @@ class FaqWidget extends StatelessWidget {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return Padding(
     return Padding(
-      padding: EdgeInsets.all(2),
+      padding: const EdgeInsets.all(2),
       child: ExpansionTileCard(
       child: ExpansionTileCard(
         elevation: 0,
         elevation: 0,
         title: Text(faq.q),
         title: Text(faq.q),
@@ -85,7 +85,7 @@ class FaqWidget extends StatelessWidget {
             ),
             ),
             child: Text(
             child: Text(
               faq.a,
               faq.a,
-              style: TextStyle(
+              style: const TextStyle(
                 height: 1.5,
                 height: 1.5,
               ),
               ),
             ),
             ),

+ 17 - 16
lib/ui/payment/child_subscription_widget.dart

@@ -28,23 +28,24 @@ class ChildSubscriptionWidget extends StatelessWidget {
               style: Theme.of(context).textTheme.bodyText1,
               style: Theme.of(context).textTheme.bodyText1,
             ),
             ),
           ),
           ),
-          Padding(
-            padding: const EdgeInsets.symmetric(vertical: 8),
+          const Padding(
+            padding: EdgeInsets.symmetric(vertical: 8),
           ),
           ),
           Padding(
           Padding(
-            padding: EdgeInsets.symmetric(horizontal: 16),
+            padding: const EdgeInsets.symmetric(horizontal: 16),
             child: RichText(
             child: RichText(
               textAlign: TextAlign.center,
               textAlign: TextAlign.center,
               text: TextSpan(
               text: TextSpan(
                 children: [
                 children: [
-                  TextSpan(
+                  const TextSpan(
                     text: "Please contact ",
                     text: "Please contact ",
                   ),
                   ),
                   TextSpan(
                   TextSpan(
                     text: familyAdmin,
                     text: familyAdmin,
-                    style: TextStyle(color: Color.fromRGBO(29, 185, 84, 1)),
+                    style:
+                        const TextStyle(color: Color.fromRGBO(29, 185, 84, 1)),
                   ),
                   ),
-                  TextSpan(
+                  const TextSpan(
                     text: " to manage your subscription",
                     text: " to manage your subscription",
                   ),
                   ),
                 ],
                 ],
@@ -52,15 +53,15 @@ class ChildSubscriptionWidget extends StatelessWidget {
               ),
               ),
             ),
             ),
           ),
           ),
-          Padding(
-            padding: const EdgeInsets.symmetric(vertical: 8),
+          const Padding(
+            padding: EdgeInsets.symmetric(vertical: 8),
           ),
           ),
           Image.asset(
           Image.asset(
             "assets/family_plan_leave.png",
             "assets/family_plan_leave.png",
             height: 256,
             height: 256,
           ),
           ),
-          Padding(
-            padding: const EdgeInsets.symmetric(vertical: 0),
+          const Padding(
+            padding: EdgeInsets.symmetric(vertical: 0),
           ),
           ),
           InkWell(
           InkWell(
             child: OutlinedButton(
             child: OutlinedButton(
@@ -68,10 +69,11 @@ class ChildSubscriptionWidget extends StatelessWidget {
                 shape: RoundedRectangleBorder(
                 shape: RoundedRectangleBorder(
                   borderRadius: BorderRadius.circular(10),
                   borderRadius: BorderRadius.circular(10),
                 ),
                 ),
-                padding: EdgeInsets.symmetric(vertical: 18, horizontal: 100),
+                padding:
+                    const EdgeInsets.symmetric(vertical: 18, horizontal: 100),
                 backgroundColor: Colors.red[500],
                 backgroundColor: Colors.red[500],
               ),
               ),
-              child: Text(
+              child: const Text(
                 "Leave Family",
                 "Leave Family",
                 style: TextStyle(
                 style: TextStyle(
                   fontWeight: FontWeight.bold,
                   fontWeight: FontWeight.bold,
@@ -96,10 +98,9 @@ class ChildSubscriptionWidget extends StatelessWidget {
                     ),
                     ),
                     TextSpan(
                     TextSpan(
                       text: "support@ente.io",
                       text: "support@ente.io",
-                      style: Theme.of(context)
-                          .textTheme
-                          .bodyText2
-                          .copyWith(color: Color.fromRGBO(29, 185, 84, 1)),
+                      style: Theme.of(context).textTheme.bodyText2.copyWith(
+                            color: const Color.fromRGBO(29, 185, 84, 1),
+                          ),
                     ),
                     ),
                     TextSpan(
                     TextSpan(
                       text: " for help",
                       text: " for help",

+ 4 - 4
lib/ui/payment/payment_web_page.dart

@@ -142,10 +142,10 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
     return showDialog(
     return showDialog(
       context: context,
       context: context,
       builder: (context) => AlertDialog(
       builder: (context) => AlertDialog(
-        title: Text('Are you sure you want to exit?'),
+        title: const Text('Are you sure you want to exit?'),
         actions: <Widget>[
         actions: <Widget>[
           TextButton(
           TextButton(
-            child: Text(
+            child: const Text(
               'Yes',
               'Yes',
               style: TextStyle(
               style: TextStyle(
                 color: Colors.redAccent,
                 color: Colors.redAccent,
@@ -192,11 +192,11 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
       context: context,
       context: context,
       barrierDismissible: false,
       barrierDismissible: false,
       builder: (context) => AlertDialog(
       builder: (context) => AlertDialog(
-        title: Text('Payment failed'),
+        title: const Text('Payment failed'),
         content: Text("Unfortunately your payment failed due to $reason"),
         content: Text("Unfortunately your payment failed due to $reason"),
         actions: <Widget>[
         actions: <Widget>[
           TextButton(
           TextButton(
-            child: Text('Ok'),
+            child: const Text('Ok'),
             onPressed: () {
             onPressed: () {
               Navigator.of(context).pop('dialog');
               Navigator.of(context).pop('dialog');
             },
             },

+ 2 - 2
lib/ui/payment/skip_subscription_widget.dart

@@ -34,7 +34,7 @@ class SkipSubscriptionWidget extends StatelessWidget {
           Navigator.of(context).pushAndRemoveUntil(
           Navigator.of(context).pushAndRemoveUntil(
             MaterialPageRoute(
             MaterialPageRoute(
               builder: (BuildContext context) {
               builder: (BuildContext context) {
-                return HomeWidget();
+                return const HomeWidget();
               },
               },
             ),
             ),
             (route) => false,
             (route) => false,
@@ -42,7 +42,7 @@ class SkipSubscriptionWidget extends StatelessWidget {
           BillingService.instance
           BillingService.instance
               .verifySubscription(kFreeProductID, "", paymentProvider: "ente");
               .verifySubscription(kFreeProductID, "", paymentProvider: "ente");
         },
         },
-        child: Text("Continue on free plan"),
+        child: const Text("Continue on free plan"),
       ),
       ),
     );
     );
   }
   }

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

@@ -114,14 +114,14 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     final appBar = PreferredSize(
     final appBar = PreferredSize(
-      preferredSize: Size(double.infinity, 60),
+      preferredSize: const Size(double.infinity, 60),
       child: Container(
       child: Container(
         decoration: BoxDecoration(
         decoration: BoxDecoration(
           boxShadow: [
           boxShadow: [
             BoxShadow(
             BoxShadow(
               color: Theme.of(context).backgroundColor,
               color: Theme.of(context).backgroundColor,
               blurRadius: 16,
               blurRadius: 16,
-              offset: Offset(0, 8),
+              offset: const Offset(0, 8),
             )
             )
           ],
           ],
         ),
         ),
@@ -134,7 +134,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
                     totalSteps: 4,
                     totalSteps: 4,
                     currentStep: 4,
                     currentStep: 4,
                     selectedColor: Theme.of(context).buttonColor,
                     selectedColor: Theme.of(context).buttonColor,
-                    roundedEdges: Radius.circular(10),
+                    roundedEdges: const Radius.circular(10),
                     unselectedColor: Theme.of(context)
                     unselectedColor: Theme.of(context)
                         .colorScheme
                         .colorScheme
                         .stepProgressUnselectedColor,
                         .stepProgressUnselectedColor,
@@ -143,7 +143,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
               )
               )
             : AppBar(
             : AppBar(
                 elevation: 0,
                 elevation: 0,
-                title: Text("Subscription"),
+                title: const Text("Subscription"),
               ),
               ),
       ),
       ),
     );
     );
@@ -153,7 +153,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
         alignment: Alignment.bottomCenter,
         alignment: Alignment.bottomCenter,
         children: [
         children: [
           _getBody(),
           _getBody(),
-          BottomShadowWidget(
+          const BottomShadowWidget(
             offsetDy: 40,
             offsetDy: 40,
           )
           )
         ],
         ],
@@ -192,7 +192,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
         mainAxisAlignment: MainAxisAlignment.center,
         mainAxisAlignment: MainAxisAlignment.center,
         children: _getStripePlanWidgets(),
         children: _getStripePlanWidgets(),
       ),
       ),
-      Padding(padding: EdgeInsets.all(4)),
+      const Padding(padding: EdgeInsets.all(4)),
     ]);
     ]);
 
 
     widgets.add(_showSubscriptionToggle());
     widgets.add(_showSubscriptionToggle());
@@ -205,7 +205,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
       if (widget.isOnboarding) {
       if (widget.isOnboarding) {
         widgets.add(SkipSubscriptionWidget(freePlan: _freePlan));
         widgets.add(SkipSubscriptionWidget(freePlan: _freePlan));
       }
       }
-      widgets.add(SubFaqWidget());
+      widgets.add(const SubFaqWidget());
     }
     }
 
 
     // only active subscription can be renewed/canceled
     // only active subscription can be renewed/canceled
@@ -241,7 +241,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
               }
               }
             },
             },
             child: Container(
             child: Container(
-              padding: EdgeInsets.fromLTRB(40, 80, 40, 20),
+              padding: const EdgeInsets.fromLTRB(40, 80, 40, 20),
               child: Column(
               child: Column(
                 children: [
                 children: [
                   RichText(
                   RichText(
@@ -277,7 +277,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
               await _launchFamilyPortal();
               await _launchFamilyPortal();
             },
             },
             child: Container(
             child: Container(
-              padding: EdgeInsets.fromLTRB(40, 0, 40, 80),
+              padding: const EdgeInsets.fromLTRB(40, 0, 40, 80),
               child: Column(
               child: Column(
                 children: [
                 children: [
                   RichText(
                   RichText(
@@ -511,8 +511,8 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
     }
     }
 
 
     return Container(
     return Container(
-      padding: EdgeInsets.only(left: 8, right: 8, top: 4, bottom: 4),
-      margin: EdgeInsets.only(bottom: 12),
+      padding: const EdgeInsets.only(left: 8, right: 8, top: 4, bottom: 4),
+      margin: const EdgeInsets.only(bottom: 12),
       // color: Color.fromRGBO(10, 40, 40, 0.3),
       // color: Color.fromRGBO(10, 40, 40, 0.3),
       child: Row(
       child: Row(
         mainAxisAlignment: MainAxisAlignment.center,
         mainAxisAlignment: MainAxisAlignment.center,

+ 2 - 2
lib/ui/payment/subscription_common_widgets.dart

@@ -121,12 +121,12 @@ class SubFaqWidget extends StatelessWidget {
             barrierColor: Colors.black87,
             barrierColor: Colors.black87,
             context: context,
             context: context,
             builder: (context) {
             builder: (context) {
-              return BillingQuestionsWidget();
+              return const BillingQuestionsWidget();
             },
             },
           );
           );
         },
         },
         child: Container(
         child: Container(
-          padding: EdgeInsets.all(40),
+          padding: const EdgeInsets.all(40),
           child: RichText(
           child: RichText(
             text: TextSpan(
             text: TextSpan(
               text: "Questions?",
               text: "Questions?",

+ 5 - 5
lib/ui/payment/subscription_page.dart

@@ -130,7 +130,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
     }
     }
     _dialog = createProgressDialog(context, "Please wait...");
     _dialog = createProgressDialog(context, "Please wait...");
     final appBar = AppBar(
     final appBar = AppBar(
-      title: widget.isOnboarding ? null : Text("Subscription"),
+      title: widget.isOnboarding ? null : const Text("Subscription"),
     );
     );
     return Scaffold(
     return Scaffold(
       appBar: appBar,
       appBar: appBar,
@@ -188,7 +188,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
             ? _getStripePlanWidgets()
             ? _getStripePlanWidgets()
             : _getMobilePlanWidgets(),
             : _getMobilePlanWidgets(),
       ),
       ),
-      Padding(padding: EdgeInsets.all(8)),
+      const Padding(padding: EdgeInsets.all(8)),
     ]);
     ]);
 
 
     if (_hasActiveSubscription) {
     if (_hasActiveSubscription) {
@@ -199,7 +199,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
       if (widget.isOnboarding) {
       if (widget.isOnboarding) {
         widgets.add(SkipSubscriptionWidget(freePlan: _freePlan));
         widgets.add(SkipSubscriptionWidget(freePlan: _freePlan));
       }
       }
-      widgets.add(SubFaqWidget());
+      widgets.add(const SubFaqWidget());
     }
     }
 
 
     if (_hasActiveSubscription &&
     if (_hasActiveSubscription &&
@@ -223,7 +223,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
               }
               }
             },
             },
             child: Container(
             child: Container(
-              padding: EdgeInsets.fromLTRB(40, 80, 40, 20),
+              padding: const EdgeInsets.fromLTRB(40, 80, 40, 20),
               child: Column(
               child: Column(
                 children: [
                 children: [
                   RichText(
                   RichText(
@@ -258,7 +258,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
               _launchFamilyPortal();
               _launchFamilyPortal();
             },
             },
             child: Container(
             child: Container(
-              padding: EdgeInsets.fromLTRB(40, 0, 40, 80),
+              padding: const EdgeInsets.fromLTRB(40, 0, 40, 80),
               child: Column(
               child: Column(
                 children: [
                 children: [
                   RichText(
                   RichText(

+ 5 - 4
lib/ui/payment/subscription_plan_widget.dart

@@ -29,13 +29,14 @@ class SubscriptionPlanWidget extends StatelessWidget {
       padding: EdgeInsets.symmetric(horizontal: isActive ? 8 : 16, vertical: 4),
       padding: EdgeInsets.symmetric(horizontal: isActive ? 8 : 16, vertical: 4),
       child: Container(
       child: Container(
         decoration: BoxDecoration(
         decoration: BoxDecoration(
-          color:
-              isActive ? Color(0xFF22763F) : Color.fromRGBO(240, 240, 240, 1.0),
+          color: isActive
+              ? const Color(0xFF22763F)
+              : const Color.fromRGBO(240, 240, 240, 1.0),
           gradient: isActive
           gradient: isActive
-              ? LinearGradient(
+              ? const LinearGradient(
                   begin: Alignment.centerLeft,
                   begin: Alignment.centerLeft,
                   end: Alignment.centerRight,
                   end: Alignment.centerRight,
-                  colors: const [
+                  colors: [
                     Color(0xFF2CD267),
                     Color(0xFF2CD267),
                     Color(0xFF1DB954),
                     Color(0xFF1DB954),
                   ],
                   ],

+ 11 - 7
lib/ui/settings/account_section_widget.dart

@@ -26,7 +26,7 @@ class AccountSectionWidgetState extends State<AccountSectionWidget> {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return ExpandablePanel(
     return ExpandablePanel(
-      header: SettingsSectionTitle("Account"),
+      header: const SettingsSectionTitle("Account"),
       collapsed: Container(),
       collapsed: Container(),
       expanded: _getSectionOptions(context),
       expanded: _getSectionOptions(context),
       theme: getExpandableTheme(context),
       theme: getExpandableTheme(context),
@@ -66,8 +66,10 @@ class AccountSectionWidgetState extends State<AccountSectionWidget> {
               ),
               ),
             );
             );
           },
           },
-          child:
-              SettingsTextItem(text: "Recovery key", icon: Icons.navigate_next),
+          child: const SettingsTextItem(
+            text: "Recovery key",
+            icon: Icons.navigate_next,
+          ),
         ),
         ),
         sectionOptionDivider,
         sectionOptionDivider,
         GestureDetector(
         GestureDetector(
@@ -85,14 +87,16 @@ class AccountSectionWidgetState extends State<AccountSectionWidget> {
             showDialog(
             showDialog(
               context: context,
               context: context,
               builder: (BuildContext context) {
               builder: (BuildContext context) {
-                return ChangeEmailDialog();
+                return const ChangeEmailDialog();
               },
               },
               barrierColor: Colors.black.withOpacity(0.85),
               barrierColor: Colors.black.withOpacity(0.85),
               barrierDismissible: false,
               barrierDismissible: false,
             );
             );
           },
           },
-          child:
-              SettingsTextItem(text: "Change email", icon: Icons.navigate_next),
+          child: const SettingsTextItem(
+            text: "Change email",
+            icon: Icons.navigate_next,
+          ),
         ),
         ),
         sectionOptionDivider,
         sectionOptionDivider,
         GestureDetector(
         GestureDetector(
@@ -117,7 +121,7 @@ class AccountSectionWidgetState extends State<AccountSectionWidget> {
               ),
               ),
             );
             );
           },
           },
-          child: SettingsTextItem(
+          child: const SettingsTextItem(
             text: "Change password",
             text: "Change password",
             icon: Icons.navigate_next,
             icon: Icons.navigate_next,
           ),
           ),

+ 10 - 10
lib/ui/settings/app_update_dialog.dart

@@ -32,24 +32,24 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
       children: [
       children: [
         Text(
         Text(
           widget.latestVersionInfo.name,
           widget.latestVersionInfo.name,
-          style: TextStyle(
+          style: const TextStyle(
             fontSize: 20,
             fontSize: 20,
             fontWeight: FontWeight.bold,
             fontWeight: FontWeight.bold,
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(8)),
-        Text(
+        const Padding(padding: EdgeInsets.all(8)),
+        const Text(
           "Changelog",
           "Changelog",
           style: TextStyle(
           style: TextStyle(
             fontSize: 18,
             fontSize: 18,
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(4)),
+        const Padding(padding: EdgeInsets.all(4)),
         Column(
         Column(
           crossAxisAlignment: CrossAxisAlignment.start,
           crossAxisAlignment: CrossAxisAlignment.start,
           children: changelog,
           children: changelog,
         ),
         ),
-        Padding(padding: EdgeInsets.all(8)),
+        const Padding(padding: EdgeInsets.all(8)),
         SizedBox(
         SizedBox(
           width: double.infinity,
           width: double.infinity,
           height: 64,
           height: 64,
@@ -71,7 +71,7 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
                 barrierDismissible: false,
                 barrierDismissible: false,
               );
               );
             },
             },
-            child: Text(
+            child: const Text(
               "Update",
               "Update",
             ),
             ),
           ),
           ),
@@ -120,7 +120,7 @@ class _ApkDownloaderDialogState extends State<ApkDownloaderDialog> {
     return WillPopScope(
     return WillPopScope(
       onWillPop: () async => false,
       onWillPop: () async => false,
       child: AlertDialog(
       child: AlertDialog(
-        title: Text(
+        title: const Text(
           "Downloading...",
           "Downloading...",
           style: TextStyle(
           style: TextStyle(
             fontSize: 16,
             fontSize: 16,
@@ -152,11 +152,11 @@ class _ApkDownloaderDialogState extends State<ApkDownloaderDialog> {
     } catch (e) {
     } catch (e) {
       Logger("ApkDownloader").severe(e);
       Logger("ApkDownloader").severe(e);
       AlertDialog alert = AlertDialog(
       AlertDialog alert = AlertDialog(
-        title: Text("Sorry"),
-        content: Text("The download could not be completed"),
+        title: const Text("Sorry"),
+        content: const Text("The download could not be completed"),
         actions: [
         actions: [
           TextButton(
           TextButton(
-            child: Text(
+            child: const Text(
               "Ignore",
               "Ignore",
               style: TextStyle(
               style: TextStyle(
                 color: Colors.white,
                 color: Colors.white,

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

@@ -33,7 +33,7 @@ class _AppVersionWidgetState extends State<AppVersionWidget> {
                 createProgressDialog(context, "Starting network inspector...");
                 createProgressDialog(context, "Starting network inspector...");
             await dialog.show();
             await dialog.show();
             await Future.delayed(
             await Future.delayed(
-              Duration(milliseconds: kDummyDelayDurationInMilliseconds),
+              const Duration(milliseconds: kDummyDelayDurationInMilliseconds),
             );
             );
             await dialog.hide();
             await dialog.hide();
             Network.instance.getAlice().showInspector();
             Network.instance.getAlice().showInspector();

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

@@ -31,7 +31,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return ExpandablePanel(
     return ExpandablePanel(
-      header: SettingsSectionTitle("Backup"),
+      header: const SettingsSectionTitle("Backup"),
       collapsed: Container(),
       collapsed: Container(),
       expanded: _getSectionOptions(context),
       expanded: _getSectionOptions(context),
       theme: getExpandableTheme(context),
       theme: getExpandableTheme(context),
@@ -45,12 +45,12 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
         onTap: () async {
         onTap: () async {
           routeToPage(
           routeToPage(
             context,
             context,
-            BackupFolderSelectionPage(
+            const BackupFolderSelectionPage(
               buttonText: "Backup",
               buttonText: "Backup",
             ),
             ),
           );
           );
         },
         },
-        child: SettingsTextItem(
+        child: const SettingsTextItem(
           text: "Backed up folders",
           text: "Backed up folders",
           icon: Icons.navigate_next,
           icon: Icons.navigate_next,
         ),
         ),
@@ -163,7 +163,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
               }
               }
             }
             }
           },
           },
-          child: SettingsTextItem(
+          child: const SettingsTextItem(
             text: "Free up space",
             text: "Free up space",
             icon: Icons.navigate_next,
             icon: Icons.navigate_next,
           ),
           ),
@@ -199,7 +199,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
               }
               }
             }
             }
           },
           },
-          child: SettingsTextItem(
+          child: const SettingsTextItem(
             text: "Deduplicate files",
             text: "Deduplicate files",
             icon: Icons.navigate_next,
             icon: Icons.navigate_next,
           ),
           ),
@@ -213,7 +213,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
 
 
   void _showSpaceFreedDialog(BackupStatus status) {
   void _showSpaceFreedDialog(BackupStatus status) {
     AlertDialog alert = AlertDialog(
     AlertDialog alert = AlertDialog(
-      title: Text("Success"),
+      title: const Text("Success"),
       content: Text(
       content: Text(
         "You have successfully freed up " + formatBytes(status.size) + "!",
         "You have successfully freed up " + formatBytes(status.size) + "!",
       ),
       ),
@@ -238,7 +238,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
           },
           },
         ),
         ),
         TextButton(
         TextButton(
-          child: Text(
+          child: const Text(
             "Ok",
             "Ok",
           ),
           ),
           onPressed: () {
           onPressed: () {
@@ -269,7 +269,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
         " duplicate file" +
         " duplicate file" +
         (result.count == 1 ? "" : "s");
         (result.count == 1 ? "" : "s");
     AlertDialog alert = AlertDialog(
     AlertDialog alert = AlertDialog(
-      title: Text("✨ Success"),
+      title: const Text("✨ Success"),
       content: Text(
       content: Text(
         "You have cleaned up " +
         "You have cleaned up " +
             countText +
             countText +
@@ -298,7 +298,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
           },
           },
         ),
         ),
         TextButton(
         TextButton(
-          child: Text(
+          child: const Text(
             "Ok",
             "Ok",
           ),
           ),
           onPressed: () {
           onPressed: () {

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

@@ -12,7 +12,7 @@ ExpandableThemeData getExpandableTheme(BuildContext context) {
   return ExpandableThemeData(
   return ExpandableThemeData(
     expandIcon: CupertinoIcons.chevron_down,
     expandIcon: CupertinoIcons.chevron_down,
     collapseIcon: CupertinoIcons.chevron_up,
     collapseIcon: CupertinoIcons.chevron_up,
-    iconPadding: EdgeInsets.all(4),
+    iconPadding: const EdgeInsets.all(4),
     iconColor: Theme.of(context).colorScheme.onSurface,
     iconColor: Theme.of(context).colorScheme.onSurface,
     iconSize: 20.0,
     iconSize: 20.0,
     iconRotationAngle: -3.14 / 2,
     iconRotationAngle: -3.14 / 2,

+ 11 - 10
lib/ui/settings/danger_section_widget.dart

@@ -18,7 +18,7 @@ class _DangerSectionWidgetState extends State<DangerSectionWidget> {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return ExpandablePanel(
     return ExpandablePanel(
-      header: SettingsSectionTitle("Exit", color: Colors.red),
+      header: const SettingsSectionTitle("Exit", color: Colors.red),
       collapsed: Container(),
       collapsed: Container(),
       expanded: _getSectionOptions(context),
       expanded: _getSectionOptions(context),
       theme: getExpandableTheme(context),
       theme: getExpandableTheme(context),
@@ -33,7 +33,8 @@ class _DangerSectionWidgetState extends State<DangerSectionWidget> {
           onTap: () {
           onTap: () {
             _onLogoutTapped();
             _onLogoutTapped();
           },
           },
-          child: SettingsTextItem(text: "Logout", icon: Icons.navigate_next),
+          child:
+              const SettingsTextItem(text: "Logout", icon: Icons.navigate_next),
         ),
         ),
         sectionOptionDivider,
         sectionOptionDivider,
         GestureDetector(
         GestureDetector(
@@ -41,7 +42,7 @@ class _DangerSectionWidgetState extends State<DangerSectionWidget> {
           onTap: () {
           onTap: () {
             _onDeleteAccountTapped();
             _onDeleteAccountTapped();
           },
           },
-          child: SettingsTextItem(
+          child: const SettingsTextItem(
             text: "Delete account",
             text: "Delete account",
             icon: Icons.navigate_next,
             icon: Icons.navigate_next,
           ),
           ),
@@ -52,7 +53,7 @@ class _DangerSectionWidgetState extends State<DangerSectionWidget> {
 
 
   Future<void> _onDeleteAccountTapped() async {
   Future<void> _onDeleteAccountTapped() async {
     AlertDialog alert = AlertDialog(
     AlertDialog alert = AlertDialog(
-      title: Text(
+      title: const Text(
         "Delete account",
         "Delete account",
         style: TextStyle(
         style: TextStyle(
           color: Colors.red,
           color: Colors.red,
@@ -61,7 +62,7 @@ class _DangerSectionWidgetState extends State<DangerSectionWidget> {
       content: RichText(
       content: RichText(
         text: TextSpan(
         text: TextSpan(
           children: [
           children: [
-            TextSpan(
+            const TextSpan(
               text: "Please send an email to ",
               text: "Please send an email to ",
             ),
             ),
             TextSpan(
             TextSpan(
@@ -70,7 +71,7 @@ class _DangerSectionWidgetState extends State<DangerSectionWidget> {
                 color: Colors.orange[300],
                 color: Colors.orange[300],
               ),
               ),
             ),
             ),
-            TextSpan(
+            const TextSpan(
               text:
               text:
                   " from your registered email address.\n\nYour request will be processed within 72 hours.",
                   " from your registered email address.\n\nYour request will be processed within 72 hours.",
             ),
             ),
@@ -84,7 +85,7 @@ class _DangerSectionWidgetState extends State<DangerSectionWidget> {
       ),
       ),
       actions: [
       actions: [
         TextButton(
         TextButton(
-          child: Text(
+          child: const Text(
             "Send email",
             "Send email",
             style: TextStyle(
             style: TextStyle(
               color: Colors.red,
               color: Colors.red,
@@ -127,16 +128,16 @@ class _DangerSectionWidgetState extends State<DangerSectionWidget> {
 
 
   Future<void> _onLogoutTapped() async {
   Future<void> _onLogoutTapped() async {
     AlertDialog alert = AlertDialog(
     AlertDialog alert = AlertDialog(
-      title: Text(
+      title: const Text(
         "Logout",
         "Logout",
         style: TextStyle(
         style: TextStyle(
           color: Colors.red,
           color: Colors.red,
         ),
         ),
       ),
       ),
-      content: Text("Are you sure you want to logout?"),
+      content: const Text("Are you sure you want to logout?"),
       actions: [
       actions: [
         TextButton(
         TextButton(
-          child: Text(
+          child: const Text(
             "Yes, logout",
             "Yes, logout",
             style: TextStyle(
             style: TextStyle(
               color: Colors.red,
               color: Colors.red,

+ 19 - 13
lib/ui/settings/debug_section_widget.dart

@@ -12,7 +12,7 @@ class DebugSectionWidget extends StatelessWidget {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return ExpandablePanel(
     return ExpandablePanel(
-      header: SettingsSectionTitle("Debug"),
+      header: const SettingsSectionTitle("Debug"),
       collapsed: Container(),
       collapsed: Container(),
       expanded: _getSectionOptions(context),
       expanded: _getSectionOptions(context),
       theme: getExpandableTheme(context),
       theme: getExpandableTheme(context),
@@ -27,7 +27,7 @@ class DebugSectionWidget extends StatelessWidget {
           onTap: () async {
           onTap: () async {
             _showKeyAttributesDialog(context);
             _showKeyAttributesDialog(context);
           },
           },
-          child: SettingsTextItem(
+          child: const SettingsTextItem(
             text: "Key attributes",
             text: "Key attributes",
             icon: Icons.navigate_next,
             icon: Icons.navigate_next,
           ),
           ),
@@ -37,7 +37,7 @@ class DebugSectionWidget extends StatelessWidget {
           onTap: () async {
           onTap: () async {
             Network.instance.getAlice().showInspector();
             Network.instance.getAlice().showInspector();
           },
           },
-          child: SettingsTextItem(
+          child: const SettingsTextItem(
             text: "Network requests",
             text: "Network requests",
             icon: Icons.navigate_next,
             icon: Icons.navigate_next,
           ),
           ),
@@ -49,34 +49,40 @@ class DebugSectionWidget extends StatelessWidget {
   void _showKeyAttributesDialog(BuildContext context) {
   void _showKeyAttributesDialog(BuildContext context) {
     final keyAttributes = Configuration.instance.getKeyAttributes();
     final keyAttributes = Configuration.instance.getKeyAttributes();
     AlertDialog alert = AlertDialog(
     AlertDialog alert = AlertDialog(
-      title: Text("key attributes"),
+      title: const Text("key attributes"),
       content: SingleChildScrollView(
       content: SingleChildScrollView(
         child: Column(
         child: Column(
           children: [
           children: [
-            Text("Key", style: TextStyle(fontWeight: FontWeight.bold)),
+            const Text(
+              "Key",
+              style: TextStyle(fontWeight: FontWeight.bold),
+            ),
             Text(Sodium.bin2base64(Configuration.instance.getKey())),
             Text(Sodium.bin2base64(Configuration.instance.getKey())),
-            Padding(padding: EdgeInsets.all(12)),
-            Text(
+            const Padding(padding: EdgeInsets.all(12)),
+            const Text(
               "Encrypted Key",
               "Encrypted Key",
               style: TextStyle(fontWeight: FontWeight.bold),
               style: TextStyle(fontWeight: FontWeight.bold),
             ),
             ),
             Text(keyAttributes.encryptedKey),
             Text(keyAttributes.encryptedKey),
-            Padding(padding: EdgeInsets.all(12)),
-            Text(
+            const Padding(padding: EdgeInsets.all(12)),
+            const Text(
               "Key Decryption Nonce",
               "Key Decryption Nonce",
               style: TextStyle(fontWeight: FontWeight.bold),
               style: TextStyle(fontWeight: FontWeight.bold),
             ),
             ),
             Text(keyAttributes.keyDecryptionNonce),
             Text(keyAttributes.keyDecryptionNonce),
-            Padding(padding: EdgeInsets.all(12)),
-            Text("KEK Salt", style: TextStyle(fontWeight: FontWeight.bold)),
+            const Padding(padding: EdgeInsets.all(12)),
+            const Text(
+              "KEK Salt",
+              style: TextStyle(fontWeight: FontWeight.bold),
+            ),
             Text(keyAttributes.kekSalt),
             Text(keyAttributes.kekSalt),
-            Padding(padding: EdgeInsets.all(12)),
+            const Padding(padding: EdgeInsets.all(12)),
           ],
           ],
         ),
         ),
       ),
       ),
       actions: [
       actions: [
         TextButton(
         TextButton(
-          child: Text("OK"),
+          child: const Text("OK"),
           onPressed: () {
           onPressed: () {
             Navigator.of(context, rootNavigator: true).pop('dialog');
             Navigator.of(context, rootNavigator: true).pop('dialog');
           },
           },

+ 15 - 9
lib/ui/settings/details_section_widget.dart

@@ -38,7 +38,7 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
         _fetchUserDetails();
         _fetchUserDetails();
       }
       }
     });
     });
-    _background = Image(
+    _background = const Image(
       image: AssetImage("assets/storage_card_background.png"),
       image: AssetImage("assets/storage_card_background.png"),
       fit: BoxFit.fill,
       fit: BoxFit.fill,
     );
     );
@@ -104,8 +104,12 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
           _userDetails == null
           _userDetails == null
               ? const EnteLoadingWidget()
               ? const EnteLoadingWidget()
               : Padding(
               : Padding(
-                  padding:
-                      EdgeInsets.only(top: 20, bottom: 20, left: 16, right: 16),
+                  padding: const EdgeInsets.only(
+                    top: 20,
+                    bottom: 20,
+                    left: 16,
+                    right: 16,
+                  ),
                   child: Container(
                   child: Container(
                     color: Colors.transparent,
                     color: Colors.transparent,
                     child: Column(
                     child: Column(
@@ -165,7 +169,9 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                                 ),
                                 ),
                               ],
                               ],
                             ),
                             ),
-                            Padding(padding: EdgeInsets.symmetric(vertical: 8)),
+                            const Padding(
+                              padding: EdgeInsets.symmetric(vertical: 8),
+                            ),
                             Row(
                             Row(
                               mainAxisAlignment: MainAxisAlignment.spaceBetween,
                               mainAxisAlignment: MainAxisAlignment.spaceBetween,
                               children: [
                               children: [
@@ -175,12 +181,12 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                                           Container(
                                           Container(
                                             width: 8.71,
                                             width: 8.71,
                                             height: 8.99,
                                             height: 8.99,
-                                            decoration: BoxDecoration(
+                                            decoration: const BoxDecoration(
                                               shape: BoxShape.circle,
                                               shape: BoxShape.circle,
                                               color: Colors.white,
                                               color: Colors.white,
                                             ),
                                             ),
                                           ),
                                           ),
-                                          Padding(
+                                          const Padding(
                                             padding: EdgeInsets.only(right: 4),
                                             padding: EdgeInsets.only(right: 4),
                                           ),
                                           ),
                                           Text(
                                           Text(
@@ -193,7 +199,7 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                                                   fontSize: 12,
                                                   fontSize: 12,
                                                 ),
                                                 ),
                                           ),
                                           ),
-                                          Padding(
+                                          const Padding(
                                             padding: EdgeInsets.only(right: 12),
                                             padding: EdgeInsets.only(right: 12),
                                           ),
                                           ),
                                           Container(
                                           Container(
@@ -205,7 +211,7 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                                                   .withOpacity(0.75),
                                                   .withOpacity(0.75),
                                             ),
                                             ),
                                           ),
                                           ),
-                                          Padding(
+                                          const Padding(
                                             padding: EdgeInsets.only(right: 4),
                                             padding: EdgeInsets.only(right: 4),
                                           ),
                                           ),
                                           Text(
                                           Text(
@@ -251,7 +257,7 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                     ),
                     ),
                   ),
                   ),
                 ),
                 ),
-          Align(
+          const Align(
             alignment: Alignment.centerRight,
             alignment: Alignment.centerRight,
             child: Icon(
             child: Icon(
               Icons.chevron_right,
               Icons.chevron_right,

+ 16 - 10
lib/ui/settings/info_section_widget.dart

@@ -16,7 +16,7 @@ class InfoSectionWidget extends StatelessWidget {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return ExpandablePanel(
     return ExpandablePanel(
-      header: SettingsSectionTitle("About"),
+      header: const SettingsSectionTitle("About"),
       collapsed: Container(),
       collapsed: Container(),
       expanded: _getSectionOptions(context),
       expanded: _getSectionOptions(context),
       theme: getExpandableTheme(context),
       theme: getExpandableTheme(context),
@@ -32,12 +32,12 @@ class InfoSectionWidget extends StatelessWidget {
             Navigator.of(context).push(
             Navigator.of(context).push(
               MaterialPageRoute(
               MaterialPageRoute(
                 builder: (BuildContext context) {
                 builder: (BuildContext context) {
-                  return WebPage("FAQ", "https://ente.io/faq");
+                  return const WebPage("FAQ", "https://ente.io/faq");
                 },
                 },
               ),
               ),
             );
             );
           },
           },
-          child: SettingsTextItem(text: "FAQ", icon: Icons.navigate_next),
+          child: const SettingsTextItem(text: "FAQ", icon: Icons.navigate_next),
         ),
         ),
         sectionOptionDivider,
         sectionOptionDivider,
         GestureDetector(
         GestureDetector(
@@ -46,12 +46,13 @@ class InfoSectionWidget extends StatelessWidget {
             Navigator.of(context).push(
             Navigator.of(context).push(
               MaterialPageRoute(
               MaterialPageRoute(
                 builder: (BuildContext context) {
                 builder: (BuildContext context) {
-                  return WebPage("terms", "https://ente.io/terms");
+                  return const WebPage("terms", "https://ente.io/terms");
                 },
                 },
               ),
               ),
             );
             );
           },
           },
-          child: SettingsTextItem(text: "Terms", icon: Icons.navigate_next),
+          child:
+              const SettingsTextItem(text: "Terms", icon: Icons.navigate_next),
         ),
         ),
         sectionOptionDivider,
         sectionOptionDivider,
         GestureDetector(
         GestureDetector(
@@ -60,12 +61,15 @@ class InfoSectionWidget extends StatelessWidget {
             Navigator.of(context).push(
             Navigator.of(context).push(
               MaterialPageRoute(
               MaterialPageRoute(
                 builder: (BuildContext context) {
                 builder: (BuildContext context) {
-                  return WebPage("privacy", "https://ente.io/privacy");
+                  return const WebPage("privacy", "https://ente.io/privacy");
                 },
                 },
               ),
               ),
             );
             );
           },
           },
-          child: SettingsTextItem(text: "Privacy", icon: Icons.navigate_next),
+          child: const SettingsTextItem(
+            text: "Privacy",
+            icon: Icons.navigate_next,
+          ),
         ),
         ),
         sectionOptionDivider,
         sectionOptionDivider,
         GestureDetector(
         GestureDetector(
@@ -73,8 +77,10 @@ class InfoSectionWidget extends StatelessWidget {
           onTap: () async {
           onTap: () async {
             launchUrl(Uri.parse("https://github.com/ente-io/frame"));
             launchUrl(Uri.parse("https://github.com/ente-io/frame"));
           },
           },
-          child:
-              SettingsTextItem(text: "Source code", icon: Icons.navigate_next),
+          child: const SettingsTextItem(
+            text: "Source code",
+            icon: Icons.navigate_next,
+          ),
         ),
         ),
         sectionOptionDivider,
         sectionOptionDivider,
         UpdateService.instance.isIndependent()
         UpdateService.instance.isIndependent()
@@ -103,7 +109,7 @@ class InfoSectionWidget extends StatelessWidget {
                         showToast(context, "You are on the latest version");
                         showToast(context, "You are on the latest version");
                       }
                       }
                     },
                     },
-                    child: SettingsTextItem(
+                    child: const SettingsTextItem(
                       text: "Check for updates",
                       text: "Check for updates",
                       icon: Icons.navigate_next,
                       icon: Icons.navigate_next,
                     ),
                     ),

+ 9 - 8
lib/ui/settings/security_section_widget.dart

@@ -53,7 +53,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return ExpandablePanel(
     return ExpandablePanel(
-      header: SettingsSectionTitle("Security"),
+      header: const SettingsSectionTitle("Security"),
       collapsed: Container(),
       collapsed: Container(),
       expanded: _getSectionOptions(context),
       expanded: _getSectionOptions(context),
       theme: getExpandableTheme(context),
       theme: getExpandableTheme(context),
@@ -65,7 +65,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
     if (_config.hasConfiguredAccount()) {
     if (_config.hasConfiguredAccount()) {
       children.addAll(
       children.addAll(
         [
         [
-          Padding(padding: EdgeInsets.all(2)),
+          const Padding(padding: EdgeInsets.all(2)),
           SizedBox(
           SizedBox(
             height: 48,
             height: 48,
             child: Row(
             child: Row(
@@ -165,7 +165,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
                   onChanged: (value) async {
                   onChanged: (value) async {
                     if (value) {
                     if (value) {
                       AlertDialog alert = AlertDialog(
                       AlertDialog alert = AlertDialog(
-                        title: Text("Hide from recents?"),
+                        title: const Text("Hide from recents?"),
                         content: SingleChildScrollView(
                         content: SingleChildScrollView(
                           child: Column(
                           child: Column(
                             mainAxisAlignment: MainAxisAlignment.start,
                             mainAxisAlignment: MainAxisAlignment.start,
@@ -266,7 +266,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
             ),
             ),
           );
           );
         },
         },
-        child: SettingsTextItem(
+        child: const SettingsTextItem(
           text: "Active sessions",
           text: "Active sessions",
           icon: Icons.navigate_next,
           icon: Icons.navigate_next,
         ),
         ),
@@ -279,9 +279,10 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
 
 
   void _disableTwoFactor() {
   void _disableTwoFactor() {
     AlertDialog alert = AlertDialog(
     AlertDialog alert = AlertDialog(
-      title: Text("Disable two-factor"),
-      content:
-          Text("Are you sure you want to disable two-factor authentication?"),
+      title: const Text("Disable two-factor"),
+      content: const Text(
+        "Are you sure you want to disable two-factor authentication?",
+      ),
       actions: [
       actions: [
         TextButton(
         TextButton(
           child: Text(
           child: Text(
@@ -295,7 +296,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
           },
           },
         ),
         ),
         TextButton(
         TextButton(
-          child: Text(
+          child: const Text(
             "Yes",
             "Yes",
             style: TextStyle(
             style: TextStyle(
               color: Colors.red,
               color: Colors.red,

+ 2 - 2
lib/ui/settings/settings_section_title.dart

@@ -14,7 +14,7 @@ class SettingsSectionTitle extends StatelessWidget {
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return Column(
     return Column(
       children: [
       children: [
-        Padding(padding: EdgeInsets.all(4)),
+        const Padding(padding: EdgeInsets.all(4)),
         Align(
         Align(
           alignment: Alignment.centerLeft,
           alignment: Alignment.centerLeft,
           child: Text(
           child: Text(
@@ -27,7 +27,7 @@ class SettingsSectionTitle extends StatelessWidget {
                 : Theme.of(context).textTheme.headline6,
                 : Theme.of(context).textTheme.headline6,
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(4)),
+        const Padding(padding: EdgeInsets.all(4)),
       ],
       ],
     );
     );
   }
   }

+ 8 - 5
lib/ui/settings/social_section_widget.dart

@@ -14,7 +14,7 @@ class SocialSectionWidget extends StatelessWidget {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return ExpandablePanel(
     return ExpandablePanel(
-      header: SettingsSectionTitle("Social"),
+      header: const SettingsSectionTitle("Social"),
       collapsed: Container(),
       collapsed: Container(),
       expanded: _getSectionOptions(context),
       expanded: _getSectionOptions(context),
       theme: getExpandableTheme(context),
       theme: getExpandableTheme(context),
@@ -28,7 +28,8 @@ class SocialSectionWidget extends StatelessWidget {
         onTap: () {
         onTap: () {
           launch("https://twitter.com/enteio");
           launch("https://twitter.com/enteio");
         },
         },
-        child: SettingsTextItem(text: "Twitter", icon: Icons.navigate_next),
+        child:
+            const SettingsTextItem(text: "Twitter", icon: Icons.navigate_next),
       ),
       ),
       sectionOptionDivider,
       sectionOptionDivider,
       GestureDetector(
       GestureDetector(
@@ -36,7 +37,8 @@ class SocialSectionWidget extends StatelessWidget {
         onTap: () {
         onTap: () {
           launch("https://ente.io/discord");
           launch("https://ente.io/discord");
         },
         },
-        child: SettingsTextItem(text: "Discord", icon: Icons.navigate_next),
+        child:
+            const SettingsTextItem(text: "Discord", icon: Icons.navigate_next),
       ),
       ),
       sectionOptionDivider,
       sectionOptionDivider,
       GestureDetector(
       GestureDetector(
@@ -44,7 +46,8 @@ class SocialSectionWidget extends StatelessWidget {
         onTap: () {
         onTap: () {
           launch("https://reddit.com/r/enteio");
           launch("https://reddit.com/r/enteio");
         },
         },
-        child: SettingsTextItem(text: "Reddit", icon: Icons.navigate_next),
+        child:
+            const SettingsTextItem(text: "Reddit", icon: Icons.navigate_next),
       ),
       ),
     ];
     ];
     if (!UpdateService.instance.isIndependent()) {
     if (!UpdateService.instance.isIndependent()) {
@@ -64,7 +67,7 @@ class SocialSectionWidget extends StatelessWidget {
                 );
                 );
               }
               }
             },
             },
-            child: SettingsTextItem(
+            child: const SettingsTextItem(
               text: "Rate us! ✨",
               text: "Rate us! ✨",
               icon: Icons.navigate_next,
               icon: Icons.navigate_next,
             ),
             ),

+ 8 - 4
lib/ui/settings/support_section_widget.dart

@@ -19,7 +19,7 @@ class SupportSectionWidget extends StatelessWidget {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return ExpandablePanel(
     return ExpandablePanel(
-      header: SettingsSectionTitle("Support"),
+      header: const SettingsSectionTitle("Support"),
       collapsed: Container(),
       collapsed: Container(),
       expanded: _getSectionOptions(context),
       expanded: _getSectionOptions(context),
       theme: getExpandableTheme(context),
       theme: getExpandableTheme(context),
@@ -45,7 +45,8 @@ class SupportSectionWidget extends StatelessWidget {
               showErrorDialog(context, "", "Please email us at $kSupportEmail");
               showErrorDialog(context, "", "Please email us at $kSupportEmail");
             }
             }
           },
           },
-          child: SettingsTextItem(text: "Email", icon: Icons.navigate_next),
+          child:
+              const SettingsTextItem(text: "Email", icon: Icons.navigate_next),
         ),
         ),
         sectionOptionDivider,
         sectionOptionDivider,
         GestureDetector(
         GestureDetector(
@@ -65,7 +66,10 @@ class SupportSectionWidget extends StatelessWidget {
               ),
               ),
             );
             );
           },
           },
-          child: SettingsTextItem(text: "Roadmap", icon: Icons.navigate_next),
+          child: const SettingsTextItem(
+            text: "Roadmap",
+            icon: Icons.navigate_next,
+          ),
         ),
         ),
         sectionOptionDivider,
         sectionOptionDivider,
         GestureDetector(
         GestureDetector(
@@ -77,7 +81,7 @@ class SupportSectionWidget extends StatelessWidget {
             final zipFilePath = await getZippedLogsFile(context);
             final zipFilePath = await getZippedLogsFile(context);
             await shareLogs(context, bugsEmail, zipFilePath);
             await shareLogs(context, bugsEmail, zipFilePath);
           },
           },
-          child: SettingsTextItem(
+          child: const SettingsTextItem(
             text: "Report bug 🐞",
             text: "Report bug 🐞",
             icon: Icons.navigate_next,
             icon: Icons.navigate_next,
           ),
           ),

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

@@ -40,7 +40,7 @@ class ThemeSwitchWidget extends StatelessWidget {
         }
         }
       },
       },
       height: 36,
       height: 36,
-      indicatorSize: Size(36, 36),
+      indicatorSize: const Size(36, 36),
       indicatorColor: Theme.of(context).colorScheme.themeSwitchIndicatorColor,
       indicatorColor: Theme.of(context).colorScheme.themeSwitchIndicatorColor,
       borderColor: Theme.of(context)
       borderColor: Theme.of(context)
           .colorScheme
           .colorScheme

+ 11 - 11
lib/ui/settings_page.dart

@@ -31,7 +31,7 @@ class SettingsPage extends StatelessWidget {
     final List<Widget> contents = [];
     final List<Widget> contents = [];
     contents.add(
     contents.add(
       Container(
       Container(
-        padding: EdgeInsets.symmetric(horizontal: 2, vertical: 6),
+        padding: const EdgeInsets.symmetric(horizontal: 2, vertical: 6),
         child: Row(
         child: Row(
           mainAxisAlignment: MainAxisAlignment.spaceBetween,
           mainAxisAlignment: MainAxisAlignment.spaceBetween,
           crossAxisAlignment: CrossAxisAlignment.center,
           crossAxisAlignment: CrossAxisAlignment.center,
@@ -54,7 +54,7 @@ class SettingsPage extends StatelessWidget {
             ),
             ),
 
 
             (Platform.isAndroid)
             (Platform.isAndroid)
-                ? ThemeSwitchWidget()
+                ? const ThemeSwitchWidget()
                 : const SizedBox.shrink(),
                 : const SizedBox.shrink(),
           ],
           ],
         ),
         ),
@@ -64,11 +64,11 @@ class SettingsPage extends StatelessWidget {
       height: 20,
       height: 20,
       color: Theme.of(context).colorScheme.onSurface.withOpacity(0.12),
       color: Theme.of(context).colorScheme.onSurface.withOpacity(0.12),
     );
     );
-    contents.add(Padding(padding: EdgeInsets.all(4)));
+    contents.add(const Padding(padding: EdgeInsets.all(4)));
     if (hasLoggedIn) {
     if (hasLoggedIn) {
       contents.addAll([
       contents.addAll([
         DetailsSectionWidget(),
         DetailsSectionWidget(),
-        Padding(padding: EdgeInsets.only(bottom: 24)),
+        const Padding(padding: EdgeInsets.only(bottom: 24)),
         BackupSectionWidget(),
         BackupSectionWidget(),
         sectionDivider,
         sectionDivider,
         AccountSectionWidget(),
         AccountSectionWidget(),
@@ -78,11 +78,11 @@ class SettingsPage extends StatelessWidget {
     contents.addAll([
     contents.addAll([
       SecuritySectionWidget(),
       SecuritySectionWidget(),
       sectionDivider,
       sectionDivider,
-      SupportSectionWidget(),
+      const SupportSectionWidget(),
       sectionDivider,
       sectionDivider,
-      SocialSectionWidget(),
+      const SocialSectionWidget(),
       sectionDivider,
       sectionDivider,
-      InfoSectionWidget(),
+      const InfoSectionWidget(),
     ]);
     ]);
     if (hasLoggedIn) {
     if (hasLoggedIn) {
       contents.addAll([
       contents.addAll([
@@ -92,11 +92,11 @@ class SettingsPage extends StatelessWidget {
     }
     }
 
 
     if (kDebugMode && hasLoggedIn) {
     if (kDebugMode && hasLoggedIn) {
-      contents.addAll([sectionDivider, DebugSectionWidget()]);
+      contents.addAll([sectionDivider, const DebugSectionWidget()]);
     }
     }
-    contents.add(AppVersionWidget());
+    contents.add(const AppVersionWidget());
     contents.add(
     contents.add(
-      Padding(
+      const Padding(
         padding: EdgeInsets.only(bottom: 60),
         padding: EdgeInsets.only(bottom: 60),
       ),
       ),
     );
     );
@@ -106,7 +106,7 @@ class SettingsPage extends StatelessWidget {
         padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 20),
         padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 20),
         child: Center(
         child: Center(
           child: ConstrainedBox(
           child: ConstrainedBox(
-            constraints: BoxConstraints(maxWidth: 350),
+            constraints: const BoxConstraints(maxWidth: 350),
             child: Column(
             child: Column(
               children: contents,
               children: contents,
             ),
             ),

+ 17 - 17
lib/ui/shared_collections_gallery.dart

@@ -124,14 +124,14 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
         child: Column(
         child: Column(
           children: [
           children: [
             const SizedBox(height: 12),
             const SizedBox(height: 12),
-            SectionTitle("Shared with me"),
+            const SectionTitle("Shared with me"),
             const SizedBox(height: 12),
             const SizedBox(height: 12),
             collections.incoming.isNotEmpty
             collections.incoming.isNotEmpty
                 ? Padding(
                 ? Padding(
                     padding: const EdgeInsets.symmetric(horizontal: 16),
                     padding: const EdgeInsets.symmetric(horizontal: 16),
                     child: GridView.builder(
                     child: GridView.builder(
                       shrinkWrap: true,
                       shrinkWrap: true,
-                      physics: NeverScrollableScrollPhysics(),
+                      physics: const NeverScrollableScrollPhysics(),
                       itemBuilder: (context, index) {
                       itemBuilder: (context, index) {
                         return IncomingCollectionItem(
                         return IncomingCollectionItem(
                           collections.incoming[index],
                           collections.incoming[index],
@@ -148,13 +148,13 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
                     ),
                     ),
                   )
                   )
                 : _getIncomingCollectionEmptyState(),
                 : _getIncomingCollectionEmptyState(),
-            SectionTitle("Shared by me"),
+            const SectionTitle("Shared by me"),
             const SizedBox(height: 12),
             const SizedBox(height: 12),
             collections.outgoing.isNotEmpty
             collections.outgoing.isNotEmpty
                 ? ListView.builder(
                 ? ListView.builder(
                     shrinkWrap: true,
                     shrinkWrap: true,
-                    padding: EdgeInsets.only(bottom: 12),
-                    physics: NeverScrollableScrollPhysics(),
+                    padding: const EdgeInsets.only(bottom: 12),
+                    physics: const NeverScrollableScrollPhysics(),
                     itemBuilder: (context, index) {
                     itemBuilder: (context, index) {
                       return OutgoingCollectionItem(
                       return OutgoingCollectionItem(
                         collections.outgoing[index],
                         collections.outgoing[index],
@@ -180,7 +180,7 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
             "Ask your loved ones to share",
             "Ask your loved ones to share",
             style: Theme.of(context).textTheme.caption,
             style: Theme.of(context).textTheme.caption,
           ),
           ),
-          Padding(padding: EdgeInsets.only(top: 14)),
+          const Padding(padding: EdgeInsets.only(top: 14)),
           SizedBox(
           SizedBox(
             width: 200,
             width: 200,
             height: 50,
             height: 50,
@@ -209,7 +209,7 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
             "Share your first album",
             "Share your first album",
             style: Theme.of(context).textTheme.caption,
             style: Theme.of(context).textTheme.caption,
           ),
           ),
-          Padding(padding: EdgeInsets.only(top: 14)),
+          const Padding(padding: EdgeInsets.only(top: 14)),
           SizedBox(
           SizedBox(
             width: 200,
             width: 200,
             height: 50,
             height: 50,
@@ -283,7 +283,7 @@ class OutgoingCollectionItem extends StatelessWidget {
     return GestureDetector(
     return GestureDetector(
       behavior: HitTestBehavior.opaque,
       behavior: HitTestBehavior.opaque,
       child: Container(
       child: Container(
-        margin: EdgeInsets.fromLTRB(16, 12, 16, 12),
+        margin: const EdgeInsets.fromLTRB(16, 12, 16, 12),
         child: Row(
         child: Row(
           children: <Widget>[
           children: <Widget>[
             ClipRRect(
             ClipRRect(
@@ -300,7 +300,7 @@ class OutgoingCollectionItem extends StatelessWidget {
                 ),
                 ),
               ),
               ),
             ),
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             Expanded(
             Expanded(
               child: Column(
               child: Column(
                 crossAxisAlignment: CrossAxisAlignment.start,
                 crossAxisAlignment: CrossAxisAlignment.start,
@@ -309,20 +309,20 @@ class OutgoingCollectionItem extends StatelessWidget {
                     children: [
                     children: [
                       Text(
                       Text(
                         c.collection.name,
                         c.collection.name,
-                        style: TextStyle(
+                        style: const TextStyle(
                           fontSize: 16,
                           fontSize: 16,
                         ),
                         ),
                       ),
                       ),
-                      Padding(padding: EdgeInsets.all(2)),
+                      const Padding(padding: EdgeInsets.all(2)),
                       c.collection.publicURLs.isEmpty
                       c.collection.publicURLs.isEmpty
                           ? Container()
                           ? Container()
-                          : Icon(Icons.link),
+                          : const Icon(Icons.link),
                     ],
                     ],
                   ),
                   ),
                   sharees.isEmpty
                   sharees.isEmpty
                       ? Container()
                       ? Container()
                       : Padding(
                       : Padding(
-                          padding: EdgeInsets.fromLTRB(0, 4, 0, 0),
+                          padding: const EdgeInsets.fromLTRB(0, 4, 0, 0),
                           child: Text(
                           child: Text(
                             "Shared with " + sharees.join(", "),
                             "Shared with " + sharees.join(", "),
                             style: TextStyle(
                             style: TextStyle(
@@ -392,8 +392,8 @@ class IncomingCollectionItem extends StatelessWidget {
                   Align(
                   Align(
                     alignment: Alignment.bottomRight,
                     alignment: Alignment.bottomRight,
                     child: Container(
                     child: Container(
-                      padding: EdgeInsets.all(8),
-                      margin: EdgeInsets.fromLTRB(0, 0, 4, 0),
+                      padding: const EdgeInsets.all(8),
+                      margin: const EdgeInsets.fromLTRB(0, 0, 4, 0),
                       decoration: BoxDecoration(
                       decoration: BoxDecoration(
                         shape: BoxShape.circle,
                         shape: BoxShape.circle,
                         color: Theme.of(context)
                         color: Theme.of(context)
@@ -413,7 +413,7 @@ class IncomingCollectionItem extends StatelessWidget {
               ),
               ),
             ),
             ),
           ),
           ),
-          SizedBox(height: 4),
+          const SizedBox(height: 4),
           Row(
           Row(
             children: [
             children: [
               Container(
               Container(
@@ -434,7 +434,7 @@ class IncomingCollectionItem extends StatelessWidget {
                           color: albumTitleTextStyle.color.withOpacity(0.5),
                           color: albumTitleTextStyle.color.withOpacity(0.5),
                         ),
                         ),
                         children: [
                         children: [
-                          TextSpan(text: "  \u2022  "),
+                          const TextSpan(text: "  \u2022  "),
                           TextSpan(text: snapshot.data.toString()),
                           TextSpan(text: snapshot.data.toString()),
                         ],
                         ],
                       ),
                       ),

+ 35 - 35
lib/ui/sharing/manage_links_widget.dart

@@ -26,14 +26,14 @@ class ManageSharedLinkWidget extends StatefulWidget {
 class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
 class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
   // index, title, milliseconds in future post which link should expire (when >0)
   // index, title, milliseconds in future post which link should expire (when >0)
   final List<Tuple3<int, String, int>> _expiryOptions = [
   final List<Tuple3<int, String, int>> _expiryOptions = [
-    Tuple3(0, "Never", 0),
-    Tuple3(1, "After 1 hour", Duration(hours: 1).inMicroseconds),
-    Tuple3(2, "After 1 day", Duration(days: 1).inMicroseconds),
-    Tuple3(3, "After 1 week", Duration(days: 7).inMicroseconds),
+    const Tuple3(0, "Never", 0),
+    Tuple3(1, "After 1 hour", const Duration(hours: 1).inMicroseconds),
+    Tuple3(2, "After 1 day", const Duration(days: 1).inMicroseconds),
+    Tuple3(3, "After 1 week", const Duration(days: 7).inMicroseconds),
     // todo: make this time calculation perfect
     // todo: make this time calculation perfect
-    Tuple3(4, "After 1 month", Duration(days: 30).inMicroseconds),
-    Tuple3(5, "After 1 year", Duration(days: 365).inMicroseconds),
-    Tuple3(6, "Custom", -1),
+    Tuple3(4, "After 1 month", const Duration(days: 30).inMicroseconds),
+    Tuple3(5, "After 1 year", const Duration(days: 365).inMicroseconds),
+    const Tuple3(6, "Custom", -1),
   ];
   ];
 
 
   Tuple3<int, String, int> _selectedExpiry;
   Tuple3<int, String, int> _selectedExpiry;
@@ -51,7 +51,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
       backgroundColor: Theme.of(context).backgroundColor,
       backgroundColor: Theme.of(context).backgroundColor,
       appBar: AppBar(
       appBar: AppBar(
         elevation: 0,
         elevation: 0,
-        title: Text(
+        title: const Text(
           "Manage link",
           "Manage link",
         ),
         ),
       ),
       ),
@@ -62,7 +62,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
               padding: const EdgeInsets.fromLTRB(16, 12, 16, 12),
               padding: const EdgeInsets.fromLTRB(16, 12, 16, 12),
               child: Column(
               child: Column(
                 children: [
                 children: [
-                  Padding(padding: EdgeInsets.all(4)),
+                  const Padding(padding: EdgeInsets.all(4)),
                   GestureDetector(
                   GestureDetector(
                     behavior: HitTestBehavior.translucent,
                     behavior: HitTestBehavior.translucent,
                     onTap: () async {
                     onTap: () async {
@@ -76,18 +76,18 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
                           mainAxisAlignment: MainAxisAlignment.center,
                           mainAxisAlignment: MainAxisAlignment.center,
                           crossAxisAlignment: CrossAxisAlignment.start,
                           crossAxisAlignment: CrossAxisAlignment.start,
                           children: [
                           children: [
-                            Text("Link expiry"),
-                            Padding(padding: EdgeInsets.all(4)),
+                            const Text("Link expiry"),
+                            const Padding(padding: EdgeInsets.all(4)),
                             _getLinkExpiryTimeWidget(),
                             _getLinkExpiryTimeWidget(),
                           ],
                           ],
                         ),
                         ),
-                        Icon(Icons.navigate_next),
+                        const Icon(Icons.navigate_next),
                       ],
                       ],
                     ),
                     ),
                   ),
                   ),
-                  Padding(padding: EdgeInsets.all(4)),
-                  Divider(height: 4),
-                  Padding(padding: EdgeInsets.all(4)),
+                  const Padding(padding: EdgeInsets.all(4)),
+                  const Divider(height: 4),
+                  const Padding(padding: EdgeInsets.all(4)),
                   GestureDetector(
                   GestureDetector(
                     behavior: HitTestBehavior.translucent,
                     behavior: HitTestBehavior.translucent,
                     onTap: () {
                     onTap: () {
@@ -101,30 +101,30 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
                           mainAxisAlignment: MainAxisAlignment.center,
                           mainAxisAlignment: MainAxisAlignment.center,
                           crossAxisAlignment: CrossAxisAlignment.start,
                           crossAxisAlignment: CrossAxisAlignment.start,
                           children: [
                           children: [
-                            Text("Device limit"),
-                            Padding(padding: EdgeInsets.all(4)),
+                            const Text("Device limit"),
+                            const Padding(padding: EdgeInsets.all(4)),
                             Text(
                             Text(
                               widget.collection.publicURLs.first.deviceLimit
                               widget.collection.publicURLs.first.deviceLimit
                                   .toString(),
                                   .toString(),
-                              style: TextStyle(
+                              style: const TextStyle(
                                 color: Colors.grey,
                                 color: Colors.grey,
                               ),
                               ),
                             ),
                             ),
                           ],
                           ],
                         ),
                         ),
-                        Icon(Icons.navigate_next),
+                        const Icon(Icons.navigate_next),
                       ],
                       ],
                     ),
                     ),
                   ),
                   ),
-                  Padding(padding: EdgeInsets.all(4)),
-                  Divider(height: 4),
-                  Padding(padding: EdgeInsets.all(4)),
+                  const Padding(padding: EdgeInsets.all(4)),
+                  const Divider(height: 4),
+                  const Padding(padding: EdgeInsets.all(4)),
                   SizedBox(
                   SizedBox(
                     height: 36,
                     height: 36,
                     child: Row(
                     child: Row(
                       mainAxisAlignment: MainAxisAlignment.spaceBetween,
                       mainAxisAlignment: MainAxisAlignment.spaceBetween,
                       children: [
                       children: [
-                        Text("Password lock"),
+                        const Text("Password lock"),
                         Switch.adaptive(
                         Switch.adaptive(
                           value: widget.collection.publicURLs?.first
                           value: widget.collection.publicURLs?.first
                                   ?.passwordEnabled ??
                                   ?.passwordEnabled ??
@@ -153,15 +153,15 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
                       ],
                       ],
                     ),
                     ),
                   ),
                   ),
-                  Padding(padding: EdgeInsets.all(4)),
-                  Divider(height: 4),
-                  Padding(padding: EdgeInsets.all(4)),
+                  const Padding(padding: EdgeInsets.all(4)),
+                  const Divider(height: 4),
+                  const Padding(padding: EdgeInsets.all(4)),
                   SizedBox(
                   SizedBox(
                     height: 36,
                     height: 36,
                     child: Row(
                     child: Row(
                       mainAxisAlignment: MainAxisAlignment.spaceBetween,
                       mainAxisAlignment: MainAxisAlignment.spaceBetween,
                       children: [
                       children: [
-                        Text("File download"),
+                        const Text("File download"),
                         Switch.adaptive(
                         Switch.adaptive(
                           value: widget.collection.publicURLs?.first
                           value: widget.collection.publicURLs?.first
                                   ?.enableDownload ??
                                   ?.enableDownload ??
@@ -224,7 +224,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
             Container(
             Container(
               decoration: BoxDecoration(
               decoration: BoxDecoration(
                 color: Theme.of(context).colorScheme.cupertinoPickerTopColor,
                 color: Theme.of(context).colorScheme.cupertinoPickerTopColor,
-                border: Border(
+                border: const Border(
                   bottom: BorderSide(
                   bottom: BorderSide(
                     color: Color(0xff999999),
                     color: Color(0xff999999),
                     width: 0.0,
                     width: 0.0,
@@ -288,7 +288,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
             ),
             ),
             Container(
             Container(
               height: 220.0,
               height: 220.0,
-              color: Color(0xfff7f7f7),
+              color: const Color(0xfff7f7f7),
               child: CupertinoPicker(
               child: CupertinoPicker(
                 backgroundColor:
                 backgroundColor:
                     Theme.of(context).backgroundColor.withOpacity(0.95),
                     Theme.of(context).backgroundColor.withOpacity(0.95),
@@ -350,12 +350,12 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
         return StatefulBuilder(
         return StatefulBuilder(
           builder: (context, setState) {
           builder: (context, setState) {
             return AlertDialog(
             return AlertDialog(
-              title: Text('Enter password'),
+              title: const Text('Enter password'),
               content: TextFormField(
               content: TextFormField(
                 autofillHints: const [AutofillHints.newPassword],
                 autofillHints: const [AutofillHints.newPassword],
                 decoration: InputDecoration(
                 decoration: InputDecoration(
                   hintText: "Password",
                   hintText: "Password",
-                  contentPadding: EdgeInsets.all(12),
+                  contentPadding: const EdgeInsets.all(12),
                   suffixIcon: IconButton(
                   suffixIcon: IconButton(
                     icon: Icon(
                     icon: Icon(
                       _passwordVisible
                       _passwordVisible
@@ -448,7 +448,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
   Text _getLinkExpiryTimeWidget() {
   Text _getLinkExpiryTimeWidget() {
     int validTill = widget.collection.publicURLs?.first?.validTill ?? 0;
     int validTill = widget.collection.publicURLs?.first?.validTill ?? 0;
     if (validTill == 0) {
     if (validTill == 0) {
-      return Text(
+      return const Text(
         'Never',
         'Never',
         style: TextStyle(
         style: TextStyle(
           color: Colors.grey,
           color: Colors.grey,
@@ -465,7 +465,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
     }
     }
     return Text(
     return Text(
       getFormattedTime(DateTime.fromMicrosecondsSinceEpoch(validTill)),
       getFormattedTime(DateTime.fromMicrosecondsSinceEpoch(validTill)),
-      style: TextStyle(
+      style: const TextStyle(
         color: Colors.grey,
         color: Colors.grey,
       ),
       ),
     );
     );
@@ -487,7 +487,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
             Container(
             Container(
               decoration: BoxDecoration(
               decoration: BoxDecoration(
                 color: Theme.of(context).colorScheme.cupertinoPickerTopColor,
                 color: Theme.of(context).colorScheme.cupertinoPickerTopColor,
-                border: Border(
+                border: const Border(
                   bottom: BorderSide(
                   bottom: BorderSide(
                     color: Color(0xff999999),
                     color: Color(0xff999999),
                     width: 0.0,
                     width: 0.0,
@@ -534,7 +534,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
             ),
             ),
             Container(
             Container(
               height: 220.0,
               height: 220.0,
-              color: Color(0xfff7f7f7),
+              color: const Color(0xfff7f7f7),
               child: CupertinoPicker(
               child: CupertinoPicker(
                 backgroundColor:
                 backgroundColor:
                     Theme.of(context).backgroundColor.withOpacity(0.95),
                     Theme.of(context).backgroundColor.withOpacity(0.95),

+ 29 - 28
lib/ui/sharing/share_collection_widget.dart

@@ -56,7 +56,7 @@ class _SharingDialogState extends State<SharingDialog> {
       children.add(_getEmailField());
       children.add(_getEmailField());
     }
     }
     children.add(
     children.add(
-      Padding(
+      const Padding(
         padding: EdgeInsets.all(8),
         padding: EdgeInsets.all(8),
       ),
       ),
     );
     );
@@ -80,7 +80,7 @@ class _SharingDialogState extends State<SharingDialog> {
           width: 240,
           width: 240,
           height: 50,
           height: 50,
           child: OutlinedButton(
           child: OutlinedButton(
-            child: Text("Add"),
+            child: const Text("Add"),
             onPressed: () {
             onPressed: () {
               _addEmailToCollection(_email?.trim() ?? '');
               _addEmailToCollection(_email?.trim() ?? '');
             },
             },
@@ -92,15 +92,15 @@ class _SharingDialogState extends State<SharingDialog> {
     if (!FeatureFlagService.instance.disableUrlSharing()) {
     if (!FeatureFlagService.instance.disableUrlSharing()) {
       bool hasUrl = widget.collection.publicURLs?.isNotEmpty ?? false;
       bool hasUrl = widget.collection.publicURLs?.isNotEmpty ?? false;
       children.addAll([
       children.addAll([
-        Padding(padding: EdgeInsets.all(16)),
-        Divider(height: 1),
-        Padding(padding: EdgeInsets.all(12)),
+        const Padding(padding: EdgeInsets.all(16)),
+        const Divider(height: 1),
+        const Padding(padding: EdgeInsets.all(12)),
         SizedBox(
         SizedBox(
           height: 36,
           height: 36,
           child: Row(
           child: Row(
             mainAxisAlignment: MainAxisAlignment.center,
             mainAxisAlignment: MainAxisAlignment.center,
             children: [
             children: [
-              Text("Public link"),
+              const Text("Public link"),
               Switch(
               Switch(
                 value: hasUrl,
                 value: hasUrl,
                 onChanged: (enable) async {
                 onChanged: (enable) async {
@@ -159,11 +159,11 @@ class _SharingDialogState extends State<SharingDialog> {
             ],
             ],
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(8)),
+        const Padding(padding: EdgeInsets.all(8)),
       ]);
       ]);
       if (widget.collection.publicURLs?.isNotEmpty ?? false) {
       if (widget.collection.publicURLs?.isNotEmpty ?? false) {
         children.add(
         children.add(
-          Padding(
+          const Padding(
             padding: EdgeInsets.all(2),
             padding: EdgeInsets.all(2),
           ),
           ),
         );
         );
@@ -172,7 +172,7 @@ class _SharingDialogState extends State<SharingDialog> {
     }
     }
 
 
     return AlertDialog(
     return AlertDialog(
-      title: Text("Sharing"),
+      title: const Text("Sharing"),
       content: SingleChildScrollView(
       content: SingleChildScrollView(
         child: ListBody(
         child: ListBody(
           children: <Widget>[
           children: <Widget>[
@@ -185,7 +185,7 @@ class _SharingDialogState extends State<SharingDialog> {
           ],
           ],
         ),
         ),
       ),
       ),
-      contentPadding: EdgeInsets.fromLTRB(24, 24, 24, 4),
+      contentPadding: const EdgeInsets.fromLTRB(24, 24, 24, 4),
     );
     );
   }
   }
 
 
@@ -194,7 +194,7 @@ class _SharingDialogState extends State<SharingDialog> {
       children: [
       children: [
         Expanded(
         Expanded(
           child: TypeAheadField(
           child: TypeAheadField(
-            textFieldConfiguration: TextFieldConfiguration(
+            textFieldConfiguration: const TextFieldConfiguration(
               keyboardType: TextInputType.emailAddress,
               keyboardType: TextInputType.emailAddress,
               decoration: InputDecoration(
               decoration: InputDecoration(
                 border: InputBorder.none,
                 border: InputBorder.none,
@@ -211,7 +211,7 @@ class _SharingDialogState extends State<SharingDialog> {
             },
             },
             itemBuilder: (context, suggestion) {
             itemBuilder: (context, suggestion) {
               return Container(
               return Container(
-                padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
+                padding: const EdgeInsets.fromLTRB(12, 8, 12, 8),
                 child: Text(
                 child: Text(
                   suggestion.email,
                   suggestion.email,
                   overflow: TextOverflow.clip,
                   overflow: TextOverflow.clip,
@@ -226,7 +226,7 @@ class _SharingDialogState extends State<SharingDialog> {
             },
             },
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(8)),
+        const Padding(padding: EdgeInsets.all(8)),
         IconButton(
         IconButton(
           icon: Icon(
           icon: Icon(
             Icons.contact_mail_outlined,
             Icons.contact_mail_outlined,
@@ -253,14 +253,14 @@ class _SharingDialogState extends State<SharingDialog> {
         mainAxisAlignment: MainAxisAlignment.start,
         mainAxisAlignment: MainAxisAlignment.start,
         crossAxisAlignment: CrossAxisAlignment.start,
         crossAxisAlignment: CrossAxisAlignment.start,
         children: [
         children: [
-          Padding(padding: EdgeInsets.all(4)),
+          const Padding(padding: EdgeInsets.all(4)),
           GestureDetector(
           GestureDetector(
             onTap: () async {
             onTap: () async {
               await Clipboard.setData(ClipboardData(text: url));
               await Clipboard.setData(ClipboardData(text: url));
               showToast(context, "Link copied to clipboard");
               showToast(context, "Link copied to clipboard");
             },
             },
             child: Container(
             child: Container(
-              padding: EdgeInsets.all(16),
+              padding: const EdgeInsets.all(16),
               color: Theme.of(context).colorScheme.onSurface.withOpacity(0.02),
               color: Theme.of(context).colorScheme.onSurface.withOpacity(0.02),
               child: Row(
               child: Row(
                 crossAxisAlignment: CrossAxisAlignment.end,
                 crossAxisAlignment: CrossAxisAlignment.end,
@@ -279,8 +279,8 @@ class _SharingDialogState extends State<SharingDialog> {
                       ),
                       ),
                     ),
                     ),
                   ),
                   ),
-                  Padding(padding: EdgeInsets.all(2)),
-                  Icon(
+                  const Padding(padding: EdgeInsets.all(2)),
+                  const Icon(
                     Icons.copy,
                     Icons.copy,
                     size: 18,
                     size: 18,
                   ),
                   ),
@@ -288,7 +288,7 @@ class _SharingDialogState extends State<SharingDialog> {
               ),
               ),
             ),
             ),
           ),
           ),
-          Padding(padding: EdgeInsets.all(2)),
+          const Padding(padding: EdgeInsets.all(2)),
           TextButton(
           TextButton(
             child: Padding(
             child: Padding(
               padding: const EdgeInsets.all(12),
               padding: const EdgeInsets.all(12),
@@ -299,7 +299,7 @@ class _SharingDialogState extends State<SharingDialog> {
                     Icons.adaptive.share,
                     Icons.adaptive.share,
                     color: Theme.of(context).buttonColor,
                     color: Theme.of(context).buttonColor,
                   ),
                   ),
-                  Padding(
+                  const Padding(
                     padding: EdgeInsets.all(4),
                     padding: EdgeInsets.all(4),
                   ),
                   ),
                   Text(
                   Text(
@@ -315,7 +315,7 @@ class _SharingDialogState extends State<SharingDialog> {
               shareText(url);
               shareText(url);
             },
             },
           ),
           ),
-          Padding(padding: EdgeInsets.all(4)),
+          const Padding(padding: EdgeInsets.all(4)),
           TextButton(
           TextButton(
             child: Center(
             child: Center(
               child: Text(
               child: Text(
@@ -370,12 +370,12 @@ class _SharingDialogState extends State<SharingDialog> {
     if (publicKey == null) {
     if (publicKey == null) {
       Navigator.of(context, rootNavigator: true).pop('dialog');
       Navigator.of(context, rootNavigator: true).pop('dialog');
       final dialog = AlertDialog(
       final dialog = AlertDialog(
-        title: Text("Invite to ente?"),
+        title: const Text("Invite to ente?"),
         content: Text(
         content: Text(
           "Looks like " +
           "Looks like " +
               email +
               email +
               " hasn't signed up for ente yet. would you like to invite them?",
               " hasn't signed up for ente yet. would you like to invite them?",
-          style: TextStyle(
+          style: const TextStyle(
             height: 1.4,
             height: 1.4,
           ),
           ),
         ),
         ),
@@ -435,9 +435,10 @@ class _SharingDialogState extends State<SharingDialog> {
 
 
   void _showUnSupportedAlert() {
   void _showUnSupportedAlert() {
     AlertDialog alert = AlertDialog(
     AlertDialog alert = AlertDialog(
-      title: Text("Sorry"),
-      content:
-          Text("Sharing is not permitted for free accounts, please subscribe"),
+      title: const Text("Sorry"),
+      content: const Text(
+        "Sharing is not permitted for free accounts, please subscribe",
+      ),
       actions: [
       actions: [
         TextButton(
         TextButton(
           child: Text(
           child: Text(
@@ -498,12 +499,12 @@ class EmailItemWidget extends StatelessWidget {
           padding: const EdgeInsets.fromLTRB(8, 0, 0, 0),
           padding: const EdgeInsets.fromLTRB(8, 0, 0, 0),
           child: Text(
           child: Text(
             email,
             email,
-            style: TextStyle(fontSize: 16),
+            style: const TextStyle(fontSize: 16),
           ),
           ),
         ),
         ),
-        Expanded(child: SizedBox()),
+        const Expanded(child: SizedBox()),
         IconButton(
         IconButton(
-          icon: Icon(Icons.delete_forever),
+          icon: const Icon(Icons.delete_forever),
           color: Colors.redAccent,
           color: Colors.redAccent,
           onPressed: () async {
           onPressed: () async {
             final dialog = createProgressDialog(context, "Please wait...");
             final dialog = createProgressDialog(context, "Please wait...");

+ 14 - 14
lib/ui/status_bar_widget.dart

@@ -24,7 +24,7 @@ class _StatusBarWidgetState extends State<StatusBarWidget> {
     _subscription = Bus.instance.on<SyncStatusUpdate>().listen((event) {
     _subscription = Bus.instance.on<SyncStatusUpdate>().listen((event) {
       if (event.status == SyncStatus.completedFirstGalleryImport ||
       if (event.status == SyncStatus.completedFirstGalleryImport ||
           event.status == SyncStatus.completedBackup) {
           event.status == SyncStatus.completedBackup) {
-        Future.delayed(Duration(milliseconds: 2000), () {
+        Future.delayed(const Duration(milliseconds: 2000), () {
           if (mounted) {
           if (mounted) {
             setState(() {
             setState(() {
               _showStatus = false;
               _showStatus = false;
@@ -56,20 +56,20 @@ class _StatusBarWidgetState extends State<StatusBarWidget> {
             children: [
             children: [
               AnimatedOpacity(
               AnimatedOpacity(
                 opacity: _showStatus ? 0 : 1,
                 opacity: _showStatus ? 0 : 1,
-                duration: Duration(milliseconds: 1000),
-                child: StatusBarBrandingWidget(),
+                duration: const Duration(milliseconds: 1000),
+                child: const StatusBarBrandingWidget(),
               ),
               ),
               AnimatedOpacity(
               AnimatedOpacity(
                 opacity: _showStatus ? 1 : 0,
                 opacity: _showStatus ? 1 : 0,
-                duration: Duration(milliseconds: 1000),
-                child: SyncStatusWidget(),
+                duration: const Duration(milliseconds: 1000),
+                child: const SyncStatusWidget(),
               ),
               ),
             ],
             ],
           ),
           ),
           AnimatedOpacity(
           AnimatedOpacity(
             opacity: _showStatus ? 1 : 0,
             opacity: _showStatus ? 1 : 0,
-            duration: Duration(milliseconds: 1000),
-            child: Divider(),
+            duration: const Duration(milliseconds: 1000),
+            child: const Divider(),
           ),
           ),
         ],
         ],
       ),
       ),
@@ -121,7 +121,7 @@ class _SyncStatusWidgetState extends State<SyncStatusWidget> {
       return HeaderErrorWidget(error: _event.error);
       return HeaderErrorWidget(error: _event.error);
     }
     }
     if (_event.status == SyncStatus.completedBackup) {
     if (_event.status == SyncStatus.completedBackup) {
-      return SyncStatusCompletedWidget();
+      return const SyncStatusCompletedWidget();
     }
     }
     return RefreshIndicatorWidget(_event);
     return RefreshIndicatorWidget(_event);
   }
   }
@@ -144,7 +144,7 @@ class RefreshIndicatorWidget extends StatelessWidget {
       width: double.infinity,
       width: double.infinity,
       alignment: Alignment.center,
       alignment: Alignment.center,
       child: SingleChildScrollView(
       child: SingleChildScrollView(
-        physics: NeverScrollableScrollPhysics(),
+        physics: const NeverScrollableScrollPhysics(),
         child: Column(
         child: Column(
           mainAxisAlignment: MainAxisAlignment.center,
           mainAxisAlignment: MainAxisAlignment.center,
           crossAxisAlignment: CrossAxisAlignment.center,
           crossAxisAlignment: CrossAxisAlignment.center,
@@ -154,7 +154,7 @@ class RefreshIndicatorWidget extends StatelessWidget {
               crossAxisAlignment: CrossAxisAlignment.center,
               crossAxisAlignment: CrossAxisAlignment.center,
               children: [
               children: [
                 Container(
                 Container(
-                  padding: EdgeInsets.all(2),
+                  padding: const EdgeInsets.all(2),
                   width: 22,
                   width: 22,
                   height: 22,
                   height: 22,
                   child: _inProgressIcon,
                   child: _inProgressIcon,
@@ -210,8 +210,8 @@ class StatusBarBrandingWidget extends StatelessWidget {
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return Container(
     return Container(
       height: kContainerHeight,
       height: kContainerHeight,
-      padding: EdgeInsets.only(left: 12),
-      child: Align(
+      padding: const EdgeInsets.only(left: 12),
+      child: const Align(
         alignment: Alignment.centerLeft,
         alignment: Alignment.centerLeft,
         child: Text(
         child: Text(
           "ente",
           "ente",
@@ -249,8 +249,8 @@ class SyncStatusCompletedWidget extends StatelessWidget {
                   color: Theme.of(context).buttonColor,
                   color: Theme.of(context).buttonColor,
                   size: 22,
                   size: 22,
                 ),
                 ),
-                Padding(
-                  padding: const EdgeInsets.only(left: 12),
+                const Padding(
+                  padding: EdgeInsets.only(left: 12),
                   child: Text("All memories preserved"),
                   child: Text("All memories preserved"),
                 ),
                 ),
               ],
               ],

+ 4 - 4
lib/ui/tools/debug/log_file_viewer.dart

@@ -29,7 +29,7 @@ class _LogFileViewerState extends State<LogFileViewer> {
     return Scaffold(
     return Scaffold(
       appBar: AppBar(
       appBar: AppBar(
         elevation: 0,
         elevation: 0,
-        title: Text("Today's logs"),
+        title: const Text("Today's logs"),
       ),
       ),
       body: _getBody(),
       body: _getBody(),
     );
     );
@@ -40,12 +40,12 @@ class _LogFileViewerState extends State<LogFileViewer> {
       return const EnteLoadingWidget();
       return const EnteLoadingWidget();
     }
     }
     return Container(
     return Container(
-      padding: EdgeInsets.only(left: 12, top: 8, right: 12),
+      padding: const EdgeInsets.only(left: 12, top: 8, right: 12),
       child: SingleChildScrollView(
       child: SingleChildScrollView(
         child: Text(
         child: Text(
           _logs,
           _logs,
-          style: TextStyle(
-            fontFeatures: const [
+          style: const TextStyle(
+            fontFeatures: [
               FontFeature.tabularFigures(),
               FontFeature.tabularFigures(),
             ],
             ],
             height: 1.2,
             height: 1.2,

+ 18 - 18
lib/ui/tools/deduplicate_page.dart

@@ -25,7 +25,7 @@ class DeduplicatePage extends StatefulWidget {
 }
 }
 
 
 class _DeduplicatePageState extends State<DeduplicatePage> {
 class _DeduplicatePageState extends State<DeduplicatePage> {
-  static final kHeaderRowCount = 3;
+  static const kHeaderRowCount = 3;
   static final kDeleteIconOverlay = Container(
   static final kDeleteIconOverlay = Container(
     decoration: BoxDecoration(
     decoration: BoxDecoration(
       gradient: LinearGradient(
       gradient: LinearGradient(
@@ -87,7 +87,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
     return Scaffold(
     return Scaffold(
       appBar: AppBar(
       appBar: AppBar(
         elevation: 0,
         elevation: 0,
-        title: Text("Deduplicate Files"),
+        title: const Text("Deduplicate Files"),
       ),
       ),
       body: _getBody(),
       body: _getBody(),
     );
     );
@@ -123,9 +123,9 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
                 if (_duplicates.isNotEmpty) {
                 if (_duplicates.isNotEmpty) {
                   return _getSortMenu();
                   return _getSortMenu();
                 } else {
                 } else {
-                  return Padding(
+                  return const Padding(
                     padding: EdgeInsets.only(top: 32),
                     padding: EdgeInsets.only(top: 32),
-                    child: const EmptyState(),
+                    child: EmptyState(),
                   );
                   );
                 }
                 }
               }
               }
@@ -148,7 +148,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
 
 
   Padding _getHeader() {
   Padding _getHeader() {
     return Padding(
     return Padding(
-      padding: EdgeInsets.fromLTRB(16, 12, 16, 12),
+      padding: const EdgeInsets.fromLTRB(16, 12, 16, 12),
       child: Column(
       child: Column(
         crossAxisAlignment: CrossAxisAlignment.start,
         crossAxisAlignment: CrossAxisAlignment.start,
         children: [
         children: [
@@ -157,17 +157,17 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
                 ((_shouldClubByCaptureTime ? " and capture times." : ".")),
                 ((_shouldClubByCaptureTime ? " and capture times." : ".")),
             style: Theme.of(context).textTheme.subtitle2,
             style: Theme.of(context).textTheme.subtitle2,
           ),
           ),
-          Padding(
+          const Padding(
             padding: EdgeInsets.all(2),
             padding: EdgeInsets.all(2),
           ),
           ),
           Text(
           Text(
             "Please review and delete the items you believe are duplicates.",
             "Please review and delete the items you believe are duplicates.",
             style: Theme.of(context).textTheme.subtitle2,
             style: Theme.of(context).textTheme.subtitle2,
           ),
           ),
-          Padding(
+          const Padding(
             padding: EdgeInsets.all(12),
             padding: EdgeInsets.all(12),
           ),
           ),
-          Divider(
+          const Divider(
             height: 0,
             height: 0,
           ),
           ),
         ],
         ],
@@ -177,7 +177,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
 
 
   Widget _getClubbingConfig() {
   Widget _getClubbingConfig() {
     return Padding(
     return Padding(
-      padding: EdgeInsets.fromLTRB(12, 0, 12, 4),
+      padding: const EdgeInsets.fromLTRB(12, 0, 12, 4),
       child: CheckboxListTile(
       child: CheckboxListTile(
         value: _shouldClubByCaptureTime,
         value: _shouldClubByCaptureTime,
         onChanged: (value) {
         onChanged: (value) {
@@ -185,7 +185,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
           _resetEntriesAndSelection();
           _resetEntriesAndSelection();
           setState(() {});
           setState(() {});
         },
         },
-        title: Text("Club by capture time"),
+        title: const Text("Club by capture time"),
       ),
       ),
     );
     );
   }
   }
@@ -238,7 +238,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
               crossAxisAlignment: CrossAxisAlignment.center,
               crossAxisAlignment: CrossAxisAlignment.center,
               children: [
               children: [
                 sortOptionText(sortKey),
                 sortOptionText(sortKey),
-                Padding(padding: EdgeInsets.only(left: 4)),
+                const Padding(padding: EdgeInsets.only(left: 4)),
                 Icon(
                 Icon(
                   Icons.sort,
                   Icons.sort,
                   color: Theme.of(context).colorScheme.iconColor,
                   color: Theme.of(context).colorScheme.iconColor,
@@ -289,17 +289,17 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
           child: Column(
           child: Column(
             mainAxisAlignment: MainAxisAlignment.end,
             mainAxisAlignment: MainAxisAlignment.end,
             children: [
             children: [
-              Padding(padding: EdgeInsets.all(2)),
+              const Padding(padding: EdgeInsets.all(2)),
               Text(
               Text(
                 text,
                 text,
-                style: TextStyle(
+                style: const TextStyle(
                   fontWeight: FontWeight.bold,
                   fontWeight: FontWeight.bold,
                   fontSize: 14,
                   fontSize: 14,
                   color: Colors.white,
                   color: Colors.white,
                 ),
                 ),
                 textAlign: TextAlign.center,
                 textAlign: TextAlign.center,
               ),
               ),
-              Padding(padding: EdgeInsets.all(2)),
+              const Padding(padding: EdgeInsets.all(2)),
               Text(
               Text(
                 formatBytes(size),
                 formatBytes(size),
                 style: TextStyle(
                 style: TextStyle(
@@ -307,7 +307,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
                   fontSize: 12,
                   fontSize: 12,
                 ),
                 ),
               ),
               ),
-              Padding(padding: EdgeInsets.all(2)),
+              const Padding(padding: EdgeInsets.all(2)),
             ],
             ],
           ),
           ),
           onPressed: () async {
           onPressed: () async {
@@ -337,16 +337,16 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
         ),
         ),
         GridView.builder(
         GridView.builder(
           shrinkWrap: true,
           shrinkWrap: true,
-          physics: NeverScrollableScrollPhysics(),
+          physics: const NeverScrollableScrollPhysics(),
           // to disable GridView's scrolling
           // to disable GridView's scrolling
           itemBuilder: (context, index) {
           itemBuilder: (context, index) {
             return _buildFile(context, duplicates.files[index], itemIndex);
             return _buildFile(context, duplicates.files[index], itemIndex);
           },
           },
           itemCount: duplicates.files.length,
           itemCount: duplicates.files.length,
-          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
             crossAxisCount: 4,
             crossAxisCount: 4,
           ),
           ),
-          padding: EdgeInsets.all(0),
+          padding: const EdgeInsets.all(0),
         ),
         ),
       ],
       ],
     );
     );

+ 18 - 18
lib/ui/tools/editor/image_editor_page.dart

@@ -68,7 +68,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
       },
       },
       child: Scaffold(
       child: Scaffold(
         appBar: AppBar(
         appBar: AppBar(
-          backgroundColor: Color(0x00000000),
+          backgroundColor: const Color(0x00000000),
           elevation: 0,
           elevation: 0,
           actions: _hasBeenEdited()
           actions: _hasBeenEdited()
               ? [
               ? [
@@ -81,7 +81,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
                         _saturation = kSaturationDefault;
                         _saturation = kSaturationDefault;
                       });
                       });
                     },
                     },
-                    icon: Icon(Icons.history),
+                    icon: const Icon(Icons.history),
                   )
                   )
                 ]
                 ]
               : [],
               : [],
@@ -89,14 +89,14 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
         body: Column(
         body: Column(
           children: [
           children: [
             Expanded(child: _buildImage()),
             Expanded(child: _buildImage()),
-            Padding(padding: EdgeInsets.all(4)),
+            const Padding(padding: EdgeInsets.all(4)),
             Column(
             Column(
               children: [
               children: [
                 _buildBrightness(),
                 _buildBrightness(),
                 _buildSat(),
                 _buildSat(),
               ],
               ],
             ),
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             _buildBottomBar(),
             _buildBottomBar(),
             Padding(padding: EdgeInsets.all(Platform.isIOS ? 16 : 6)),
             Padding(padding: EdgeInsets.all(Platform.isIOS ? 16 : 6)),
           ],
           ],
@@ -123,7 +123,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
           maxScale: 8.0,
           maxScale: 8.0,
           cropRectPadding: const EdgeInsets.all(20.0),
           cropRectPadding: const EdgeInsets.all(20.0),
           hitTestSize: 20.0,
           hitTestSize: 20.0,
-          cornerColor: Color.fromRGBO(45, 150, 98, 1),
+          cornerColor: const Color.fromRGBO(45, 150, 98, 1),
           editActionDetailsIsChanged: (_) {
           editActionDetailsIsChanged: (_) {
             setState(() {
             setState(() {
               _hasEdited = true;
               _hasEdited = true;
@@ -176,7 +176,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
                 size: 20,
                 size: 20,
               ),
               ),
             ),
             ),
-            Padding(padding: EdgeInsets.all(2)),
+            const Padding(padding: EdgeInsets.all(2)),
             Text(
             Text(
               "Flip",
               "Flip",
               style: subtitle2.copyWith(
               style: subtitle2.copyWith(
@@ -206,7 +206,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
               Icons.rotate_left,
               Icons.rotate_left,
               color: Theme.of(context).iconTheme.color.withOpacity(0.8),
               color: Theme.of(context).iconTheme.color.withOpacity(0.8),
             ),
             ),
-            Padding(padding: EdgeInsets.all(2)),
+            const Padding(padding: EdgeInsets.all(2)),
             Text(
             Text(
               "Rotate left",
               "Rotate left",
               style: subtitle2.copyWith(
               style: subtitle2.copyWith(
@@ -236,7 +236,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
               Icons.rotate_right,
               Icons.rotate_right,
               color: Theme.of(context).iconTheme.color.withOpacity(0.8),
               color: Theme.of(context).iconTheme.color.withOpacity(0.8),
             ),
             ),
-            Padding(padding: EdgeInsets.all(2)),
+            const Padding(padding: EdgeInsets.all(2)),
             Text(
             Text(
               "Rotate right",
               "Rotate right",
               style: subtitle2.copyWith(
               style: subtitle2.copyWith(
@@ -266,7 +266,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
               Icons.save_alt_outlined,
               Icons.save_alt_outlined,
               color: Theme.of(context).iconTheme.color.withOpacity(0.8),
               color: Theme.of(context).iconTheme.color.withOpacity(0.8),
             ),
             ),
-            Padding(padding: EdgeInsets.all(2)),
+            const Padding(padding: EdgeInsets.all(2)),
             Text(
             Text(
               "Save copy",
               "Save copy",
               style: subtitle2.copyWith(
               style: subtitle2.copyWith(
@@ -397,7 +397,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
     TextStyle subtitle2 = Theme.of(context).textTheme.subtitle2;
     TextStyle subtitle2 = Theme.of(context).textTheme.subtitle2;
 
 
     return Container(
     return Container(
-      padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
+      padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
       child: Row(
       child: Row(
         children: [
         children: [
           SizedBox(
           SizedBox(
@@ -415,8 +415,8 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
                 activeTrackHeight: 4,
                 activeTrackHeight: 4,
                 inactiveTrackHeight: 2,
                 inactiveTrackHeight: 2,
                 inactiveTrackColor: Colors.grey[900],
                 inactiveTrackColor: Colors.grey[900],
-                activeTrackColor: Color.fromRGBO(45, 150, 98, 1),
-                thumbColor: Color.fromRGBO(45, 150, 98, 1),
+                activeTrackColor: const Color.fromRGBO(45, 150, 98, 1),
+                thumbColor: const Color.fromRGBO(45, 150, 98, 1),
                 thumbRadius: 10,
                 thumbRadius: 10,
                 tooltipBackgroundColor: Colors.grey[900],
                 tooltipBackgroundColor: Colors.grey[900],
               ),
               ),
@@ -443,7 +443,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
     TextStyle subtitle2 = Theme.of(context).textTheme.subtitle2;
     TextStyle subtitle2 = Theme.of(context).textTheme.subtitle2;
 
 
     return Container(
     return Container(
-      padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
+      padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
       child: Row(
       child: Row(
         children: [
         children: [
           SizedBox(
           SizedBox(
@@ -460,9 +460,9 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
               data: SfSliderThemeData(
               data: SfSliderThemeData(
                 activeTrackHeight: 4,
                 activeTrackHeight: 4,
                 inactiveTrackHeight: 2,
                 inactiveTrackHeight: 2,
-                activeTrackColor: Color.fromRGBO(45, 150, 98, 1),
+                activeTrackColor: const Color.fromRGBO(45, 150, 98, 1),
                 inactiveTrackColor: Colors.grey[900],
                 inactiveTrackColor: Colors.grey[900],
-                thumbColor: Color.fromRGBO(45, 150, 98, 1),
+                thumbColor: const Color.fromRGBO(45, 150, 98, 1),
                 thumbRadius: 10,
                 thumbRadius: 10,
                 tooltipBackgroundColor: Colors.grey[900],
                 tooltipBackgroundColor: Colors.grey[900],
               ),
               ),
@@ -487,17 +487,17 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
 
 
   Future<void> _showExitConfirmationDialog() async {
   Future<void> _showExitConfirmationDialog() async {
     AlertDialog alert = AlertDialog(
     AlertDialog alert = AlertDialog(
-      title: Text("Discard edits?"),
+      title: const Text("Discard edits?"),
       actions: [
       actions: [
         TextButton(
         TextButton(
-          child: Text("Yes", style: TextStyle(color: Colors.red)),
+          child: const Text("Yes", style: TextStyle(color: Colors.red)),
           onPressed: () {
           onPressed: () {
             Navigator.of(context, rootNavigator: true).pop('dialog');
             Navigator.of(context, rootNavigator: true).pop('dialog');
             replacePage(context, DetailPage(widget.detailPageConfig));
             replacePage(context, DetailPage(widget.detailPageConfig));
           },
           },
         ),
         ),
         TextButton(
         TextButton(
-          child: Text("No", style: TextStyle(color: Colors.white)),
+          child: const Text("No", style: TextStyle(color: Colors.white)),
           onPressed: () {
           onPressed: () {
             Navigator.of(context, rootNavigator: true).pop('dialog');
             Navigator.of(context, rootNavigator: true).pop('dialog');
           },
           },

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

@@ -21,7 +21,7 @@ class _FreeSpacePageState extends State<FreeSpacePage> {
     return Scaffold(
     return Scaffold(
       appBar: AppBar(
       appBar: AppBar(
         elevation: 0,
         elevation: 0,
-        title: Text("Free up space"),
+        title: const Text("Free up space"),
       ),
       ),
       body: _getBody(),
       body: _getBody(),
     );
     );
@@ -73,11 +73,11 @@ class _FreeSpacePageState extends State<FreeSpacePage> {
           padding: const EdgeInsets.only(left: 36, right: 40),
           padding: const EdgeInsets.only(left: 36, right: 40),
           child: Row(
           child: Row(
             children: [
             children: [
-              Icon(
+              const Icon(
                 Icons.cloud_done_outlined,
                 Icons.cloud_done_outlined,
                 color: Color.fromRGBO(45, 194, 98, 1.0),
                 color: Color.fromRGBO(45, 194, 98, 1.0),
               ),
               ),
-              Padding(padding: EdgeInsets.all(10)),
+              const Padding(padding: EdgeInsets.all(10)),
               Expanded(
               Expanded(
                 child: Text(
                 child: Text(
                   count == 1
                   count == 1
@@ -91,16 +91,16 @@ class _FreeSpacePageState extends State<FreeSpacePage> {
             ],
             ],
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(12)),
+        const Padding(padding: EdgeInsets.all(12)),
         Padding(
         Padding(
           padding: const EdgeInsets.only(left: 36, right: 40),
           padding: const EdgeInsets.only(left: 36, right: 40),
           child: Row(
           child: Row(
             children: [
             children: [
-              Icon(
+              const Icon(
                 Icons.delete_outline,
                 Icons.delete_outline,
                 color: Color.fromRGBO(45, 194, 98, 1.0),
                 color: Color.fromRGBO(45, 194, 98, 1.0),
               ),
               ),
-              Padding(padding: EdgeInsets.all(10)),
+              const Padding(padding: EdgeInsets.all(10)),
               Expanded(
               Expanded(
                 child: Text(
                 child: Text(
                   (count == 1 ? "It" : "They") +
                   (count == 1 ? "It" : "They") +
@@ -112,16 +112,16 @@ class _FreeSpacePageState extends State<FreeSpacePage> {
             ],
             ],
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(12)),
+        const Padding(padding: EdgeInsets.all(12)),
         Padding(
         Padding(
           padding: const EdgeInsets.only(left: 36, right: 40),
           padding: const EdgeInsets.only(left: 36, right: 40),
           child: Row(
           child: Row(
             children: [
             children: [
-              Icon(
+              const Icon(
                 Icons.devices,
                 Icons.devices,
                 color: Color.fromRGBO(45, 194, 98, 1.0),
                 color: Color.fromRGBO(45, 194, 98, 1.0),
               ),
               ),
-              Padding(padding: EdgeInsets.all(10)),
+              const Padding(padding: EdgeInsets.all(10)),
               Expanded(
               Expanded(
                 child: Text(
                 child: Text(
                   "You can still access " +
                   "You can still access " +
@@ -133,10 +133,10 @@ class _FreeSpacePageState extends State<FreeSpacePage> {
             ],
             ],
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(24)),
+        const Padding(padding: EdgeInsets.all(24)),
         Container(
         Container(
           width: double.infinity,
           width: double.infinity,
-          constraints: BoxConstraints(
+          constraints: const BoxConstraints(
             minHeight: 64,
             minHeight: 64,
           ),
           ),
           padding: const EdgeInsets.fromLTRB(60, 0, 60, 0),
           padding: const EdgeInsets.fromLTRB(60, 0, 60, 0),
@@ -147,7 +147,7 @@ class _FreeSpacePageState extends State<FreeSpacePage> {
             text: "Free up " + formatBytes(status.size),
             text: "Free up " + formatBytes(status.size),
           ),
           ),
         ),
         ),
-        Padding(padding: EdgeInsets.all(24)),
+        const Padding(padding: EdgeInsets.all(24)),
       ],
       ],
     );
     );
   }
   }

+ 2 - 2
lib/ui/tools/set_wallpaper_dialog.dart

@@ -21,7 +21,7 @@ class _SetWallpaperDialogState extends State<SetWallpaperDialog> {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     final alert = AlertDialog(
     final alert = AlertDialog(
-      title: Text("Set wallpaper"),
+      title: const Text("Set wallpaper"),
       content: Column(
       content: Column(
         mainAxisSize: MainAxisSize.min,
         mainAxisSize: MainAxisSize.min,
         children: [
         children: [
@@ -59,7 +59,7 @@ class _SetWallpaperDialogState extends State<SetWallpaperDialog> {
       ),
       ),
       actions: [
       actions: [
         TextButton(
         TextButton(
-          child: Text(
+          child: const Text(
             "Ok",
             "Ok",
             style: TextStyle(
             style: TextStyle(
               color: Colors.white,
               color: Colors.white,

+ 5 - 5
lib/ui/viewer/file/detail_page.dart

@@ -153,7 +153,7 @@ class _DetailPageState extends State<DetailPage> {
               _toggleFullScreen();
               _toggleFullScreen();
             });
             });
           },
           },
-          backgroundDecoration: BoxDecoration(color: Colors.black),
+          backgroundDecoration: const BoxDecoration(color: Colors.black),
         );
         );
         _preloadFiles(index);
         _preloadFiles(index);
         return GestureDetector(
         return GestureDetector(
@@ -173,8 +173,8 @@ class _DetailPageState extends State<DetailPage> {
         _preloadFiles(index);
         _preloadFiles(index);
       },
       },
       physics: _shouldDisableScroll
       physics: _shouldDisableScroll
-          ? NeverScrollableScrollPhysics()
-          : PageScrollPhysics(),
+          ? const NeverScrollableScrollPhysics()
+          : const PageScrollPhysics(),
       controller: _pageController,
       controller: _pageController,
       itemCount: _files.length,
       itemCount: _files.length,
     );
     );
@@ -255,7 +255,7 @@ class _DetailPageState extends State<DetailPage> {
     if (_selectedIndex == totalFiles - 1) {
     if (_selectedIndex == totalFiles - 1) {
       // Deleted the last file
       // Deleted the last file
       await _pageController.previousPage(
       await _pageController.previousPage(
-        duration: Duration(milliseconds: 200),
+        duration: const Duration(milliseconds: 200),
         curve: Curves.easeInOut,
         curve: Curves.easeInOut,
       );
       );
       setState(() {
       setState(() {
@@ -263,7 +263,7 @@ class _DetailPageState extends State<DetailPage> {
       });
       });
     } else {
     } else {
       await _pageController.nextPage(
       await _pageController.nextPage(
-        duration: Duration(milliseconds: 200),
+        duration: const Duration(milliseconds: 200),
         curve: Curves.easeInOut,
         curve: Curves.easeInOut,
       );
       );
       setState(() {
       setState(() {

+ 1 - 1
lib/ui/viewer/file/exif_info_dialog.dart

@@ -58,7 +58,7 @@ class _ExifInfoDialogState extends State<ExifInfoDialog> {
             data = "no exif data found";
             data = "no exif data found";
           }
           }
           return Container(
           return Container(
-            padding: EdgeInsets.all(2),
+            padding: const EdgeInsets.all(2),
             color: Colors.white.withOpacity(0.05),
             color: Colors.white.withOpacity(0.05),
             child: Center(
             child: Center(
               child: Padding(
               child: Padding(

+ 16 - 15
lib/ui/viewer/file/fading_app_bar.dart

@@ -58,7 +58,7 @@ class FadingAppBarState extends State<FadingAppBar> {
         ignoring: _shouldHide,
         ignoring: _shouldHide,
         child: AnimatedOpacity(
         child: AnimatedOpacity(
           opacity: _shouldHide ? 0 : 1,
           opacity: _shouldHide ? 0 : 1,
-          duration: Duration(milliseconds: 150),
+          duration: const Duration(milliseconds: 150),
           child: Container(
           child: Container(
             decoration: BoxDecoration(
             decoration: BoxDecoration(
               gradient: LinearGradient(
               gradient: LinearGradient(
@@ -119,10 +119,10 @@ class FadingAppBarState extends State<FadingAppBar> {
                           : CupertinoIcons.cloud_download,
                           : CupertinoIcons.cloud_download,
                       color: Theme.of(context).iconTheme.color,
                       color: Theme.of(context).iconTheme.color,
                     ),
                     ),
-                    Padding(
+                    const Padding(
                       padding: EdgeInsets.all(8),
                       padding: EdgeInsets.all(8),
                     ),
                     ),
-                    Text("Download"),
+                    const Text("Download"),
                   ],
                   ],
                 ),
                 ),
               ),
               ),
@@ -143,10 +143,10 @@ class FadingAppBarState extends State<FadingAppBar> {
                             : CupertinoIcons.time,
                             : CupertinoIcons.time,
                         color: Theme.of(context).iconTheme.color,
                         color: Theme.of(context).iconTheme.color,
                       ),
                       ),
-                      Padding(
+                      const Padding(
                         padding: EdgeInsets.all(8),
                         padding: EdgeInsets.all(8),
                       ),
                       ),
-                      Text("Edit time"),
+                      const Text("Edit time"),
                     ],
                     ],
                   ),
                   ),
                 ),
                 ),
@@ -164,10 +164,10 @@ class FadingAppBarState extends State<FadingAppBar> {
                           : CupertinoIcons.delete,
                           : CupertinoIcons.delete,
                       color: Theme.of(context).iconTheme.color,
                       color: Theme.of(context).iconTheme.color,
                     ),
                     ),
-                    Padding(
+                    const Padding(
                       padding: EdgeInsets.all(8),
                       padding: EdgeInsets.all(8),
                     ),
                     ),
-                    Text("Delete"),
+                    const Text("Delete"),
                   ],
                   ],
                 ),
                 ),
               ),
               ),
@@ -187,10 +187,11 @@ class FadingAppBarState extends State<FadingAppBar> {
       ),
       ),
     );
     );
     return AppBar(
     return AppBar(
-      iconTheme: IconThemeData(color: Colors.white), //same for both themes
+      iconTheme:
+          const IconThemeData(color: Colors.white), //same for both themes
       actions: shouldShowActions ? actions : [],
       actions: shouldShowActions ? actions : [],
       elevation: 0,
       elevation: 0,
-      backgroundColor: Color(0x00000000),
+      backgroundColor: const Color(0x00000000),
     );
     );
   }
   }
 
 
@@ -295,7 +296,7 @@ class FadingAppBarState extends State<FadingAppBar> {
             Navigator.of(context, rootNavigator: true).pop();
             Navigator.of(context, rootNavigator: true).pop();
             widget.onFileDeleted(file);
             widget.onFileDeleted(file);
           },
           },
-          child: Text("Everywhere"),
+          child: const Text("Everywhere"),
         ),
         ),
       );
       );
     } else {
     } else {
@@ -309,7 +310,7 @@ class FadingAppBarState extends State<FadingAppBar> {
             Navigator.of(context, rootNavigator: true).pop();
             Navigator.of(context, rootNavigator: true).pop();
             // TODO: Fix behavior when inside a device folder
             // TODO: Fix behavior when inside a device folder
           },
           },
-          child: Text("Device"),
+          child: const Text("Device"),
         ),
         ),
       );
       );
 
 
@@ -322,7 +323,7 @@ class FadingAppBarState extends State<FadingAppBar> {
             Navigator.of(context, rootNavigator: true).pop();
             Navigator.of(context, rootNavigator: true).pop();
             // TODO: Fix behavior when inside a collection
             // TODO: Fix behavior when inside a collection
           },
           },
-          child: Text("ente"),
+          child: const Text("ente"),
         ),
         ),
       );
       );
 
 
@@ -334,15 +335,15 @@ class FadingAppBarState extends State<FadingAppBar> {
             Navigator.of(context, rootNavigator: true).pop();
             Navigator.of(context, rootNavigator: true).pop();
             widget.onFileDeleted(file);
             widget.onFileDeleted(file);
           },
           },
-          child: Text("Everywhere"),
+          child: const Text("Everywhere"),
         ),
         ),
       );
       );
     }
     }
     final action = CupertinoActionSheet(
     final action = CupertinoActionSheet(
-      title: Text("Delete file?"),
+      title: const Text("Delete file?"),
       actions: actions,
       actions: actions,
       cancelButton: CupertinoActionSheetAction(
       cancelButton: CupertinoActionSheetAction(
-        child: Text("Cancel"),
+        child: const Text("Cancel"),
         onPressed: () {
         onPressed: () {
           Navigator.of(context, rootNavigator: true).pop();
           Navigator.of(context, rootNavigator: true).pop();
         },
         },

+ 4 - 4
lib/ui/viewer/file/fading_bottom_bar.dart

@@ -89,7 +89,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
             child: Padding(
             child: Padding(
               padding: const EdgeInsets.only(top: 12, bottom: 12),
               padding: const EdgeInsets.only(top: 12, bottom: 12),
               child: IconButton(
               child: IconButton(
-                icon: Icon(
+                icon: const Icon(
                   Icons.tune_outlined,
                   Icons.tune_outlined,
                   color: Colors.white,
                   color: Colors.white,
                 ),
                 ),
@@ -156,7 +156,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
       ignoring: _shouldHide,
       ignoring: _shouldHide,
       child: AnimatedOpacity(
       child: AnimatedOpacity(
         opacity: _shouldHide ? 0 : 1,
         opacity: _shouldHide ? 0 : 1,
-        duration: Duration(milliseconds: 150),
+        duration: const Duration(milliseconds: 150),
         child: Align(
         child: Align(
           alignment: Alignment.bottomCenter,
           alignment: Alignment.bottomCenter,
           child: Container(
           child: Container(
@@ -192,7 +192,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
         child: Padding(
         child: Padding(
           padding: const EdgeInsets.only(top: 12, bottom: 12),
           padding: const EdgeInsets.only(top: 12, bottom: 12),
           child: IconButton(
           child: IconButton(
-            icon: Icon(
+            icon: const Icon(
               Icons.restore_outlined,
               Icons.restore_outlined,
               color: Colors.white,
               color: Colors.white,
             ),
             ),
@@ -222,7 +222,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
         child: Padding(
         child: Padding(
           padding: const EdgeInsets.only(top: 12, bottom: 12),
           padding: const EdgeInsets.only(top: 12, bottom: 12),
           child: IconButton(
           child: IconButton(
-            icon: Icon(
+            icon: const Icon(
               Icons.delete_forever_outlined,
               Icons.delete_forever_outlined,
               color: Colors.white,
               color: Colors.white,
             ),
             ),

+ 2 - 2
lib/ui/viewer/file/file_icons_widget.dart

@@ -53,7 +53,7 @@ class VideoOverlayIcon extends StatelessWidget {
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    return SizedBox(
+    return const SizedBox(
       height: 64,
       height: 64,
       child: Icon(
       child: Icon(
         Icons.play_circle_outline,
         Icons.play_circle_outline,
@@ -99,7 +99,7 @@ class TrashedFileOverlayText extends StatelessWidget {
         ),
         ),
       ),
       ),
       alignment: Alignment.bottomCenter,
       alignment: Alignment.bottomCenter,
-      padding: EdgeInsets.only(bottom: 5),
+      padding: const EdgeInsets.only(bottom: 5),
       child: Text(
       child: Text(
         daysLeft(file.deleteBy),
         daysLeft(file.deleteBy),
         style: Theme.of(context)
         style: Theme.of(context)

+ 32 - 32
lib/ui/viewer/file/file_info_dialog.dart

@@ -52,7 +52,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
       Row(
       Row(
         children: [
         children: [
           Icon(Icons.calendar_today_outlined, color: infoColor),
           Icon(Icons.calendar_today_outlined, color: infoColor),
-          Padding(padding: EdgeInsets.all(4)),
+          const Padding(padding: EdgeInsets.all(4)),
           Text(
           Text(
             getFormattedTime(
             getFormattedTime(
               DateTime.fromMicrosecondsSinceEpoch(file.creationTime),
               DateTime.fromMicrosecondsSinceEpoch(file.creationTime),
@@ -61,11 +61,11 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
           ),
           ),
         ],
         ],
       ),
       ),
-      Padding(padding: EdgeInsets.all(6)),
+      const Padding(padding: EdgeInsets.all(6)),
       Row(
       Row(
         children: [
         children: [
           Icon(Icons.folder_outlined, color: infoColor),
           Icon(Icons.folder_outlined, color: infoColor),
-          Padding(padding: EdgeInsets.all(4)),
+          const Padding(padding: EdgeInsets.all(4)),
           Text(
           Text(
             file.deviceFolder ??
             file.deviceFolder ??
                 CollectionsService.instance
                 CollectionsService.instance
@@ -75,18 +75,18 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
           ),
           ),
         ],
         ],
       ),
       ),
-      Padding(padding: EdgeInsets.all(6)),
+      const Padding(padding: EdgeInsets.all(6)),
     ];
     ];
     items.addAll(
     items.addAll(
       [
       [
         Row(
         Row(
           children: [
           children: [
             Icon(Icons.sd_storage_outlined, color: infoColor),
             Icon(Icons.sd_storage_outlined, color: infoColor),
-            Padding(padding: EdgeInsets.all(4)),
+            const Padding(padding: EdgeInsets.all(4)),
             _getFileSize(),
             _getFileSize(),
           ],
           ],
         ),
         ),
-        Padding(padding: EdgeInsets.all(6)),
+        const Padding(padding: EdgeInsets.all(6)),
       ],
       ],
     );
     );
     if (file.localID != null && !_isImage) {
     if (file.localID != null && !_isImage) {
@@ -95,7 +95,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
           Row(
           Row(
             children: [
             children: [
               Icon(Icons.timer_outlined, color: infoColor),
               Icon(Icons.timer_outlined, color: infoColor),
-              Padding(padding: EdgeInsets.all(4)),
+              const Padding(padding: EdgeInsets.all(4)),
               FutureBuilder(
               FutureBuilder(
                 future: file.getAsset(),
                 future: file.getAsset(),
                 builder: (context, snapshot) {
                 builder: (context, snapshot) {
@@ -107,8 +107,8 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
                   } else {
                   } else {
                     return Center(
                     return Center(
                       child: SizedBox.fromSize(
                       child: SizedBox.fromSize(
-                        size: Size.square(24),
-                        child: CupertinoActivityIndicator(
+                        size: const Size.square(24),
+                        child: const CupertinoActivityIndicator(
                           radius: 8,
                           radius: 8,
                         ),
                         ),
                       ),
                       ),
@@ -118,7 +118,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
               ),
               ),
             ],
             ],
           ),
           ),
-          Padding(padding: EdgeInsets.all(6)),
+          const Padding(padding: EdgeInsets.all(6)),
         ],
         ],
       );
       );
     }
     }
@@ -131,7 +131,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
           Row(
           Row(
             children: [
             children: [
               Icon(Icons.cloud_upload_outlined, color: infoColor),
               Icon(Icons.cloud_upload_outlined, color: infoColor),
-              Padding(padding: EdgeInsets.all(4)),
+              const Padding(padding: EdgeInsets.all(4)),
               Text(
               Text(
                 getFormattedTime(
                 getFormattedTime(
                   DateTime.fromMicrosecondsSinceEpoch(file.updationTime),
                   DateTime.fromMicrosecondsSinceEpoch(file.updationTime),
@@ -144,7 +144,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
       );
       );
     }
     }
     items.add(
     items.add(
-      Padding(padding: EdgeInsets.all(12)),
+      const Padding(padding: EdgeInsets.all(12)),
     );
     );
     items.add(
     items.add(
       Row(
       Row(
@@ -169,7 +169,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
                 style: Theme.of(context).textTheme.headline5,
                 style: Theme.of(context).textTheme.headline5,
               ),
               ),
             ),
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             Icon(Icons.edit, color: infoColor),
             Icon(Icons.edit, color: infoColor),
           ],
           ],
         ),
         ),
@@ -201,13 +201,13 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
               children: [
               children: [
                 Center(
                 Center(
                   child: SizedBox.fromSize(
                   child: SizedBox.fromSize(
-                    size: Size.square(24),
-                    child: CupertinoActivityIndicator(
+                    size: const Size.square(24),
+                    child: const CupertinoActivityIndicator(
                       radius: 8,
                       radius: 8,
                     ),
                     ),
                   ),
                   ),
                 ),
                 ),
-                Padding(padding: EdgeInsets.all(4)),
+                const Padding(padding: EdgeInsets.all(4)),
                 Text(
                 Text(
                   "EXIF",
                   "EXIF",
                   style: TextStyle(color: infoColor),
                   style: TextStyle(color: infoColor),
@@ -232,7 +232,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
               mainAxisAlignment: MainAxisAlignment.spaceAround,
               mainAxisAlignment: MainAxisAlignment.spaceAround,
               children: [
               children: [
                 Icon(Icons.feed_outlined, color: infoColor),
                 Icon(Icons.feed_outlined, color: infoColor),
-                Padding(padding: EdgeInsets.all(4)),
+                const Padding(padding: EdgeInsets.all(4)),
                 Text(
                 Text(
                   "View raw EXIF",
                   "View raw EXIF",
                   style: TextStyle(color: infoColor),
                   style: TextStyle(color: infoColor),
@@ -263,7 +263,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
                       .defaultTextColor
                       .defaultTextColor
                       .withOpacity(0.5),
                       .withOpacity(0.5),
                 ),
                 ),
-                Padding(padding: EdgeInsets.all(4)),
+                const Padding(padding: EdgeInsets.all(4)),
                 Text(
                 Text(
                   "No exif",
                   "No exif",
                   style: TextStyle(
                   style: TextStyle(
@@ -314,7 +314,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
         Row(
         Row(
           children: [
           children: [
             Icon(Icons.photo_size_select_actual_outlined, color: infoColor),
             Icon(Icons.photo_size_select_actual_outlined, color: infoColor),
-            Padding(padding: EdgeInsets.all(4)),
+            const Padding(padding: EdgeInsets.all(4)),
             Text(
             Text(
               exif["EXIF ExifImageWidth"].toString() +
               exif["EXIF ExifImageWidth"].toString() +
                   " x " +
                   " x " +
@@ -323,7 +323,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
             ),
             ),
           ],
           ],
         ),
         ),
-        Padding(padding: EdgeInsets.all(6)),
+        const Padding(padding: EdgeInsets.all(6)),
       ]);
       ]);
     } else if (exif["Image ImageWidth"] != null &&
     } else if (exif["Image ImageWidth"] != null &&
         exif["Image ImageLength"] != null) {
         exif["Image ImageLength"] != null) {
@@ -331,7 +331,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
         Row(
         Row(
           children: [
           children: [
             Icon(Icons.photo_size_select_actual_outlined, color: infoColor),
             Icon(Icons.photo_size_select_actual_outlined, color: infoColor),
-            Padding(padding: EdgeInsets.all(4)),
+            const Padding(padding: EdgeInsets.all(4)),
             Text(
             Text(
               exif["Image ImageWidth"].toString() +
               exif["Image ImageWidth"].toString() +
                   " x " +
                   " x " +
@@ -340,7 +340,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
             ),
             ),
           ],
           ],
         ),
         ),
-        Padding(padding: EdgeInsets.all(6)),
+        const Padding(padding: EdgeInsets.all(6)),
       ]);
       ]);
     }
     }
     if (exif["Image Make"] != null && exif["Image Model"] != null) {
     if (exif["Image Make"] != null && exif["Image Model"] != null) {
@@ -349,7 +349,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
           Row(
           Row(
             children: [
             children: [
               Icon(Icons.camera_outlined, color: infoColor),
               Icon(Icons.camera_outlined, color: infoColor),
-              Padding(padding: EdgeInsets.all(4)),
+              const Padding(padding: EdgeInsets.all(4)),
               Flexible(
               Flexible(
                 child: Text(
                 child: Text(
                   exif["Image Make"].toString() +
                   exif["Image Make"].toString() +
@@ -361,7 +361,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
               ),
               ),
             ],
             ],
           ),
           ),
-          Padding(padding: EdgeInsets.all(6)),
+          const Padding(padding: EdgeInsets.all(6)),
         ],
         ],
       );
       );
     }
     }
@@ -370,14 +370,14 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
         Row(
         Row(
           children: [
           children: [
             Icon(CupertinoIcons.f_cursive, color: infoColor),
             Icon(CupertinoIcons.f_cursive, color: infoColor),
-            Padding(padding: EdgeInsets.all(4)),
+            const Padding(padding: EdgeInsets.all(4)),
             Text(
             Text(
               fNumber.toString(),
               fNumber.toString(),
               style: TextStyle(color: infoColor),
               style: TextStyle(color: infoColor),
             ),
             ),
           ],
           ],
         ),
         ),
-        Padding(padding: EdgeInsets.all(6)),
+        const Padding(padding: EdgeInsets.all(6)),
       ]);
       ]);
     }
     }
     if (focalLength != null) {
     if (focalLength != null) {
@@ -385,14 +385,14 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
         Row(
         Row(
           children: [
           children: [
             Icon(Icons.center_focus_strong_outlined, color: infoColor),
             Icon(Icons.center_focus_strong_outlined, color: infoColor),
-            Padding(padding: EdgeInsets.all(4)),
+            const Padding(padding: EdgeInsets.all(4)),
             Text(
             Text(
               focalLength.toString() + " mm",
               focalLength.toString() + " mm",
               style: TextStyle(color: infoColor),
               style: TextStyle(color: infoColor),
             ),
             ),
           ],
           ],
         ),
         ),
-        Padding(padding: EdgeInsets.all(6)),
+        const Padding(padding: EdgeInsets.all(6)),
       ]);
       ]);
     }
     }
     if (exif["EXIF ExposureTime"] != null) {
     if (exif["EXIF ExposureTime"] != null) {
@@ -400,14 +400,14 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
         Row(
         Row(
           children: [
           children: [
             Icon(Icons.shutter_speed, color: infoColor),
             Icon(Icons.shutter_speed, color: infoColor),
-            Padding(padding: EdgeInsets.all(4)),
+            const Padding(padding: EdgeInsets.all(4)),
             Text(
             Text(
               exif["EXIF ExposureTime"].toString(),
               exif["EXIF ExposureTime"].toString(),
               style: TextStyle(color: infoColor),
               style: TextStyle(color: infoColor),
             ),
             ),
           ],
           ],
         ),
         ),
-        Padding(padding: EdgeInsets.all(6)),
+        const Padding(padding: EdgeInsets.all(6)),
       ]);
       ]);
     }
     }
     return Column(
     return Column(
@@ -427,8 +427,8 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
         } else {
         } else {
           return Center(
           return Center(
             child: SizedBox.fromSize(
             child: SizedBox.fromSize(
-              size: Size.square(24),
-              child: CupertinoActivityIndicator(
+              size: const Size.square(24),
+              child: const CupertinoActivityIndicator(
                 radius: 8,
                 radius: 8,
               ),
               ),
             ),
             ),

+ 1 - 1
lib/ui/viewer/file/file_widget.dart

@@ -49,7 +49,7 @@ class FileWidget extends StatelessWidget {
       );
       );
     } else {
     } else {
       Logger('FileWidget').severe('unsupported file type ${file.fileType}');
       Logger('FileWidget').severe('unsupported file type ${file.fileType}');
-      return Icon(Icons.error);
+      return const Icon(Icons.error);
     }
     }
   }
   }
 }
 }

+ 2 - 2
lib/ui/viewer/file/thumbnail_widget.dart

@@ -56,7 +56,7 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
   @override
   @override
   void dispose() {
   void dispose() {
     super.dispose();
     super.dispose();
-    Future.delayed(Duration(milliseconds: 10), () {
+    Future.delayed(const Duration(milliseconds: 10), () {
       // Cancel request only if the widget has been unmounted
       // Cancel request only if the widget has been unmounted
       if (!mounted && widget.file.isRemoteFile() && !_hasLoadedThumbnail) {
       if (!mounted && widget.file.isRemoteFile() && !_hasLoadedThumbnail) {
         removePendingGetThumbnailRequestIfAny(widget.file);
         removePendingGetThumbnailRequestIfAny(widget.file);
@@ -109,7 +109,7 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
       const ThumbnailPlaceHolder(),
       const ThumbnailPlaceHolder(),
       AnimatedOpacity(
       AnimatedOpacity(
         opacity: content == null ? 0 : 1.0,
         opacity: content == null ? 0 : 1.0,
-        duration: Duration(milliseconds: 200),
+        duration: const Duration(milliseconds: 200),
         child: content,
         child: content,
       )
       )
     ];
     ];

+ 11 - 11
lib/ui/viewer/file/video_controls.dart

@@ -113,10 +113,10 @@ class _VideoControlsState extends State<VideoControls> {
     final iconColor = Theme.of(context).textTheme.button.color;
     final iconColor = Theme.of(context).textTheme.button.color;
 
 
     return Container(
     return Container(
-      padding: EdgeInsets.only(bottom: 60),
+      padding: const EdgeInsets.only(bottom: 60),
       child: AnimatedOpacity(
       child: AnimatedOpacity(
         opacity: _hideStuff ? 0.0 : 1.0,
         opacity: _hideStuff ? 0.0 : 1.0,
-        duration: Duration(milliseconds: 300),
+        duration: const Duration(milliseconds: 300),
         child: Container(
         child: Container(
           height: barHeight,
           height: barHeight,
           color: Colors.transparent,
           color: Colors.transparent,
@@ -158,11 +158,11 @@ class _VideoControlsState extends State<VideoControls> {
             child: AnimatedOpacity(
             child: AnimatedOpacity(
               opacity:
               opacity:
                   _latestValue != null && !_hideStuff && !_dragging ? 1.0 : 0.0,
                   _latestValue != null && !_hideStuff && !_dragging ? 1.0 : 0.0,
-              duration: Duration(milliseconds: 300),
+              duration: const Duration(milliseconds: 300),
               child: GestureDetector(
               child: GestureDetector(
                 onTap: _playPause,
                 onTap: _playPause,
                 child: Padding(
                 child: Padding(
-                  padding: EdgeInsets.all(12.0),
+                  padding: const EdgeInsets.all(12.0),
                   child: Icon(
                   child: Icon(
                     _latestValue.isPlaying ? Icons.pause : Icons.play_arrow,
                     _latestValue.isPlaying ? Icons.pause : Icons.play_arrow,
                     color: Colors.white, // same for both themes
                     color: Colors.white, // same for both themes
@@ -183,10 +183,10 @@ class _VideoControlsState extends State<VideoControls> {
         : Duration.zero;
         : Duration.zero;
 
 
     return Container(
     return Container(
-      margin: EdgeInsets.only(left: 20.0, right: 16.0),
+      margin: const EdgeInsets.only(left: 20.0, right: 16.0),
       child: Text(
       child: Text(
         formatDuration(position),
         formatDuration(position),
-        style: TextStyle(
+        style: const TextStyle(
           fontSize: 12.0,
           fontSize: 12.0,
           color: Colors.white,
           color: Colors.white,
         ),
         ),
@@ -200,10 +200,10 @@ class _VideoControlsState extends State<VideoControls> {
         : Duration.zero;
         : Duration.zero;
 
 
     return Padding(
     return Padding(
-      padding: EdgeInsets.only(right: 20.0),
+      padding: const EdgeInsets.only(right: 20.0),
       child: Text(
       child: Text(
         formatDuration(duration),
         formatDuration(duration),
-        style: TextStyle(
+        style: const TextStyle(
           fontSize: 12.0,
           fontSize: 12.0,
           color: Colors.white,
           color: Colors.white,
         ),
         ),
@@ -232,7 +232,7 @@ class _VideoControlsState extends State<VideoControls> {
     }
     }
 
 
     if (chewieController.showControlsOnInitialize) {
     if (chewieController.showControlsOnInitialize) {
-      _initTimer = Timer(Duration(milliseconds: 200), () {
+      _initTimer = Timer(const Duration(milliseconds: 200), () {
         setState(() {
         setState(() {
           _hideStuff = false;
           _hideStuff = false;
         });
         });
@@ -257,7 +257,7 @@ class _VideoControlsState extends State<VideoControls> {
           });
           });
         } else {
         } else {
           if (isFinished) {
           if (isFinished) {
-            controller.seekTo(Duration(seconds: 0));
+            controller.seekTo(const Duration(seconds: 0));
           }
           }
           controller.play();
           controller.play();
         }
         }
@@ -282,7 +282,7 @@ class _VideoControlsState extends State<VideoControls> {
   Widget _buildProgressBar() {
   Widget _buildProgressBar() {
     return Expanded(
     return Expanded(
       child: Padding(
       child: Padding(
-        padding: EdgeInsets.only(right: 16.0),
+        padding: const EdgeInsets.only(right: 16.0),
         child: MaterialVideoProgressBar(
         child: MaterialVideoProgressBar(
           controller,
           controller,
           onDragStart: () {
           onDragStart: () {

+ 6 - 6
lib/ui/viewer/file/video_widget.dart

@@ -146,19 +146,19 @@ class _VideoWidgetState extends State<VideoWidget> {
         _getThumbnail(),
         _getThumbnail(),
         Container(
         Container(
           color: Colors.black12,
           color: Colors.black12,
-          constraints: BoxConstraints.expand(),
+          constraints: const BoxConstraints.expand(),
         ),
         ),
         Center(
         Center(
           child: SizedBox.fromSize(
           child: SizedBox.fromSize(
-            size: Size.square(30),
+            size: const Size.square(30),
             child: _progress == null || _progress == 1
             child: _progress == null || _progress == 1
-                ? CupertinoActivityIndicator(
+                ? const CupertinoActivityIndicator(
                     color: Colors.white,
                     color: Colors.white,
                   )
                   )
                 : CircularProgressIndicator(
                 : CircularProgressIndicator(
                     backgroundColor: Colors.black,
                     backgroundColor: Colors.black,
                     value: _progress,
                     value: _progress,
-                    valueColor: AlwaysStoppedAnimation<Color>(
+                    valueColor: const AlwaysStoppedAnimation<Color>(
                       Color.fromRGBO(45, 194, 98, 1.0),
                       Color.fromRGBO(45, 194, 98, 1.0),
                     ),
                     ),
                   ),
                   ),
@@ -171,7 +171,7 @@ class _VideoWidgetState extends State<VideoWidget> {
   Widget _getThumbnail() {
   Widget _getThumbnail() {
     return Container(
     return Container(
       color: Colors.black,
       color: Colors.black,
-      constraints: BoxConstraints.expand(),
+      constraints: const BoxConstraints.expand(),
       child: ThumbnailWidget(
       child: ThumbnailWidget(
         widget.file,
         widget.file,
         fit: BoxFit.contain,
         fit: BoxFit.contain,
@@ -196,7 +196,7 @@ class _VideoWidgetState extends State<VideoWidget> {
       looping: true,
       looping: true,
       allowMuting: true,
       allowMuting: true,
       allowFullScreen: false,
       allowFullScreen: false,
-      customControls: VideoControls(),
+      customControls: const VideoControls(),
     );
     );
     return Container(
     return Container(
       color: Colors.black,
       color: Colors.black,

+ 2 - 2
lib/ui/viewer/file/zoomable_live_image.dart

@@ -124,7 +124,7 @@ class _ZoomableLiveImageState extends State<ZoomableLiveImage>
     }
     }
 
 
     var videoFile = await getFile(widget.file, liveVideo: true)
     var videoFile = await getFile(widget.file, liveVideo: true)
-        .timeout(Duration(seconds: 15))
+        .timeout(const Duration(seconds: 15))
         .onError((e, s) {
         .onError((e, s) {
       _logger.info("getFile failed ${_file.tag()}", e);
       _logger.info("getFile failed ${_file.tag()}", e);
       return null;
       return null;
@@ -133,7 +133,7 @@ class _ZoomableLiveImageState extends State<ZoomableLiveImage>
     if ((videoFile == null || !videoFile.existsSync()) &&
     if ((videoFile == null || !videoFile.existsSync()) &&
         _file.isRemoteFile()) {
         _file.isRemoteFile()) {
       videoFile = await getFileFromServer(widget.file, liveVideo: true)
       videoFile = await getFileFromServer(widget.file, liveVideo: true)
-          .timeout(Duration(seconds: 15))
+          .timeout(const Duration(seconds: 15))
           .onError((e, s) {
           .onError((e, s) {
         _logger.info("getRemoteFile failed ${_file.tag()}", e);
         _logger.info("getRemoteFile failed ${_file.tag()}", e);
         return null;
         return null;

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

@@ -58,7 +58,7 @@ class ArchivePage extends StatelessWidget {
       tagPrefix: tagPrefix,
       tagPrefix: tagPrefix,
       selectedFiles: _selectedFiles,
       selectedFiles: _selectedFiles,
       initialFiles: null,
       initialFiles: null,
-      footer: SizedBox(height: 32),
+      footer: const SizedBox(height: 32),
     );
     );
     return Scaffold(
     return Scaffold(
       appBar: PreferredSize(
       appBar: PreferredSize(

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

@@ -54,7 +54,7 @@ class CollectionPage extends StatelessWidget {
     );
     );
     return Scaffold(
     return Scaffold(
       appBar: PreferredSize(
       appBar: PreferredSize(
-        preferredSize: Size.fromHeight(50.0),
+        preferredSize: const Size.fromHeight(50.0),
         child: GalleryAppBarWidget(
         child: GalleryAppBarWidget(
           appBarType,
           appBarType,
           c.collection.name,
           c.collection.name,

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

@@ -42,11 +42,11 @@ class DeviceFolderPage extends StatelessWidget {
           ? _getHeaderWidget()
           ? _getHeaderWidget()
           : Container(),
           : Container(),
       initialFiles: [folder.thumbnail],
       initialFiles: [folder.thumbnail],
-      footer: SizedBox(height: 32),
+      footer: const SizedBox(height: 32),
     );
     );
     return Scaffold(
     return Scaffold(
       appBar: PreferredSize(
       appBar: PreferredSize(
-        preferredSize: Size.fromHeight(50.0),
+        preferredSize: const Size.fromHeight(50.0),
         child: GalleryAppBarWidget(
         child: GalleryAppBarWidget(
           GalleryType.localFolder,
           GalleryType.localFolder,
           folder.name,
           folder.name,
@@ -89,14 +89,14 @@ class _BackupConfigurationHeaderWidgetState
     final isBackedUp =
     final isBackedUp =
         Configuration.instance.getPathsToBackUp().contains(widget.path);
         Configuration.instance.getPathsToBackUp().contains(widget.path);
     return Container(
     return Container(
-      padding: EdgeInsets.only(left: 20, right: 12, top: 4, bottom: 4),
-      margin: EdgeInsets.only(bottom: 12),
+      padding: const EdgeInsets.only(left: 20, right: 12, top: 4, bottom: 4),
+      margin: const EdgeInsets.only(bottom: 12),
       color: Theme.of(context).colorScheme.backupEnabledBgColor,
       color: Theme.of(context).colorScheme.backupEnabledBgColor,
       child: Row(
       child: Row(
         mainAxisAlignment: MainAxisAlignment.spaceBetween,
         mainAxisAlignment: MainAxisAlignment.spaceBetween,
         children: [
         children: [
           isBackedUp
           isBackedUp
-              ? Text("Backup enabled")
+              ? const Text("Backup enabled")
               : Text(
               : Text(
                   "Backup disabled",
                   "Backup disabled",
                   style: TextStyle(
                   style: TextStyle(

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

@@ -67,7 +67,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
     // if (widget.selectedFiles.files.isEmpty) {
     // if (widget.selectedFiles.files.isEmpty) {
     return AppBar(
     return AppBar(
       backgroundColor:
       backgroundColor:
-          widget.type == GalleryType.homepage ? Color(0x00000000) : null,
+          widget.type == GalleryType.homepage ? const Color(0x00000000) : null,
       elevation: 0,
       elevation: 0,
       centerTitle: false,
       centerTitle: false,
       title: widget.type == GalleryType.homepage
       title: widget.type == GalleryType.homepage
@@ -163,7 +163,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
                 child: Row(
                 child: Row(
                   children: [
                   children: [
                     Icon(isArchived ? Icons.visibility : Icons.visibility_off),
                     Icon(isArchived ? Icons.visibility : Icons.visibility_off),
-                    Padding(
+                    const Padding(
                       padding: EdgeInsets.all(8),
                       padding: EdgeInsets.all(8),
                     ),
                     ),
                     Text(isArchived ? "Unhide" : "Hide"),
                     Text(isArchived ? "Unhide" : "Hide"),

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

@@ -19,7 +19,7 @@ class GalleryFooterWidget extends StatelessWidget {
           } else {
           } else {
             routeToPage(
             routeToPage(
               context,
               context,
-              BackupFolderSelectionPage(
+              const BackupFolderSelectionPage(
                 buttonText: "Preserve",
                 buttonText: "Preserve",
               ),
               ),
             );
             );

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

@@ -71,11 +71,11 @@ class _GalleryOverlayWidgetState extends State<GalleryOverlayWidget> {
     return Padding(
     return Padding(
       padding: EdgeInsets.only(bottom: bottomPadding),
       padding: EdgeInsets.only(bottom: bottomPadding),
       child: AnimatedContainer(
       child: AnimatedContainer(
-        duration: Duration(milliseconds: 300),
+        duration: const Duration(milliseconds: 300),
         curve: Curves.easeInOut,
         curve: Curves.easeInOut,
         height: filesAreSelected ? 108 : 0,
         height: filesAreSelected ? 108 : 0,
         child: AnimatedOpacity(
         child: AnimatedOpacity(
-          duration: Duration(milliseconds: 100),
+          duration: const Duration(milliseconds: 100),
           opacity: filesAreSelected ? 1.0 : 0.0,
           opacity: filesAreSelected ? 1.0 : 0.0,
           curve: Curves.easeIn,
           curve: Curves.easeIn,
           child: IgnorePointer(
           child: IgnorePointer(
@@ -196,7 +196,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
                   child: BackdropFilter(
                   child: BackdropFilter(
                     filter: ImageFilter.blur(sigmaX: 50, sigmaY: 50),
                     filter: ImageFilter.blur(sigmaX: 50, sigmaY: 50),
                     child: Container(
                     child: Container(
-                      padding: EdgeInsets.symmetric(vertical: 8),
+                      padding: const EdgeInsets.symmetric(vertical: 8),
                       //height: 32,
                       //height: 32,
                       width: 86,
                       width: 86,
                       color: Theme.of(context)
                       color: Theme.of(context)
@@ -355,7 +355,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
             message: "Remove",
             message: "Remove",
             child: IconButton(
             child: IconButton(
               color: Theme.of(context).colorScheme.iconColor,
               color: Theme.of(context).colorScheme.iconColor,
-              icon: Icon(
+              icon: const Icon(
                 Icons.remove_circle_rounded,
                 Icons.remove_circle_rounded,
               ),
               ),
               onPressed: () {
               onPressed: () {
@@ -397,7 +397,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
         message: "Restore",
         message: "Restore",
         child: IconButton(
         child: IconButton(
           color: Theme.of(context).colorScheme.iconColor,
           color: Theme.of(context).colorScheme.iconColor,
-          icon: Icon(
+          icon: const Icon(
             Icons.restore,
             Icons.restore,
           ),
           ),
           onPressed: () {
           onPressed: () {
@@ -421,7 +421,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
         message: "Delete permanently",
         message: "Delete permanently",
         child: IconButton(
         child: IconButton(
           color: Theme.of(context).colorScheme.iconColor,
           color: Theme.of(context).colorScheme.iconColor,
-          icon: Icon(
+          icon: const Icon(
             Icons.delete_forever,
             Icons.delete_forever,
           ),
           ),
           onPressed: () async {
           onPressed: () async {
@@ -488,7 +488,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
             _clearSelectedFiles();
             _clearSelectedFiles();
             showToast(context, "Files deleted from device");
             showToast(context, "Files deleted from device");
           },
           },
-          child: Text("Device"),
+          child: const Text("Device"),
         ),
         ),
       );
       );
       actions.add(
       actions.add(
@@ -503,7 +503,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
             _clearSelectedFiles();
             _clearSelectedFiles();
             showShortToast(context, "Moved to trash");
             showShortToast(context, "Moved to trash");
           },
           },
-          child: Text("ente"),
+          child: const Text("ente"),
         ),
         ),
       );
       );
       actions.add(
       actions.add(
@@ -517,7 +517,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
             );
             );
             _clearSelectedFiles();
             _clearSelectedFiles();
           },
           },
-          child: Text("Everywhere"),
+          child: const Text("Everywhere"),
         ),
         ),
       );
       );
     } else {
     } else {
@@ -532,7 +532,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
             );
             );
             _clearSelectedFiles();
             _clearSelectedFiles();
           },
           },
-          child: Text("Delete"),
+          child: const Text("Delete"),
         ),
         ),
       );
       );
     }
     }
@@ -546,7 +546,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
       ),
       ),
       actions: actions,
       actions: actions,
       cancelButton: CupertinoActionSheetAction(
       cancelButton: CupertinoActionSheetAction(
-        child: Text("Cancel"),
+        child: const Text("Cancel"),
         onPressed: () {
         onPressed: () {
           Navigator.of(context, rootNavigator: true).pop();
           Navigator.of(context, rootNavigator: true).pop();
         },
         },
@@ -591,11 +591,11 @@ class _OverlayWidgetState extends State<OverlayWidget> {
               showGenericErrorDialog(context);
               showGenericErrorDialog(context);
             }
             }
           },
           },
-          child: Text("Remove"),
+          child: const Text("Remove"),
         ),
         ),
       ],
       ],
       cancelButton: CupertinoActionSheetAction(
       cancelButton: CupertinoActionSheetAction(
-        child: Text("Cancel"),
+        child: const Text("Cancel"),
         onPressed: () {
         onPressed: () {
           Navigator.of(context, rootNavigator: true).pop();
           Navigator.of(context, rootNavigator: true).pop();
         },
         },

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

@@ -79,7 +79,7 @@ class _TrashPageState extends State<TrashPage> {
 
 
     return Scaffold(
     return Scaffold(
       appBar: PreferredSize(
       appBar: PreferredSize(
-        preferredSize: Size.fromHeight(50.0),
+        preferredSize: const Size.fromHeight(50.0),
         child: GalleryAppBarWidget(
         child: GalleryAppBarWidget(
           widget.appBarType,
           widget.appBarType,
           "Trash",
           "Trash",
@@ -90,20 +90,20 @@ class _TrashPageState extends State<TrashPage> {
         alignment: Alignment.bottomCenter,
         alignment: Alignment.bottomCenter,
         children: [
         children: [
           gallery,
           gallery,
-          BottomShadowWidget(
+          const BottomShadowWidget(
             offsetDy: 20,
             offsetDy: 20,
           ),
           ),
           AnimatedContainer(
           AnimatedContainer(
-            duration: Duration(milliseconds: 300),
+            duration: const Duration(milliseconds: 300),
             curve: Curves.easeInOut,
             curve: Curves.easeInOut,
             height: filesAreSelected ? 0 : 80,
             height: filesAreSelected ? 0 : 80,
             child: AnimatedOpacity(
             child: AnimatedOpacity(
-              duration: Duration(milliseconds: 100),
+              duration: const Duration(milliseconds: 100),
               opacity: filesAreSelected ? 0.0 : 1.0,
               opacity: filesAreSelected ? 0.0 : 1.0,
               curve: Curves.easeIn,
               curve: Curves.easeIn,
               child: IgnorePointer(
               child: IgnorePointer(
                 ignoring: filesAreSelected,
                 ignoring: filesAreSelected,
-                child: SafeArea(
+                child: const SafeArea(
                   minimum: EdgeInsets.only(bottom: 6),
                   minimum: EdgeInsets.only(bottom: 6),
                   child: BottomButtonsWidget(),
                   child: BottomButtonsWidget(),
                 ),
                 ),
@@ -125,7 +125,7 @@ class _TrashPageState extends State<TrashPage> {
       builder: (context, snapshot) {
       builder: (context, snapshot) {
         if (snapshot.hasData && snapshot.data > 0) {
         if (snapshot.hasData && snapshot.data > 0) {
           return Padding(
           return Padding(
-            padding: EdgeInsets.all(16),
+            padding: const EdgeInsets.all(16),
             child: Text(
             child: Text(
               'Items show the number the days remaining before permanent deletion',
               'Items show the number the days remaining before permanent deletion',
               style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16),
               style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16),
@@ -155,7 +155,7 @@ class BottomButtonsWidget extends StatelessWidget {
               filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
               filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
               child: Container(
               child: Container(
                 height: 40,
                 height: 40,
-                decoration: BoxDecoration(
+                decoration: const BoxDecoration(
                   color: Color.fromRGBO(255, 101, 101, 0.2),
                   color: Color.fromRGBO(255, 101, 101, 0.2),
                 ),
                 ),
                 child: Center(
                 child: Center(
@@ -167,7 +167,7 @@ class BottomButtonsWidget extends StatelessWidget {
                     child: Text(
                     child: Text(
                       'Delete All',
                       'Delete All',
                       style: Theme.of(context).textTheme.subtitle2.copyWith(
                       style: Theme.of(context).textTheme.subtitle2.copyWith(
-                            color: Color.fromRGBO(255, 101, 101, 1),
+                            color: const Color.fromRGBO(255, 101, 101, 1),
                           ),
                           ),
                     ),
                     ),
                   ),
                   ),

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä