Neeraj Gupta 3 سال پیش
والد
کامیت
460dd1203e
100فایلهای تغییر یافته به همراه959 افزوده شده و 907 حذف شده
  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
     library_private_types_in_public_api: warning
     constant_identifier_names: warning
+    prefer_const_constructors: warning
+    prefer_const_declarations: warning
+    unnecessary_const: error
     cancel_subscriptions: error
 
     use_build_context_synchronously: ignore # experimental lint, requires many changes
     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_double_quotes: ignore # too many warnings
     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";
   static const anonymousUserIDKey = "anonymous_user_id";
 
-  final kTempFolderDeletionTimeBuffer = Duration(days: 1).inMicroseconds;
+  final kTempFolderDeletionTimeBuffer = const Duration(days: 1).inMicroseconds;
 
   static final _logger = Logger("Configuration");
 
@@ -80,11 +80,11 @@ class Configuration {
   String _volatilePassword;
 
   final _secureStorageOptionsIOS =
-      IOSOptions(accessibility: IOSAccessibility.first_unlock);
+      const IOSOptions(accessibility: IOSAccessibility.first_unlock);
 
   Future<void> init() async {
     _preferences = await SharedPreferences.getInstance();
-    _secureStorage = FlutterSecureStorage();
+    _secureStorage = const FlutterSecureStorage();
     _documentsDirectory = (await getApplicationDocumentsDirectory()).path;
     _tempDirectory = _documentsDirectory + "/temp/";
     final tempDirectory = io.Directory(_tempDirectory);
@@ -128,7 +128,9 @@ class Configuration {
     if (SyncService.instance.isSyncInProgress()) {
       SyncService.instance.stopSync();
       try {
-        await SyncService.instance.existingSync().timeout(Duration(seconds: 5));
+        await SyncService.instance
+            .existingSync()
+            .timeout(const Duration(seconds: 5));
       } catch (e) {
         // ignore
       }
@@ -590,6 +592,7 @@ class Configuration {
 
   Future<String> _getOrCreateAnonymousUserID() async {
     if (!_preferences.containsKey(anonymousUserIDKey)) {
+      //ignore: prefer_const_constructors
       await _preferences.setString(anonymousUserIDKey, Uuid().v4());
     }
     return _preferences.getString(anonymousUserIDKey);

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

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

+ 1 - 0
lib/core/network.dart

@@ -43,6 +43,7 @@ class Network {
 class RequestIdInterceptor extends Interceptor {
   @override
   void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
+    // ignore: prefer_const_constructors
     options.headers.putIfAbsent("x-request-id", () => Uuid().v4().toString());
     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';
 
 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
-  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 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';
 
 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 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 {
     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
   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 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
-  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
   // Only parse & store selected fields from JSON in separate columns if
   // 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 migrationScripts = [

+ 7 - 7
lib/db/ignored_files_db.dart

@@ -11,15 +11,15 @@ import 'package:sqflite/sqflite.dart';
 // Common use case:
 // when a user deletes a file just from ente on current or different device.
 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 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 {
     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';
 
 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();
   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';
 
 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();
   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,
 // during restore, all file attributes will be fetched & stored as required.
 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 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
-  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 {
     await db.execute(

+ 74 - 72
lib/ente_theme_data.dart

@@ -7,14 +7,15 @@ final lightThemeData = ThemeData(
   hintColor: Colors.grey,
   primaryColor: Colors.deepOrangeAccent,
   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,
     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(
     bgDisabled: Colors.grey.shade500,
     bgEnabled: Colors.black,
@@ -28,27 +29,27 @@ final lightThemeData = ThemeData(
   toggleableActiveColor: Colors.green[400],
   scaffoldBackgroundColor: Colors.white,
   backgroundColor: Colors.white,
-  appBarTheme: AppBarTheme().copyWith(
+  appBarTheme: const AppBarTheme().copyWith(
     backgroundColor: Colors.white,
     foregroundColor: Colors.black,
-    iconTheme: IconThemeData(color: Colors.black),
+    iconTheme: const IconThemeData(color: Colors.black),
     elevation: 0,
   ),
   //https://api.flutter.dev/flutter/material/TextTheme-class.html
   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,
       fontSize: 24,
       fontWeight: FontWeight.w600,
     ),
-    contentTextStyle: TextStyle(
+    contentTextStyle: const TextStyle(
       fontFamily: 'Inter-Medium',
       color: Colors.black,
       fontSize: 16,
@@ -56,15 +57,15 @@ final lightThemeData = ThemeData(
     ),
     shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
   ),
-  inputDecorationTheme: InputDecorationTheme().copyWith(
-    focusedBorder: UnderlineInputBorder(
+  inputDecorationTheme: const InputDecorationTheme().copyWith(
+    focusedBorder: const UnderlineInputBorder(
       borderSide: BorderSide(
         color: Color.fromRGBO(45, 194, 98, 1.0),
       ),
     ),
   ),
   checkboxTheme: CheckboxThemeData(
-    side: BorderSide(
+    side: const BorderSide(
       color: Colors.black,
       width: 2,
     ),
@@ -85,14 +86,15 @@ final darkThemeData = ThemeData(
   fontFamily: 'Inter',
   brightness: Brightness.dark,
   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,
-  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),
   toggleableActiveColor: Colors.green[400],
@@ -108,19 +110,19 @@ final darkThemeData = ThemeData(
   ),
   scaffoldBackgroundColor: Colors.black,
   backgroundColor: Colors.black,
-  appBarTheme: AppBarTheme().copyWith(
+  appBarTheme: const AppBarTheme().copyWith(
     color: Colors.black,
     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,
       fontSize: 24,
       fontWeight: FontWeight.w600,
     ),
-    contentTextStyle: TextStyle(
+    contentTextStyle: const TextStyle(
       fontFamily: 'Inter-Medium',
       color: Colors.white,
       fontSize: 16,
@@ -128,15 +130,15 @@ final darkThemeData = ThemeData(
     ),
     shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
   ),
-  inputDecorationTheme: InputDecorationTheme().copyWith(
-    focusedBorder: UnderlineInputBorder(
+  inputDecorationTheme: const InputDecorationTheme().copyWith(
+    focusedBorder: const UnderlineInputBorder(
       borderSide: BorderSide(
         color: Color.fromRGBO(45, 194, 98, 1.0),
       ),
     ),
   ),
   checkboxTheme: CheckboxThemeData(
-    side: BorderSide(
+    side: const BorderSide(
       color: Colors.grey,
       width: 2,
     ),
@@ -158,7 +160,7 @@ final darkThemeData = ThemeData(
 );
 
 TextTheme _buildTextTheme(Color textColor) {
-  return TextTheme().copyWith(
+  return const TextTheme().copyWith(
     headline4: TextStyle(
       color: textColor,
       fontSize: 32,
@@ -233,12 +235,12 @@ extension CustomColorScheme on ColorScheme {
       brightness == Brightness.light ? Colors.black : Colors.white;
 
   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.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 =>
       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
   ButtonStyle get optionalActionButtonStyle => buildElevatedButtonThemeData(
-        onPrimary: Color(0xFF777777),
-        primary: Color(0xFFF0F0F0),
+        onPrimary: const Color(0xFF777777),
+        primary: const Color(0xFFF0F0F0),
         elevation: 0,
       ).style;
 
   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.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
       ? Colors.black.withOpacity(0.75)
@@ -266,57 +268,57 @@ extension CustomColorScheme on ColorScheme {
 
   Color get bgColorForQuestions => brightness == Brightness.light
       ? 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.fromARGB(255, 238, 238, 238)
+      ? const Color.fromARGB(255, 238, 238, 238)
       : Colors.white.withOpacity(0.1);
 
   DatePickerTheme get dateTimePickertheme => brightness == Brightness.light
-      ? DatePickerTheme(
+      ? const DatePickerTheme(
           backgroundColor: Colors.white,
           itemStyle: TextStyle(color: Colors.black),
           cancelStyle: TextStyle(color: Colors.black),
         )
-      : DatePickerTheme(
+      : const DatePickerTheme(
           backgroundColor: Colors.black,
           itemStyle: TextStyle(color: Colors.white),
           cancelStyle: TextStyle(color: Colors.white),
         );
 
   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.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.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.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.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.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
       ? Colors.black.withOpacity(0.8)
       : Colors.white.withOpacity(0.5);
 
   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
       ? Colors.black.withOpacity(0.5)
@@ -330,12 +332,12 @@ extension CustomColorScheme on ColorScheme {
       brightness == Brightness.light ? Colors.white : Colors.black;
 
   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.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
       ? Colors.black.withOpacity(0.75)
@@ -361,8 +363,8 @@ OutlinedButtonThemeData buildOutlinedButtonThemeData({
         borderRadius: BorderRadius.circular(8),
       ),
       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,
         fontFamily: 'Inter-SemiBold',
         fontSize: 18,
@@ -400,12 +402,12 @@ ElevatedButtonThemeData buildElevatedButtonThemeData({
       onPrimary: onPrimary,
       primary: primary,
       alignment: Alignment.center,
-      textStyle: TextStyle(
+      textStyle: const TextStyle(
         fontWeight: FontWeight.w600,
         fontFamily: 'Inter-SemiBold',
         fontSize: 18,
       ),
-      padding: EdgeInsets.symmetric(vertical: 18),
+      padding: const EdgeInsets.symmetric(vertical: 18),
       shape: const RoundedRectangleBorder(
         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 {
-  await Future.delayed(Duration(seconds: 3));
+  await Future.delayed(const Duration(seconds: 3));
   if (await _isRunningInForeground()) {
     _logger.info("FG task running, skipping BG taskID: $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';
 
 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;
 

+ 1 - 1
lib/services/file_migration_service.dart

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

+ 8 - 7
lib/services/memories_service.dart

@@ -11,10 +11,10 @@ class MemoriesService extends ChangeNotifier {
   final _logger = Logger("MemoryService");
   final _memoriesDB = MemoriesDB.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;
   Future<List<Memory>> _future;
@@ -65,10 +65,11 @@ class MemoriesService extends ChangeNotifier {
     final List<List<int>> durations = [];
     for (var yearAgo = 1; yearAgo <= yearsBefore; 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 =
-          date.add(Duration(days: daysAfter)).microsecondsSinceEpoch;
+          date.add(const Duration(days: daysAfter)).microsecondsSinceEpoch;
       durations.add([startCreationTime, endCreationTime]);
     }
     final archivedCollectionIds =

+ 1 - 1
lib/services/notification_service.dart

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

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

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

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

@@ -42,7 +42,7 @@ class _LoginPageState extends State<LoginPage> {
       appBar: AppBar(
         elevation: 0,
         leading: IconButton(
-          icon: Icon(Icons.arrow_back),
+          icon: const Icon(Icons.arrow_back),
           color: Theme.of(context).iconTheme.color,
           onPressed: () {
             Navigator.of(context).pop();
@@ -88,8 +88,10 @@ class _LoginPageState extends State<LoginPage> {
                     fillColor: _emailInputFieldColor,
                     filled: true,
                     hintText: 'Email',
-                    contentPadding:
-                        EdgeInsets.symmetric(horizontal: 15, vertical: 15),
+                    contentPadding: const EdgeInsets.symmetric(
+                      horizontal: 15,
+                      vertical: 15,
+                    ),
                     border: UnderlineInputBorder(
                       borderSide: BorderSide.none,
                       borderRadius: BorderRadius.circular(6),
@@ -112,7 +114,7 @@ class _LoginPageState extends State<LoginPage> {
                       _emailIsValid = EmailValidator.validate(_email);
                       if (_emailIsValid) {
                         _emailInputFieldColor =
-                            Color.fromRGBO(45, 194, 98, 0.2);
+                            const Color.fromRGBO(45, 194, 98, 0.2);
                       } else {
                         _emailInputFieldColor = null;
                       }
@@ -124,8 +126,8 @@ class _LoginPageState extends State<LoginPage> {
                   autofocus: true,
                 ),
               ),
-              Padding(
-                padding: const EdgeInsets.symmetric(vertical: 18),
+              const Padding(
+                padding: EdgeInsets.symmetric(vertical: 18),
                 child: Divider(
                   thickness: 1,
                 ),
@@ -143,12 +145,12 @@ class _LoginPageState extends State<LoginPage> {
                               .subtitle1
                               .copyWith(fontSize: 12),
                           children: [
-                            TextSpan(
+                            const TextSpan(
                               text: "By clicking log in, I agree to the ",
                             ),
                             TextSpan(
                               text: "terms of service",
-                              style: TextStyle(
+                              style: const TextStyle(
                                 decoration: TextDecoration.underline,
                               ),
                               recognizer: TapGestureRecognizer()
@@ -156,7 +158,7 @@ class _LoginPageState extends State<LoginPage> {
                                   Navigator.of(context).push(
                                     MaterialPageRoute(
                                       builder: (BuildContext context) {
-                                        return WebPage(
+                                        return const WebPage(
                                           "terms",
                                           "https://ente.io/terms",
                                         );
@@ -165,10 +167,10 @@ class _LoginPageState extends State<LoginPage> {
                                   );
                                 },
                             ),
-                            TextSpan(text: " and "),
+                            const TextSpan(text: " and "),
                             TextSpan(
                               text: "privacy policy",
-                              style: TextStyle(
+                              style: const TextStyle(
                                 decoration: TextDecoration.underline,
                               ),
                               recognizer: TapGestureRecognizer()
@@ -176,7 +178,7 @@ class _LoginPageState extends State<LoginPage> {
                                   Navigator.of(context).push(
                                     MaterialPageRoute(
                                       builder: (BuildContext context) {
-                                        return WebPage(
+                                        return const WebPage(
                                           "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(
         elevation: 0,
         leading: IconButton(
-          icon: Icon(Icons.arrow_back),
+          icon: const Icon(Icons.arrow_back),
           color: Theme.of(context).iconTheme.color,
           onPressed: () {
             Navigator.of(context).pop();
@@ -53,7 +53,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                   totalSteps: 4,
                   currentStep: 2,
                   selectedColor: Theme.of(context).buttonColor,
-                  roundedEdges: Radius.circular(10),
+                  roundedEdges: const Radius.circular(10),
                   unselectedColor:
                       Theme.of(context).colorScheme.stepProgressUnselectedColor,
                 ),
@@ -115,7 +115,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                                   .subtitle1
                                   .copyWith(fontSize: 14),
                               children: [
-                                TextSpan(text: "We've sent a mail to "),
+                                const TextSpan(text: "We've sent a mail to "),
                                 TextSpan(
                                   text: widget.email,
                                   style: TextStyle(
@@ -150,7 +150,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                 decoration: InputDecoration(
                   filled: true,
                   hintText: 'Tap to enter code',
-                  contentPadding: EdgeInsets.all(15),
+                  contentPadding: const EdgeInsets.all(15),
                   border: UnderlineInputBorder(
                     borderSide: BorderSide.none,
                     borderRadius: BorderRadius.circular(6),
@@ -165,7 +165,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                 },
               ),
             ),
-            Divider(
+            const Divider(
               thickness: 1,
             ),
             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 _passwordController1 = 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 _passwordInInputBox = '';
   String _passwordInInputConfirmationBox = '';
@@ -101,7 +101,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
         leading: widget.mode == PasswordEntryMode.reset
             ? Container()
             : IconButton(
-                icon: Icon(Icons.arrow_back),
+                icon: const Icon(Icons.arrow_back),
                 color: Theme.of(context).iconTheme.color,
                 onPressed: () {
                   Navigator.of(context).pop();
@@ -169,7 +169,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                         .copyWith(fontSize: 14),
                   ),
                 ),
-                Padding(padding: EdgeInsets.all(8)),
+                const Padding(padding: EdgeInsets.all(8)),
                 Padding(
                   padding: const EdgeInsets.symmetric(horizontal: 20),
                   child: RichText(
@@ -179,7 +179,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                           .subtitle1
                           .copyWith(fontSize: 14),
                       children: [
-                        TextSpan(
+                        const TextSpan(
                           text:
                               "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(
                   // hidden textForm for suggesting auto-fill service for saving
                   // password
@@ -218,7 +218,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                           _isPasswordValid ? _validFieldValueColor : null,
                       filled: true,
                       hintText: "Password",
-                      contentPadding: EdgeInsets.all(20),
+                      contentPadding: const EdgeInsets.all(20),
                       border: UnderlineInputBorder(
                         borderSide: BorderSide.none,
                         borderRadius: BorderRadius.circular(6),
@@ -281,7 +281,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                       fillColor: _passwordsMatch ? _validFieldValueColor : null,
                       filled: true,
                       hintText: "Confirm password",
-                      contentPadding: EdgeInsets.symmetric(
+                      contentPadding: const EdgeInsets.symmetric(
                         horizontal: 20,
                         vertical: 20,
                       ),
@@ -349,7 +349,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                     Navigator.of(context).push(
                       MaterialPageRoute(
                         builder: (BuildContext context) {
-                          return WebPage(
+                          return const WebPage(
                             "How it works",
                             "https://ente.io/architecture",
                           );
@@ -358,7 +358,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                     );
                   },
                   child: Container(
-                    padding: EdgeInsets.symmetric(horizontal: 20),
+                    padding: const EdgeInsets.symmetric(horizontal: 20),
                     child: RichText(
                       text: TextSpan(
                         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(
         elevation: 0,
         leading: IconButton(
-          icon: Icon(Icons.arrow_back),
+          icon: const Icon(Icons.arrow_back),
           color: Theme.of(context).iconTheme.color,
           onPressed: () {
             Navigator.of(context).pop();
@@ -80,7 +80,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
           Navigator.of(context).pushAndRemoveUntil(
             MaterialPageRoute(
               builder: (BuildContext context) {
-                return HomeWidget();
+                return const HomeWidget();
               },
             ),
             (route) => false,
@@ -113,7 +113,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
                   decoration: InputDecoration(
                     hintText: "Enter your password",
                     filled: true,
-                    contentPadding: EdgeInsets.all(20),
+                    contentPadding: const EdgeInsets.all(20),
                     border: UnderlineInputBorder(
                       borderSide: BorderSide.none,
                       borderRadius: BorderRadius.circular(6),
@@ -135,7 +135,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
                           )
                         : null,
                   ),
-                  style: TextStyle(
+                  style: const TextStyle(
                     fontSize: 14,
                   ),
                   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(
                   thickness: 1,
                 ),
@@ -166,7 +166,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
                         Navigator.of(context).push(
                           MaterialPageRoute(
                             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,
                   currentStep: 3,
                   selectedColor: Theme.of(context).buttonColor,
-                  roundedEdges: Radius.circular(10),
+                  roundedEdges: const Radius.circular(10),
                   unselectedColor:
                       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.",
               style: Theme.of(context).textTheme.subtitle1,
             ),
-            Padding(padding: EdgeInsets.only(top: 24)),
+            const Padding(padding: EdgeInsets.only(top: 24)),
             DottedBorder(
-              color: Color.fromRGBO(17, 127, 56, 1),
+              color: const Color.fromRGBO(17, 127, 56, 1),
               //color of dotted/dash line
               strokeWidth: 1,
               //thickness of dash/dots
               dashPattern: const [6, 6],
-              radius: Radius.circular(8),
+              radius: const Radius.circular(8),
               //dash patterns, 10 is dash width, 6 is space width
               child: SizedBox(
                 //inner container
@@ -134,16 +134,16 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
                       child: Container(
                         decoration: BoxDecoration(
                           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),
                           ),
                           color:
                               Theme.of(context).colorScheme.recoveryKeyBoxColor,
                         ),
                         height: 120,
-                        padding: EdgeInsets.all(20),
+                        padding: const EdgeInsets.all(20),
                         width: double.infinity,
                         child: Text(
                           recoveryKey,
@@ -159,7 +159,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
               height: 80,
               width: double.infinity,
               child: Padding(
-                padding: EdgeInsets.symmetric(vertical: 20),
+                padding: const EdgeInsets.symmetric(vertical: 20),
                 child: Text(
                   widget.subText ??
                       "We don’t store this key, please save this in a safe place.",
@@ -171,7 +171,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
               child: Container(
                 alignment: Alignment.bottomCenter,
                 width: double.infinity,
-                padding: EdgeInsets.fromLTRB(10, 10, 10, 24),
+                padding: const EdgeInsets.fromLTRB(10, 10, 10, 24),
                 child: Column(
                   mainAxisAlignment: MainAxisAlignment.end,
                   crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -194,10 +194,10 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
           onPressed: () async {
             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(
@@ -209,7 +209,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
       ),
     );
     if (_hasTriedToSave) {
-      childrens.add(SizedBox(height: 10));
+      childrens.add(const SizedBox(height: 10));
       childrens.add(
         ElevatedButton(
           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;
   }
 
@@ -229,7 +229,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
     }
     _recoveryKeyFile.writeAsStringSync(recoveryKey);
     await Share.shareFiles([_recoveryKeyFile.path]);
-    Future.delayed(Duration(milliseconds: 500), () {
+    Future.delayed(const Duration(milliseconds: 500), () {
       if (mounted) {
         setState(() {
           _hasTriedToSave = true;

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

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

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

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

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

@@ -19,7 +19,7 @@ class _TwoFactorAuthenticationPageState
     extends State<TwoFactorAuthenticationPage> {
   final _pinController = TextEditingController();
   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),
   );
   String _code = "";
@@ -51,7 +51,7 @@ class _TwoFactorAuthenticationPageState
   Widget build(BuildContext context) {
     return Scaffold(
       appBar: AppBar(
-        title: Text(
+        title: const Text(
           "Two-factor authentication",
         ),
       ),
@@ -65,7 +65,7 @@ class _TwoFactorAuthenticationPageState
       mainAxisAlignment: MainAxisAlignment.center,
       mainAxisSize: MainAxisSize.max,
       children: [
-        Text(
+        const Text(
           "Enter the 6-digit code from\nyour authenticator app",
           style: TextStyle(
             height: 1.4,
@@ -73,7 +73,7 @@ class _TwoFactorAuthenticationPageState
           ),
           textAlign: TextAlign.center,
         ),
-        Padding(padding: EdgeInsets.all(32)),
+        const Padding(padding: EdgeInsets.all(32)),
         Padding(
           padding: const EdgeInsets.fromLTRB(40, 0, 40, 0),
           child: PinPut(
@@ -94,10 +94,10 @@ class _TwoFactorAuthenticationPageState
             followingFieldDecoration: _pinPutDecoration.copyWith(
               borderRadius: BorderRadius.circular(5.0),
               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,
               border: InputBorder.none,
               counterText: '',
@@ -105,7 +105,7 @@ class _TwoFactorAuthenticationPageState
             autofocus: true,
           ),
         ),
-        Padding(padding: EdgeInsets.all(24)),
+        const Padding(padding: EdgeInsets.all(24)),
         Container(
           padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
           width: double.infinity,
@@ -116,18 +116,18 @@ class _TwoFactorAuthenticationPageState
                     _verifyTwoFactorCode(_code);
                   }
                 : null,
-            child: Text("Verify"),
+            child: const Text("Verify"),
           ),
         ),
-        Padding(padding: EdgeInsets.all(30)),
+        const Padding(padding: EdgeInsets.all(30)),
         GestureDetector(
           behavior: HitTestBehavior.opaque,
           onTap: () {
             UserService.instance.recoverTwoFactor(context, widget.sessionID);
           },
           child: Container(
-            padding: EdgeInsets.all(10),
-            child: Center(
+            padding: const EdgeInsets.all(10),
+            child: const Center(
               child: Text(
                 "Lost device?",
                 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) {
     return Scaffold(
       appBar: AppBar(
-        title: Text(
+        title: const Text(
           "Recover account",
           style: TextStyle(
             fontSize: 18,
@@ -42,13 +42,13 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
           Padding(
             padding: const EdgeInsets.fromLTRB(60, 0, 60, 0),
             child: TextFormField(
-              decoration: InputDecoration(
+              decoration: const InputDecoration(
                 hintText: "Enter your recovery key",
                 contentPadding: EdgeInsets.all(20),
               ),
-              style: TextStyle(
+              style: const TextStyle(
                 fontSize: 14,
-                fontFeatures: const [FontFeature.tabularFigures()],
+                fontFeatures: [FontFeature.tabularFigures()],
               ),
               controller: _recoveryKey,
               autofocus: false,
@@ -60,7 +60,7 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
               },
             ),
           ),
-          Padding(padding: EdgeInsets.all(24)),
+          const Padding(padding: EdgeInsets.all(24)),
           Container(
             padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
             width: double.infinity,
@@ -77,7 +77,7 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
                       );
                     }
                   : null,
-              child: Text("Recover"),
+              child: const Text("Recover"),
             ),
           ),
           GestureDetector(
@@ -90,7 +90,7 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
               );
             },
             child: Container(
-              padding: EdgeInsets.all(40),
+              padding: const EdgeInsets.all(40),
               child: Center(
                 child: Text(
                   "No recovery key?",

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

@@ -26,7 +26,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
   TabController _tabController;
   final _pinController = TextEditingController();
   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),
   );
   String _code = "";
@@ -66,7 +66,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
     return Scaffold(
       appBar: AppBar(
         elevation: 0,
-        title: Text(
+        title: const Text(
           "Two-factor setup",
         ),
       ),
@@ -133,8 +133,8 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
       child: Column(
         mainAxisAlignment: MainAxisAlignment.center,
         children: [
-          Padding(padding: EdgeInsets.all(12)),
-          Text(
+          const Padding(padding: EdgeInsets.all(12)),
+          const Text(
             "Copy-paste this code\nto your authenticator app",
             style: TextStyle(
               height: 1.4,
@@ -142,11 +142,11 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
             ),
             textAlign: TextAlign.center,
           ),
-          Padding(padding: EdgeInsets.all(16)),
+          const Padding(padding: EdgeInsets.all(16)),
           Padding(
             padding: const EdgeInsets.only(left: 10, right: 10),
             child: Container(
-              padding: EdgeInsets.all(16),
+              padding: const EdgeInsets.all(16),
               color: textColor.withOpacity(0.1),
               child: Center(
                 child: Text(
@@ -160,7 +160,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
               ),
             ),
           ),
-          Padding(padding: EdgeInsets.all(6)),
+          const Padding(padding: EdgeInsets.all(6)),
           Text(
             "tap to copy",
             style: TextStyle(color: textColor.withOpacity(0.5)),
@@ -174,8 +174,8 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
     return Center(
       child: Column(
         children: [
-          Padding(padding: EdgeInsets.all(12)),
-          Text(
+          const Padding(padding: EdgeInsets.all(12)),
+          const Text(
             "Scan this barcode with\nyour authenticator app",
             style: TextStyle(
               height: 1.4,
@@ -183,7 +183,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
             ),
             textAlign: TextAlign.center,
           ),
-          Padding(padding: EdgeInsets.all(12)),
+          const Padding(padding: EdgeInsets.all(12)),
           Image(
             image: _imageProvider,
             height: 180,
@@ -197,8 +197,8 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
   Widget _getVerificationWidget() {
     return Column(
       children: [
-        Padding(padding: EdgeInsets.all(12)),
-        Text(
+        const Padding(padding: EdgeInsets.all(12)),
+        const Text(
           "Enter the 6-digit code from\nyour authenticator app",
           style: TextStyle(
             height: 1.4,
@@ -206,7 +206,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
           ),
           textAlign: TextAlign.center,
         ),
-        Padding(padding: EdgeInsets.all(16)),
+        const Padding(padding: EdgeInsets.all(16)),
         Padding(
           padding: const EdgeInsets.fromLTRB(40, 0, 40, 0),
           child: PinPut(
@@ -227,26 +227,26 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
             followingFieldDecoration: _pinPutDecoration.copyWith(
               borderRadius: BorderRadius.circular(5.0),
               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,
               border: InputBorder.none,
               counterText: '',
             ),
           ),
         ),
-        Padding(padding: EdgeInsets.all(24)),
+        const Padding(padding: EdgeInsets.all(24)),
         OutlinedButton(
           onPressed: _code.length == 6
               ? () async {
                   _enableTwoFactor(_code);
                 }
               : 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
           : AppBar(
               elevation: 0,
-              title: Text(""),
+              title: const Text(""),
             ),
       body: Column(
         mainAxisAlignment: MainAxisAlignment.center,
         children: [
-          SizedBox(
+          const SizedBox(
             height: 0,
           ),
           SafeArea(
             child: Container(
-              padding: EdgeInsets.fromLTRB(24, 32, 24, 8),
+              padding: const EdgeInsets.fromLTRB(24, 32, 24, 8),
               child: Text(
                 'Select folders for backup',
                 textAlign: TextAlign.left,
@@ -95,7 +95,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
               style: Theme.of(context).textTheme.caption.copyWith(height: 1.3),
             ),
           ),
-          Padding(
+          const Padding(
             padding: EdgeInsets.all(10),
           ),
           _latestFiles == null
@@ -111,7 +111,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
                             ? "Unselect all"
                             : "Select all",
                         textAlign: TextAlign.right,
-                        style: TextStyle(
+                        style: const TextStyle(
                           decoration: TextDecoration.underline,
                           fontSize: 16,
                         ),
@@ -147,13 +147,13 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
                       BoxShadow(
                         color: Theme.of(context).backgroundColor,
                         blurRadius: 24,
-                        offset: Offset(0, -8),
+                        offset: const Offset(0, -8),
                         spreadRadius: 4,
                       )
                     ],
                   ),
                   padding: widget.isOnboarding
-                      ? EdgeInsets.only(left: 20, right: 20)
+                      ? const EdgeInsets.only(left: 20, right: 20)
                       : EdgeInsets.only(
                           top: 16,
                           left: 20,
@@ -206,7 +206,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
     _sortFiles();
     final scrollController = ScrollController();
     return Container(
-      padding: EdgeInsets.symmetric(horizontal: 20),
+      padding: const EdgeInsets.symmetric(horizontal: 20),
       child: Scrollbar(
         controller: scrollController,
         thumbVisibility: true,
@@ -262,15 +262,15 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
           border: Border.all(
             color: Theme.of(context).colorScheme.boxUnSelectColor,
           ),
-          borderRadius: BorderRadius.all(
+          borderRadius: const BorderRadius.all(
             Radius.circular(12),
           ),
           // color: isSelected
           //     ? Theme.of(context).colorScheme.boxSelectColor
           //     : Theme.of(context).colorScheme.boxUnSelectColor,
           gradient: isSelected
-              ? LinearGradient(
-                  colors: const [Color(0xFF00DD4D), Color(0xFF43BA6C)],
+              ? const LinearGradient(
+                  colors: [Color(0xFF00DD4D), Color(0xFF43BA6C)],
                 ) //same for both themes
               : LinearGradient(
                   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: Row(
             mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -303,7 +303,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
                     crossAxisAlignment: CrossAxisAlignment.start,
                     children: [
                       Container(
-                        constraints: BoxConstraints(maxWidth: 180),
+                        constraints: const BoxConstraints(maxWidth: 180),
                         child: Text(
                           file.deviceFolder,
                           textAlign: TextAlign.left,
@@ -322,7 +322,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
                           maxLines: 2,
                         ),
                       ),
-                      Padding(padding: EdgeInsets.only(top: 2)),
+                      const Padding(padding: EdgeInsets.only(top: 2)),
                       Text(
                         _itemCount[file.deviceFolder].toString() +
                             " item" +
@@ -391,7 +391,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
             Padding(
               padding: const EdgeInsets.all(9),
               child: isSelected
-                  ? Icon(
+                  ? const Icon(
                       Icons.local_police,
                       color: Colors.white,
                     )

+ 21 - 21
lib/ui/collections_gallery_widget.dart

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

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

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

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

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

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

@@ -32,7 +32,7 @@ class GradientButton extends StatelessWidget {
     } else if (iconData == null) {
       buttonContent = Text(
         text,
-        style: TextStyle(
+        style: const TextStyle(
           color: Colors.white,
           fontWeight: FontWeight.w600,
           fontFamily: 'Inter-SemiBold',
@@ -51,7 +51,7 @@ class GradientButton extends StatelessWidget {
           Padding(padding: EdgeInsets.all(paddingValue)),
           Text(
             text,
-            style: TextStyle(
+            style: const TextStyle(
               color: Colors.white,
               fontWeight: FontWeight.w600,
               fontFamily: 'Inter-SemiBold',
@@ -67,8 +67,8 @@ class GradientButton extends StatelessWidget {
         height: 56,
         decoration: BoxDecoration(
           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,
           ),
           borderRadius: BorderRadius.circular(8),

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

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

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

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

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

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

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

@@ -19,14 +19,10 @@ class _WebPageState extends State<WebPage> {
   Widget build(BuildContext context) {
     return Scaffold(
       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,
-        iconTheme: IconThemeData(color: Colors.white),
+        iconTheme: const IconThemeData(color: Colors.white),
         title: Text(widget.title),
         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:photos/core/configuration.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_items.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(
               alignment: Alignment.centerLeft,
               child: Text(
@@ -132,7 +131,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
             },
             itemCount: snapshot.data.length,
             shrinkWrap: true,
-            physics: NeverScrollableScrollPhysics(),
+            physics: const NeverScrollableScrollPhysics(),
           );
         } else {
           return const EnteLoadingWidget();
@@ -143,7 +142,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
 
   Widget _buildCollectionItem(CollectionWithThumbnail item) {
     return Container(
-      padding: EdgeInsets.only(left: 24, bottom: 16),
+      padding: const EdgeInsets.only(left: 24, bottom: 16),
       child: GestureDetector(
         behavior: HitTestBehavior.translucent,
         child: Row(
@@ -157,11 +156,11 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
                 child: ThumbnailWidget(item.thumbnail),
               ),
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             Expanded(
               child: Text(
                 item.collection.name,
-                style: TextStyle(
+                style: const TextStyle(
                   fontSize: 16,
                 ),
               ),
@@ -203,9 +202,9 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
 
   void _showNameAlbumDialog() async {
     AlertDialog alert = AlertDialog(
-      title: Text("Album title"),
+      title: const Text("Album title"),
       content: TextFormField(
-        decoration: InputDecoration(
+        decoration: const InputDecoration(
           hintText: "Christmas 2020 / Dinner at Alice's",
           contentPadding: EdgeInsets.all(8),
         ),

+ 6 - 6
lib/ui/grant_permissions_widget.dart

@@ -57,7 +57,7 @@ class GrantPermissionsWidget extends StatelessWidget {
                           .headline5
                           .copyWith(fontWeight: FontWeight.w700),
                       children: [
-                        TextSpan(text: 'ente '),
+                        const TextSpan(text: 'ente '),
                         TextSpan(
                           text: "needs permission to ",
                           style: Theme.of(context)
@@ -65,7 +65,7 @@ class GrantPermissionsWidget extends StatelessWidget {
                               .headline5
                               .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,
               spreadRadius: 190,
               blurRadius: 30,
-              offset: Offset(0, 170),
+              offset: const Offset(0, 170),
             )
           ],
         ),
@@ -93,7 +93,7 @@ class GrantPermissionsWidget extends StatelessWidget {
           bottom: Platform.isIOS ? 40 : 16,
         ),
         child: OutlinedButton(
-          child: Text("Grant permission"),
+          child: const Text("Grant permission"),
           onPressed: () async {
             final state = await PhotoManager.requestPermissionExtend();
             if (state == PermissionState.authorized ||
@@ -101,8 +101,8 @@ class GrantPermissionsWidget extends StatelessWidget {
               await SyncService.instance.onPermissionGranted(state);
             } else if (state == PermissionState.denied) {
               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",
                 ),
                 actions: [

+ 19 - 19
lib/ui/header_error_widget.dart

@@ -15,7 +15,7 @@ class HeaderErrorWidget extends StatelessWidget {
   Widget build(BuildContext context) {
     if (_error is NoActiveSubscriptionError) {
       return Container(
-        margin: EdgeInsets.only(top: 8),
+        margin: const EdgeInsets.only(top: 8),
         child: Column(
           children: [
             Row(
@@ -30,13 +30,13 @@ class HeaderErrorWidget extends StatelessWidget {
                 Text("Your subscription has expired"),
               ],
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             Container(
               width: 400,
               height: 52,
               padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
               child: OutlinedButton(
-                child: Text("Subscribe"),
+                child: const Text("Subscribe"),
                 onPressed: () {
                   Navigator.of(context).push(
                     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,
               height: 0,
             ),
-            Padding(padding: EdgeInsets.all(12)),
+            const Padding(padding: EdgeInsets.all(12)),
           ],
         ),
       );
     } else if (_error is StorageLimitExceededError) {
       return Container(
-        margin: EdgeInsets.only(top: 8),
+        margin: const EdgeInsets.only(top: 8),
         child: Column(
           children: [
             Row(
@@ -74,13 +74,13 @@ class HeaderErrorWidget extends StatelessWidget {
                 Text("Storage limit exceeded"),
               ],
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             Container(
               width: 400,
               height: 52,
               padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
               child: OutlinedButton(
-                child: Text("Upgrade"),
+                child: const Text("Upgrade"),
                 onPressed: () {
                   Navigator.of(context).push(
                     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,
               height: 0,
             ),
-            Padding(padding: EdgeInsets.all(12)),
+            const Padding(padding: EdgeInsets.all(12)),
           ],
         ),
       );
@@ -109,13 +109,13 @@ class HeaderErrorWidget extends StatelessWidget {
               Icons.error_outline,
               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.",
               style: TextStyle(height: 1.4),
               textAlign: TextAlign.center,
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             InkWell(
               child: OutlinedButton(
                 style: OutlinedButton.styleFrom(
@@ -124,7 +124,7 @@ class HeaderErrorWidget extends StatelessWidget {
                   shape: RoundedRectangleBorder(
                     borderRadius: BorderRadius.circular(10),
                   ),
-                  padding: EdgeInsets.fromLTRB(50, 16, 50, 16),
+                  padding: const EdgeInsets.fromLTRB(50, 16, 50, 16),
                   side: BorderSide(
                     width: 2,
                     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,
               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;
         _pageController.animateToPage(
           event.selectedIndex,
-          duration: Duration(milliseconds: 100),
+          duration: const Duration(milliseconds: 100),
           curve: Curves.easeIn,
         );
       }
@@ -124,8 +124,8 @@ class _HomeWidgetState extends State<HomeWidget> {
     _triggerLogoutEvent =
         Bus.instance.on<TriggerLogoutEvent>().listen((event) async {
       AlertDialog alert = AlertDialog(
-        title: Text("Session expired"),
-        content: Text("Please login again"),
+        title: const Text("Session expired"),
+        content: const Text("Please login again"),
         actions: [
           TextButton(
             child: Text(
@@ -168,12 +168,12 @@ class _HomeWidgetState extends State<HomeWidget> {
     _firstImportEvent =
         Bus.instance.on<SyncStatusUpdate>().listen((event) async {
       if (mounted && event.status == SyncStatus.completedFirstGalleryImport) {
-        Duration delayInRefresh = Duration(milliseconds: 0);
+        Duration delayInRefresh = const Duration(milliseconds: 0);
         // Loading page will redirect to BackupFolderSelectionPage.
         // To avoid showing folder hook in middle during routing,
         // delay state refresh for home page
         if (!LocalSyncService.instance.hasGrantedLimitedPermissions()) {
-          delayInRefresh = Duration(milliseconds: 250);
+          delayInRefresh = const Duration(milliseconds: 250);
         }
         Future.delayed(
           delayInRefresh,
@@ -256,7 +256,7 @@ class _HomeWidgetState extends State<HomeWidget> {
     return WillPopScope(
       child: Scaffold(
         appBar: PreferredSize(
-          preferredSize: Size.fromHeight(0),
+          preferredSize: const Size.fromHeight(0),
           child: Container(),
         ),
         body: _getBody(),
@@ -280,13 +280,13 @@ class _HomeWidgetState extends State<HomeWidget> {
 
   Widget _getBody() {
     if (!Configuration.instance.hasConfiguredAccount()) {
-      return LandingPageWidget();
+      return const LandingPageWidget();
     }
     if (!LocalSyncService.instance.hasGrantedPermissions()) {
-      return GrantPermissionsWidget();
+      return const GrantPermissionsWidget();
     }
     if (!LocalSyncService.instance.hasCompletedFirstImport()) {
-      return LoadingPhotosWidget();
+      return const LoadingPhotosWidget();
     }
     if (_sharedFiles != null && _sharedFiles.isNotEmpty) {
       ReceiveSharingIntent.reset();
@@ -318,11 +318,14 @@ class _HomeWidgetState extends State<HomeWidget> {
             _settingsPage,
           ],
         ),
-        Align(alignment: Alignment.bottomCenter, child: BottomShadowWidget()),
+        const Align(
+          alignment: Alignment.bottomCenter,
+          child: BottomShadowWidget(),
+        ),
         Align(
           alignment: Alignment.bottomCenter,
           child: SafeArea(
-            minimum: EdgeInsets.only(bottom: 8),
+            minimum: const EdgeInsets.only(bottom: 8),
             child: HomeBottomNavigationBar(
               _selectedFiles,
               selectedTabIndex: _selectedTabIndex,
@@ -444,7 +447,7 @@ class _HomeWidgetState extends State<HomeWidget> {
       tagPrefix: "home_gallery",
       selectedFiles: _selectedFiles,
       header: header,
-      footer: GalleryFooterWidget(),
+      footer: const GalleryFooterWidget(),
     );
     return Stack(
       children: [
@@ -492,7 +495,7 @@ class _HomeWidgetState extends State<HomeWidget> {
                     } else {
                       routeToPage(
                         context,
-                        BackupFolderSelectionPage(
+                        const BackupFolderSelectionPage(
                           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) {
     bool filesAreSelected = widget.selectedFiles.files.isNotEmpty;
     return AnimatedContainer(
-      duration: Duration(milliseconds: 300),
+      duration: const Duration(milliseconds: 300),
       curve: Curves.easeInOut,
       height: filesAreSelected ? 0 : 52,
       child: AnimatedOpacity(
-        duration: Duration(milliseconds: 100),
+        duration: const Duration(milliseconds: 100),
         opacity: filesAreSelected ? 0.0 : 1.0,
         curve: Curves.easeIn,
         child: IgnorePointer(
@@ -642,8 +645,8 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                                 .colorScheme
                                 .gNavBarActiveColor,
                             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,
                             tabBorderRadius: 24,
                             tabBackgroundColor: Theme.of(context)
@@ -652,7 +655,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                             haptic: false,
                             tabs: [
                               GButton(
-                                margin: EdgeInsets.fromLTRB(6, 6, 0, 6),
+                                margin: const EdgeInsets.fromLTRB(6, 6, 0, 6),
                                 icon: Icons.home,
                                 iconColor:
                                     Theme.of(context).colorScheme.gNavIconColor,
@@ -667,7 +670,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                                 },
                               ),
                               GButton(
-                                margin: EdgeInsets.fromLTRB(0, 6, 0, 6),
+                                margin: const EdgeInsets.fromLTRB(0, 6, 0, 6),
                                 icon: Icons.photo_library,
                                 iconColor:
                                     Theme.of(context).colorScheme.gNavIconColor,
@@ -682,7 +685,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                                 },
                               ),
                               GButton(
-                                margin: EdgeInsets.fromLTRB(0, 6, 0, 6),
+                                margin: const EdgeInsets.fromLTRB(0, 6, 0, 6),
                                 icon: Icons.folder_shared,
                                 iconColor:
                                     Theme.of(context).colorScheme.gNavIconColor,
@@ -697,7 +700,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                                 },
                               ),
                               GButton(
-                                margin: EdgeInsets.fromLTRB(0, 6, 6, 6),
+                                margin: const EdgeInsets.fromLTRB(0, 6, 6, 6),
                                 icon: Icons.person,
                                 iconColor:
                                     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>
     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;
   bool isDragging = false;
   int currentFirstIndex;
@@ -194,28 +194,28 @@ class DraggableScrollbarState extends State<DraggableScrollbar>
         onDragUpdate(
           DragUpdateDetails(
             globalPosition: Offset.zero,
-            delta: Offset(0, 2),
+            delta: const Offset(0, 2),
           ),
         );
       } else if (value.logicalKey == LogicalKeyboardKey.arrowUp) {
         onDragUpdate(
           DragUpdateDetails(
             globalPosition: Offset.zero,
-            delta: Offset(0, -2),
+            delta: const Offset(0, -2),
           ),
         );
       } else if (value.logicalKey == LogicalKeyboardKey.pageDown) {
         onDragUpdate(
           DragUpdateDetails(
             globalPosition: Offset.zero,
-            delta: Offset(0, 25),
+            delta: const Offset(0, 25),
           ),
         );
       } else if (value.logicalKey == LogicalKeyboardKey.pageUp) {
         onDragUpdate(
           DragUpdateDetails(
             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(
       shrinkWrap: true,
       physics:
-          NeverScrollableScrollPhysics(), // to disable GridView's scrolling
+          const NeverScrollableScrollPhysics(), // to disable GridView's scrolling
       itemBuilder: (context, index) {
         return _buildFile(context, widget.files[index]);
       },
       itemCount: widget.files.length,
-      gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+      gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
         crossAxisCount: 4,
       ),
-      padding: EdgeInsets.all(0),
+      padding: const EdgeInsets.all(0),
     );
   }
 
@@ -338,7 +338,7 @@ class _LazyLoadingGridViewState extends State<LazyLoadingGridView> {
               ),
               Visibility(
                 visible: widget.selectedFiles.isFileSelected(file),
-                child: Positioned(
+                child: const Positioned(
                   right: 4,
                   top: 4,
                   child: Icon(

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

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

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

@@ -32,7 +32,7 @@ class ScrollBarThumb extends StatelessWidget {
         FadeTransition(
           opacity: labelAnimation,
           child: Container(
-            padding: EdgeInsets.fromLTRB(20, 12, 20, 12),
+            padding: const EdgeInsets.fromLTRB(20, 12, 20, 12),
             decoration: BoxDecoration(
               borderRadius: BorderRadius.circular(10),
               color: backgroundColor,
@@ -48,7 +48,7 @@ class ScrollBarThumb extends StatelessWidget {
             ),
           ),
         ),
-        Padding(
+        const Padding(
           padding: EdgeInsets.all(12),
         ),
         GestureDetector(
@@ -65,8 +65,8 @@ class ScrollBarThumb extends StatelessWidget {
                 borderRadius: BorderRadius.only(
                   topLeft: 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(
                   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,
       child: SlideTransition(
         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),
         child: FadeTransition(
           opacity: animation,

+ 18 - 18
lib/ui/landing_page_widget.dart

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

+ 5 - 5
lib/ui/loading_photos_widget.dart

@@ -45,7 +45,7 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
         } else {
           routeToPage(
             context,
-            BackupFolderSelectionPage(
+            const BackupFolderSelectionPage(
               isOnboarding: true,
               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) {
         return;
       }
@@ -65,7 +65,7 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
 
       _pageController.animateToPage(
         _currentPage,
-        duration: Duration(milliseconds: 300),
+        duration: const Duration(milliseconds: 300),
         curve: Curves.easeIn,
       );
     });
@@ -149,9 +149,9 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
                               return _getMessage(_messages[index]);
                             },
                             itemCount: _messages.length,
-                            physics: NeverScrollableScrollPhysics(),
+                            physics: const NeverScrollableScrollPhysics(),
                           ),
-                          Positioned(
+                          const Positioned(
                             bottom: 0,
                             left: 0,
                             right: 0,

+ 13 - 13
lib/ui/memories_widget.dart

@@ -25,7 +25,7 @@ class MemoriesWidget extends StatelessWidget {
             crossAxisAlignment: CrossAxisAlignment.start,
             children: [
               _buildMemories(snapshot.data),
-              Divider(),
+              const Divider(),
             ],
           );
         }
@@ -106,7 +106,7 @@ class _MemoryWidgetState extends State<MemoryWidget> {
           child: Column(
             children: [
               _buildMemoryItem(context, index),
-              Padding(padding: EdgeInsets.all(4)),
+              const Padding(padding: EdgeInsets.all(4)),
               Hero(
                 tag: title,
                 child: Material(
@@ -134,7 +134,7 @@ class _MemoryWidgetState extends State<MemoryWidget> {
     return Container(
       decoration: BoxDecoration(
         border: isSeen
-            ? Border()
+            ? const Border()
             : Border.all(
                 color: Theme.of(context).buttonColor,
                 width: isSeen ? 0 : 2,
@@ -218,7 +218,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
   void initState() {
     super.initState();
     _index = widget.index;
-    Future.delayed(Duration(seconds: 3), () {
+    Future.delayed(const Duration(seconds: 3), () {
       if (mounted) {
         setState(() {
           _opacity = 0;
@@ -246,7 +246,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
               selectedColor: Colors.white, //same for both themes
               unselectedColor: Colors.white.withOpacity(0.4),
             ),
-            SizedBox(
+            const SizedBox(
               height: 18,
             ),
             Row(
@@ -257,7 +257,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
                     onTap: () {
                       Navigator.pop(context);
                     },
-                    child: Icon(
+                    child: const Icon(
                       Icons.close,
                       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,
       ),
       extendBodyBehindAppBar: true,
@@ -314,7 +314,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
       tag: widget.title,
       child: Container(
         alignment: Alignment.bottomCenter,
-        padding: EdgeInsets.fromLTRB(0, 0, 0, 28),
+        padding: const EdgeInsets.fromLTRB(0, 0, 0, 28),
         child: _showCounter
             ? Text(
                 '${_index + 1}/${widget.memories.length}',
@@ -325,7 +325,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
               )
             : AnimatedOpacity(
                 opacity: _opacity,
-                duration: Duration(milliseconds: 500),
+                duration: const Duration(milliseconds: 500),
                 child: Text(
                   widget.title,
                   style: Theme.of(context)
@@ -342,7 +342,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
     final file = widget.memories[_index].file;
     return Container(
       alignment: Alignment.bottomRight,
-      padding: EdgeInsets.fromLTRB(0, 0, 26, 20),
+      padding: const EdgeInsets.fromLTRB(0, 0, 26, 20),
       child: IconButton(
         icon: Icon(
           Icons.adaptive.share,
@@ -392,7 +392,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
               _shouldDisableScroll = value;
             });
           },
-          backgroundDecoration: BoxDecoration(
+          backgroundDecoration: const BoxDecoration(
             color: Colors.transparent,
           ),
         );
@@ -407,8 +407,8 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
         });
       },
       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) {
           final faqs = <Widget>[];
           faqs.add(
-            Padding(
-              padding: const EdgeInsets.all(24),
+            const Padding(
+              padding: EdgeInsets.all(24),
               child: Text(
                 "FAQs",
                 style: TextStyle(
@@ -42,7 +42,7 @@ class BillingQuestionsWidget extends StatelessWidget {
             faqs.add(FaqWidget(faq: faq));
           }
           faqs.add(
-            Padding(
+            const Padding(
               padding: EdgeInsets.all(16),
             ),
           );
@@ -70,7 +70,7 @@ class FaqWidget extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     return Padding(
-      padding: EdgeInsets.all(2),
+      padding: const EdgeInsets.all(2),
       child: ExpansionTileCard(
         elevation: 0,
         title: Text(faq.q),
@@ -85,7 +85,7 @@ class FaqWidget extends StatelessWidget {
             ),
             child: Text(
               faq.a,
-              style: TextStyle(
+              style: const TextStyle(
                 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,
             ),
           ),
-          Padding(
-            padding: const EdgeInsets.symmetric(vertical: 8),
+          const Padding(
+            padding: EdgeInsets.symmetric(vertical: 8),
           ),
           Padding(
-            padding: EdgeInsets.symmetric(horizontal: 16),
+            padding: const EdgeInsets.symmetric(horizontal: 16),
             child: RichText(
               textAlign: TextAlign.center,
               text: TextSpan(
                 children: [
-                  TextSpan(
+                  const TextSpan(
                     text: "Please contact ",
                   ),
                   TextSpan(
                     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",
                   ),
                 ],
@@ -52,15 +53,15 @@ class ChildSubscriptionWidget extends StatelessWidget {
               ),
             ),
           ),
-          Padding(
-            padding: const EdgeInsets.symmetric(vertical: 8),
+          const Padding(
+            padding: EdgeInsets.symmetric(vertical: 8),
           ),
           Image.asset(
             "assets/family_plan_leave.png",
             height: 256,
           ),
-          Padding(
-            padding: const EdgeInsets.symmetric(vertical: 0),
+          const Padding(
+            padding: EdgeInsets.symmetric(vertical: 0),
           ),
           InkWell(
             child: OutlinedButton(
@@ -68,10 +69,11 @@ class ChildSubscriptionWidget extends StatelessWidget {
                 shape: RoundedRectangleBorder(
                   borderRadius: BorderRadius.circular(10),
                 ),
-                padding: EdgeInsets.symmetric(vertical: 18, horizontal: 100),
+                padding:
+                    const EdgeInsets.symmetric(vertical: 18, horizontal: 100),
                 backgroundColor: Colors.red[500],
               ),
-              child: Text(
+              child: const Text(
                 "Leave Family",
                 style: TextStyle(
                   fontWeight: FontWeight.bold,
@@ -96,10 +98,9 @@ class ChildSubscriptionWidget extends StatelessWidget {
                     ),
                     TextSpan(
                       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(
                       text: " for help",

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

@@ -142,10 +142,10 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
     return showDialog(
       context: context,
       builder: (context) => AlertDialog(
-        title: Text('Are you sure you want to exit?'),
+        title: const Text('Are you sure you want to exit?'),
         actions: <Widget>[
           TextButton(
-            child: Text(
+            child: const Text(
               'Yes',
               style: TextStyle(
                 color: Colors.redAccent,
@@ -192,11 +192,11 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
       context: context,
       barrierDismissible: false,
       builder: (context) => AlertDialog(
-        title: Text('Payment failed'),
+        title: const Text('Payment failed'),
         content: Text("Unfortunately your payment failed due to $reason"),
         actions: <Widget>[
           TextButton(
-            child: Text('Ok'),
+            child: const Text('Ok'),
             onPressed: () {
               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(
             MaterialPageRoute(
               builder: (BuildContext context) {
-                return HomeWidget();
+                return const HomeWidget();
               },
             ),
             (route) => false,
@@ -42,7 +42,7 @@ class SkipSubscriptionWidget extends StatelessWidget {
           BillingService.instance
               .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
   Widget build(BuildContext context) {
     final appBar = PreferredSize(
-      preferredSize: Size(double.infinity, 60),
+      preferredSize: const Size(double.infinity, 60),
       child: Container(
         decoration: BoxDecoration(
           boxShadow: [
             BoxShadow(
               color: Theme.of(context).backgroundColor,
               blurRadius: 16,
-              offset: Offset(0, 8),
+              offset: const Offset(0, 8),
             )
           ],
         ),
@@ -134,7 +134,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
                     totalSteps: 4,
                     currentStep: 4,
                     selectedColor: Theme.of(context).buttonColor,
-                    roundedEdges: Radius.circular(10),
+                    roundedEdges: const Radius.circular(10),
                     unselectedColor: Theme.of(context)
                         .colorScheme
                         .stepProgressUnselectedColor,
@@ -143,7 +143,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
               )
             : AppBar(
                 elevation: 0,
-                title: Text("Subscription"),
+                title: const Text("Subscription"),
               ),
       ),
     );
@@ -153,7 +153,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
         alignment: Alignment.bottomCenter,
         children: [
           _getBody(),
-          BottomShadowWidget(
+          const BottomShadowWidget(
             offsetDy: 40,
           )
         ],
@@ -192,7 +192,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
         mainAxisAlignment: MainAxisAlignment.center,
         children: _getStripePlanWidgets(),
       ),
-      Padding(padding: EdgeInsets.all(4)),
+      const Padding(padding: EdgeInsets.all(4)),
     ]);
 
     widgets.add(_showSubscriptionToggle());
@@ -205,7 +205,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
       if (widget.isOnboarding) {
         widgets.add(SkipSubscriptionWidget(freePlan: _freePlan));
       }
-      widgets.add(SubFaqWidget());
+      widgets.add(const SubFaqWidget());
     }
 
     // only active subscription can be renewed/canceled
@@ -241,7 +241,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
               }
             },
             child: Container(
-              padding: EdgeInsets.fromLTRB(40, 80, 40, 20),
+              padding: const EdgeInsets.fromLTRB(40, 80, 40, 20),
               child: Column(
                 children: [
                   RichText(
@@ -277,7 +277,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
               await _launchFamilyPortal();
             },
             child: Container(
-              padding: EdgeInsets.fromLTRB(40, 0, 40, 80),
+              padding: const EdgeInsets.fromLTRB(40, 0, 40, 80),
               child: Column(
                 children: [
                   RichText(
@@ -511,8 +511,8 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
     }
 
     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),
       child: Row(
         mainAxisAlignment: MainAxisAlignment.center,

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

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

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

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

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

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

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

@@ -32,24 +32,24 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
       children: [
         Text(
           widget.latestVersionInfo.name,
-          style: TextStyle(
+          style: const TextStyle(
             fontSize: 20,
             fontWeight: FontWeight.bold,
           ),
         ),
-        Padding(padding: EdgeInsets.all(8)),
-        Text(
+        const Padding(padding: EdgeInsets.all(8)),
+        const Text(
           "Changelog",
           style: TextStyle(
             fontSize: 18,
           ),
         ),
-        Padding(padding: EdgeInsets.all(4)),
+        const Padding(padding: EdgeInsets.all(4)),
         Column(
           crossAxisAlignment: CrossAxisAlignment.start,
           children: changelog,
         ),
-        Padding(padding: EdgeInsets.all(8)),
+        const Padding(padding: EdgeInsets.all(8)),
         SizedBox(
           width: double.infinity,
           height: 64,
@@ -71,7 +71,7 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
                 barrierDismissible: false,
               );
             },
-            child: Text(
+            child: const Text(
               "Update",
             ),
           ),
@@ -120,7 +120,7 @@ class _ApkDownloaderDialogState extends State<ApkDownloaderDialog> {
     return WillPopScope(
       onWillPop: () async => false,
       child: AlertDialog(
-        title: Text(
+        title: const Text(
           "Downloading...",
           style: TextStyle(
             fontSize: 16,
@@ -152,11 +152,11 @@ class _ApkDownloaderDialogState extends State<ApkDownloaderDialog> {
     } catch (e) {
       Logger("ApkDownloader").severe(e);
       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: [
           TextButton(
-            child: Text(
+            child: const Text(
               "Ignore",
               style: TextStyle(
                 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...");
             await dialog.show();
             await Future.delayed(
-              Duration(milliseconds: kDummyDelayDurationInMilliseconds),
+              const Duration(milliseconds: kDummyDelayDurationInMilliseconds),
             );
             await dialog.hide();
             Network.instance.getAlice().showInspector();

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

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

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

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

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

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

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

@@ -12,7 +12,7 @@ class DebugSectionWidget extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     return ExpandablePanel(
-      header: SettingsSectionTitle("Debug"),
+      header: const SettingsSectionTitle("Debug"),
       collapsed: Container(),
       expanded: _getSectionOptions(context),
       theme: getExpandableTheme(context),
@@ -27,7 +27,7 @@ class DebugSectionWidget extends StatelessWidget {
           onTap: () async {
             _showKeyAttributesDialog(context);
           },
-          child: SettingsTextItem(
+          child: const SettingsTextItem(
             text: "Key attributes",
             icon: Icons.navigate_next,
           ),
@@ -37,7 +37,7 @@ class DebugSectionWidget extends StatelessWidget {
           onTap: () async {
             Network.instance.getAlice().showInspector();
           },
-          child: SettingsTextItem(
+          child: const SettingsTextItem(
             text: "Network requests",
             icon: Icons.navigate_next,
           ),
@@ -49,34 +49,40 @@ class DebugSectionWidget extends StatelessWidget {
   void _showKeyAttributesDialog(BuildContext context) {
     final keyAttributes = Configuration.instance.getKeyAttributes();
     AlertDialog alert = AlertDialog(
-      title: Text("key attributes"),
+      title: const Text("key attributes"),
       content: SingleChildScrollView(
         child: Column(
           children: [
-            Text("Key", style: TextStyle(fontWeight: FontWeight.bold)),
+            const Text(
+              "Key",
+              style: TextStyle(fontWeight: FontWeight.bold),
+            ),
             Text(Sodium.bin2base64(Configuration.instance.getKey())),
-            Padding(padding: EdgeInsets.all(12)),
-            Text(
+            const Padding(padding: EdgeInsets.all(12)),
+            const Text(
               "Encrypted Key",
               style: TextStyle(fontWeight: FontWeight.bold),
             ),
             Text(keyAttributes.encryptedKey),
-            Padding(padding: EdgeInsets.all(12)),
-            Text(
+            const Padding(padding: EdgeInsets.all(12)),
+            const Text(
               "Key Decryption Nonce",
               style: TextStyle(fontWeight: FontWeight.bold),
             ),
             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),
-            Padding(padding: EdgeInsets.all(12)),
+            const Padding(padding: EdgeInsets.all(12)),
           ],
         ),
       ),
       actions: [
         TextButton(
-          child: Text("OK"),
+          child: const Text("OK"),
           onPressed: () {
             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();
       }
     });
-    _background = Image(
+    _background = const Image(
       image: AssetImage("assets/storage_card_background.png"),
       fit: BoxFit.fill,
     );
@@ -104,8 +104,12 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
           _userDetails == null
               ? const EnteLoadingWidget()
               : 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(
                     color: Colors.transparent,
                     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(
                               mainAxisAlignment: MainAxisAlignment.spaceBetween,
                               children: [
@@ -175,12 +181,12 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                                           Container(
                                             width: 8.71,
                                             height: 8.99,
-                                            decoration: BoxDecoration(
+                                            decoration: const BoxDecoration(
                                               shape: BoxShape.circle,
                                               color: Colors.white,
                                             ),
                                           ),
-                                          Padding(
+                                          const Padding(
                                             padding: EdgeInsets.only(right: 4),
                                           ),
                                           Text(
@@ -193,7 +199,7 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                                                   fontSize: 12,
                                                 ),
                                           ),
-                                          Padding(
+                                          const Padding(
                                             padding: EdgeInsets.only(right: 12),
                                           ),
                                           Container(
@@ -205,7 +211,7 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                                                   .withOpacity(0.75),
                                             ),
                                           ),
-                                          Padding(
+                                          const Padding(
                                             padding: EdgeInsets.only(right: 4),
                                           ),
                                           Text(
@@ -251,7 +257,7 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                     ),
                   ),
                 ),
-          Align(
+          const Align(
             alignment: Alignment.centerRight,
             child: Icon(
               Icons.chevron_right,

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

@@ -16,7 +16,7 @@ class InfoSectionWidget extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     return ExpandablePanel(
-      header: SettingsSectionTitle("About"),
+      header: const SettingsSectionTitle("About"),
       collapsed: Container(),
       expanded: _getSectionOptions(context),
       theme: getExpandableTheme(context),
@@ -32,12 +32,12 @@ class InfoSectionWidget extends StatelessWidget {
             Navigator.of(context).push(
               MaterialPageRoute(
                 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,
         GestureDetector(
@@ -46,12 +46,13 @@ class InfoSectionWidget extends StatelessWidget {
             Navigator.of(context).push(
               MaterialPageRoute(
                 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,
         GestureDetector(
@@ -60,12 +61,15 @@ class InfoSectionWidget extends StatelessWidget {
             Navigator.of(context).push(
               MaterialPageRoute(
                 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,
         GestureDetector(
@@ -73,8 +77,10 @@ class InfoSectionWidget extends StatelessWidget {
           onTap: () async {
             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,
         UpdateService.instance.isIndependent()
@@ -103,7 +109,7 @@ class InfoSectionWidget extends StatelessWidget {
                         showToast(context, "You are on the latest version");
                       }
                     },
-                    child: SettingsTextItem(
+                    child: const SettingsTextItem(
                       text: "Check for updates",
                       icon: Icons.navigate_next,
                     ),

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

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

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

@@ -14,7 +14,7 @@ class SettingsSectionTitle extends StatelessWidget {
   Widget build(BuildContext context) {
     return Column(
       children: [
-        Padding(padding: EdgeInsets.all(4)),
+        const Padding(padding: EdgeInsets.all(4)),
         Align(
           alignment: Alignment.centerLeft,
           child: Text(
@@ -27,7 +27,7 @@ class SettingsSectionTitle extends StatelessWidget {
                 : 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
   Widget build(BuildContext context) {
     return ExpandablePanel(
-      header: SettingsSectionTitle("Social"),
+      header: const SettingsSectionTitle("Social"),
       collapsed: Container(),
       expanded: _getSectionOptions(context),
       theme: getExpandableTheme(context),
@@ -28,7 +28,8 @@ class SocialSectionWidget extends StatelessWidget {
         onTap: () {
           launch("https://twitter.com/enteio");
         },
-        child: SettingsTextItem(text: "Twitter", icon: Icons.navigate_next),
+        child:
+            const SettingsTextItem(text: "Twitter", icon: Icons.navigate_next),
       ),
       sectionOptionDivider,
       GestureDetector(
@@ -36,7 +37,8 @@ class SocialSectionWidget extends StatelessWidget {
         onTap: () {
           launch("https://ente.io/discord");
         },
-        child: SettingsTextItem(text: "Discord", icon: Icons.navigate_next),
+        child:
+            const SettingsTextItem(text: "Discord", icon: Icons.navigate_next),
       ),
       sectionOptionDivider,
       GestureDetector(
@@ -44,7 +46,8 @@ class SocialSectionWidget extends StatelessWidget {
         onTap: () {
           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()) {
@@ -64,7 +67,7 @@ class SocialSectionWidget extends StatelessWidget {
                 );
               }
             },
-            child: SettingsTextItem(
+            child: const SettingsTextItem(
               text: "Rate us! ✨",
               icon: Icons.navigate_next,
             ),

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

@@ -19,7 +19,7 @@ class SupportSectionWidget extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     return ExpandablePanel(
-      header: SettingsSectionTitle("Support"),
+      header: const SettingsSectionTitle("Support"),
       collapsed: Container(),
       expanded: _getSectionOptions(context),
       theme: getExpandableTheme(context),
@@ -45,7 +45,8 @@ class SupportSectionWidget extends StatelessWidget {
               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,
         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,
         GestureDetector(
@@ -77,7 +81,7 @@ class SupportSectionWidget extends StatelessWidget {
             final zipFilePath = await getZippedLogsFile(context);
             await shareLogs(context, bugsEmail, zipFilePath);
           },
-          child: SettingsTextItem(
+          child: const SettingsTextItem(
             text: "Report bug 🐞",
             icon: Icons.navigate_next,
           ),

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

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

+ 11 - 11
lib/ui/settings_page.dart

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

+ 17 - 17
lib/ui/shared_collections_gallery.dart

@@ -124,14 +124,14 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
         child: Column(
           children: [
             const SizedBox(height: 12),
-            SectionTitle("Shared with me"),
+            const SectionTitle("Shared with me"),
             const SizedBox(height: 12),
             collections.incoming.isNotEmpty
                 ? Padding(
                     padding: const EdgeInsets.symmetric(horizontal: 16),
                     child: GridView.builder(
                       shrinkWrap: true,
-                      physics: NeverScrollableScrollPhysics(),
+                      physics: const NeverScrollableScrollPhysics(),
                       itemBuilder: (context, index) {
                         return IncomingCollectionItem(
                           collections.incoming[index],
@@ -148,13 +148,13 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
                     ),
                   )
                 : _getIncomingCollectionEmptyState(),
-            SectionTitle("Shared by me"),
+            const SectionTitle("Shared by me"),
             const SizedBox(height: 12),
             collections.outgoing.isNotEmpty
                 ? ListView.builder(
                     shrinkWrap: true,
-                    padding: EdgeInsets.only(bottom: 12),
-                    physics: NeverScrollableScrollPhysics(),
+                    padding: const EdgeInsets.only(bottom: 12),
+                    physics: const NeverScrollableScrollPhysics(),
                     itemBuilder: (context, index) {
                       return OutgoingCollectionItem(
                         collections.outgoing[index],
@@ -180,7 +180,7 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
             "Ask your loved ones to share",
             style: Theme.of(context).textTheme.caption,
           ),
-          Padding(padding: EdgeInsets.only(top: 14)),
+          const Padding(padding: EdgeInsets.only(top: 14)),
           SizedBox(
             width: 200,
             height: 50,
@@ -209,7 +209,7 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
             "Share your first album",
             style: Theme.of(context).textTheme.caption,
           ),
-          Padding(padding: EdgeInsets.only(top: 14)),
+          const Padding(padding: EdgeInsets.only(top: 14)),
           SizedBox(
             width: 200,
             height: 50,
@@ -283,7 +283,7 @@ class OutgoingCollectionItem extends StatelessWidget {
     return GestureDetector(
       behavior: HitTestBehavior.opaque,
       child: Container(
-        margin: EdgeInsets.fromLTRB(16, 12, 16, 12),
+        margin: const EdgeInsets.fromLTRB(16, 12, 16, 12),
         child: Row(
           children: <Widget>[
             ClipRRect(
@@ -300,7 +300,7 @@ class OutgoingCollectionItem extends StatelessWidget {
                 ),
               ),
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             Expanded(
               child: Column(
                 crossAxisAlignment: CrossAxisAlignment.start,
@@ -309,20 +309,20 @@ class OutgoingCollectionItem extends StatelessWidget {
                     children: [
                       Text(
                         c.collection.name,
-                        style: TextStyle(
+                        style: const TextStyle(
                           fontSize: 16,
                         ),
                       ),
-                      Padding(padding: EdgeInsets.all(2)),
+                      const Padding(padding: EdgeInsets.all(2)),
                       c.collection.publicURLs.isEmpty
                           ? Container()
-                          : Icon(Icons.link),
+                          : const Icon(Icons.link),
                     ],
                   ),
                   sharees.isEmpty
                       ? Container()
                       : Padding(
-                          padding: EdgeInsets.fromLTRB(0, 4, 0, 0),
+                          padding: const EdgeInsets.fromLTRB(0, 4, 0, 0),
                           child: Text(
                             "Shared with " + sharees.join(", "),
                             style: TextStyle(
@@ -392,8 +392,8 @@ class IncomingCollectionItem extends StatelessWidget {
                   Align(
                     alignment: Alignment.bottomRight,
                     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(
                         shape: BoxShape.circle,
                         color: Theme.of(context)
@@ -413,7 +413,7 @@ class IncomingCollectionItem extends StatelessWidget {
               ),
             ),
           ),
-          SizedBox(height: 4),
+          const SizedBox(height: 4),
           Row(
             children: [
               Container(
@@ -434,7 +434,7 @@ class IncomingCollectionItem extends StatelessWidget {
                           color: albumTitleTextStyle.color.withOpacity(0.5),
                         ),
                         children: [
-                          TextSpan(text: "  \u2022  "),
+                          const TextSpan(text: "  \u2022  "),
                           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> {
   // index, title, milliseconds in future post which link should expire (when >0)
   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
-    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;
@@ -51,7 +51,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
       backgroundColor: Theme.of(context).backgroundColor,
       appBar: AppBar(
         elevation: 0,
-        title: Text(
+        title: const Text(
           "Manage link",
         ),
       ),
@@ -62,7 +62,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
               padding: const EdgeInsets.fromLTRB(16, 12, 16, 12),
               child: Column(
                 children: [
-                  Padding(padding: EdgeInsets.all(4)),
+                  const Padding(padding: EdgeInsets.all(4)),
                   GestureDetector(
                     behavior: HitTestBehavior.translucent,
                     onTap: () async {
@@ -76,18 +76,18 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
                           mainAxisAlignment: MainAxisAlignment.center,
                           crossAxisAlignment: CrossAxisAlignment.start,
                           children: [
-                            Text("Link expiry"),
-                            Padding(padding: EdgeInsets.all(4)),
+                            const Text("Link expiry"),
+                            const Padding(padding: EdgeInsets.all(4)),
                             _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(
                     behavior: HitTestBehavior.translucent,
                     onTap: () {
@@ -101,30 +101,30 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
                           mainAxisAlignment: MainAxisAlignment.center,
                           crossAxisAlignment: CrossAxisAlignment.start,
                           children: [
-                            Text("Device limit"),
-                            Padding(padding: EdgeInsets.all(4)),
+                            const Text("Device limit"),
+                            const Padding(padding: EdgeInsets.all(4)),
                             Text(
                               widget.collection.publicURLs.first.deviceLimit
                                   .toString(),
-                              style: TextStyle(
+                              style: const TextStyle(
                                 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(
                     height: 36,
                     child: Row(
                       mainAxisAlignment: MainAxisAlignment.spaceBetween,
                       children: [
-                        Text("Password lock"),
+                        const Text("Password lock"),
                         Switch.adaptive(
                           value: widget.collection.publicURLs?.first
                                   ?.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(
                     height: 36,
                     child: Row(
                       mainAxisAlignment: MainAxisAlignment.spaceBetween,
                       children: [
-                        Text("File download"),
+                        const Text("File download"),
                         Switch.adaptive(
                           value: widget.collection.publicURLs?.first
                                   ?.enableDownload ??
@@ -224,7 +224,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
             Container(
               decoration: BoxDecoration(
                 color: Theme.of(context).colorScheme.cupertinoPickerTopColor,
-                border: Border(
+                border: const Border(
                   bottom: BorderSide(
                     color: Color(0xff999999),
                     width: 0.0,
@@ -288,7 +288,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
             ),
             Container(
               height: 220.0,
-              color: Color(0xfff7f7f7),
+              color: const Color(0xfff7f7f7),
               child: CupertinoPicker(
                 backgroundColor:
                     Theme.of(context).backgroundColor.withOpacity(0.95),
@@ -350,12 +350,12 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
         return StatefulBuilder(
           builder: (context, setState) {
             return AlertDialog(
-              title: Text('Enter password'),
+              title: const Text('Enter password'),
               content: TextFormField(
                 autofillHints: const [AutofillHints.newPassword],
                 decoration: InputDecoration(
                   hintText: "Password",
-                  contentPadding: EdgeInsets.all(12),
+                  contentPadding: const EdgeInsets.all(12),
                   suffixIcon: IconButton(
                     icon: Icon(
                       _passwordVisible
@@ -448,7 +448,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
   Text _getLinkExpiryTimeWidget() {
     int validTill = widget.collection.publicURLs?.first?.validTill ?? 0;
     if (validTill == 0) {
-      return Text(
+      return const Text(
         'Never',
         style: TextStyle(
           color: Colors.grey,
@@ -465,7 +465,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
     }
     return Text(
       getFormattedTime(DateTime.fromMicrosecondsSinceEpoch(validTill)),
-      style: TextStyle(
+      style: const TextStyle(
         color: Colors.grey,
       ),
     );
@@ -487,7 +487,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
             Container(
               decoration: BoxDecoration(
                 color: Theme.of(context).colorScheme.cupertinoPickerTopColor,
-                border: Border(
+                border: const Border(
                   bottom: BorderSide(
                     color: Color(0xff999999),
                     width: 0.0,
@@ -534,7 +534,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
             ),
             Container(
               height: 220.0,
-              color: Color(0xfff7f7f7),
+              color: const Color(0xfff7f7f7),
               child: CupertinoPicker(
                 backgroundColor:
                     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(
-      Padding(
+      const Padding(
         padding: EdgeInsets.all(8),
       ),
     );
@@ -80,7 +80,7 @@ class _SharingDialogState extends State<SharingDialog> {
           width: 240,
           height: 50,
           child: OutlinedButton(
-            child: Text("Add"),
+            child: const Text("Add"),
             onPressed: () {
               _addEmailToCollection(_email?.trim() ?? '');
             },
@@ -92,15 +92,15 @@ class _SharingDialogState extends State<SharingDialog> {
     if (!FeatureFlagService.instance.disableUrlSharing()) {
       bool hasUrl = widget.collection.publicURLs?.isNotEmpty ?? false;
       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(
           height: 36,
           child: Row(
             mainAxisAlignment: MainAxisAlignment.center,
             children: [
-              Text("Public link"),
+              const Text("Public link"),
               Switch(
                 value: hasUrl,
                 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) {
         children.add(
-          Padding(
+          const Padding(
             padding: EdgeInsets.all(2),
           ),
         );
@@ -172,7 +172,7 @@ class _SharingDialogState extends State<SharingDialog> {
     }
 
     return AlertDialog(
-      title: Text("Sharing"),
+      title: const Text("Sharing"),
       content: SingleChildScrollView(
         child: ListBody(
           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: [
         Expanded(
           child: TypeAheadField(
-            textFieldConfiguration: TextFieldConfiguration(
+            textFieldConfiguration: const TextFieldConfiguration(
               keyboardType: TextInputType.emailAddress,
               decoration: InputDecoration(
                 border: InputBorder.none,
@@ -211,7 +211,7 @@ class _SharingDialogState extends State<SharingDialog> {
             },
             itemBuilder: (context, suggestion) {
               return Container(
-                padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
+                padding: const EdgeInsets.fromLTRB(12, 8, 12, 8),
                 child: Text(
                   suggestion.email,
                   overflow: TextOverflow.clip,
@@ -226,7 +226,7 @@ class _SharingDialogState extends State<SharingDialog> {
             },
           ),
         ),
-        Padding(padding: EdgeInsets.all(8)),
+        const Padding(padding: EdgeInsets.all(8)),
         IconButton(
           icon: Icon(
             Icons.contact_mail_outlined,
@@ -253,14 +253,14 @@ class _SharingDialogState extends State<SharingDialog> {
         mainAxisAlignment: MainAxisAlignment.start,
         crossAxisAlignment: CrossAxisAlignment.start,
         children: [
-          Padding(padding: EdgeInsets.all(4)),
+          const Padding(padding: EdgeInsets.all(4)),
           GestureDetector(
             onTap: () async {
               await Clipboard.setData(ClipboardData(text: url));
               showToast(context, "Link copied to clipboard");
             },
             child: Container(
-              padding: EdgeInsets.all(16),
+              padding: const EdgeInsets.all(16),
               color: Theme.of(context).colorScheme.onSurface.withOpacity(0.02),
               child: Row(
                 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,
                     size: 18,
                   ),
@@ -288,7 +288,7 @@ class _SharingDialogState extends State<SharingDialog> {
               ),
             ),
           ),
-          Padding(padding: EdgeInsets.all(2)),
+          const Padding(padding: EdgeInsets.all(2)),
           TextButton(
             child: Padding(
               padding: const EdgeInsets.all(12),
@@ -299,7 +299,7 @@ class _SharingDialogState extends State<SharingDialog> {
                     Icons.adaptive.share,
                     color: Theme.of(context).buttonColor,
                   ),
-                  Padding(
+                  const Padding(
                     padding: EdgeInsets.all(4),
                   ),
                   Text(
@@ -315,7 +315,7 @@ class _SharingDialogState extends State<SharingDialog> {
               shareText(url);
             },
           ),
-          Padding(padding: EdgeInsets.all(4)),
+          const Padding(padding: EdgeInsets.all(4)),
           TextButton(
             child: Center(
               child: Text(
@@ -370,12 +370,12 @@ class _SharingDialogState extends State<SharingDialog> {
     if (publicKey == null) {
       Navigator.of(context, rootNavigator: true).pop('dialog');
       final dialog = AlertDialog(
-        title: Text("Invite to ente?"),
+        title: const Text("Invite to ente?"),
         content: Text(
           "Looks like " +
               email +
               " hasn't signed up for ente yet. would you like to invite them?",
-          style: TextStyle(
+          style: const TextStyle(
             height: 1.4,
           ),
         ),
@@ -435,9 +435,10 @@ class _SharingDialogState extends State<SharingDialog> {
 
   void _showUnSupportedAlert() {
     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: [
         TextButton(
           child: Text(
@@ -498,12 +499,12 @@ class EmailItemWidget extends StatelessWidget {
           padding: const EdgeInsets.fromLTRB(8, 0, 0, 0),
           child: Text(
             email,
-            style: TextStyle(fontSize: 16),
+            style: const TextStyle(fontSize: 16),
           ),
         ),
-        Expanded(child: SizedBox()),
+        const Expanded(child: SizedBox()),
         IconButton(
-          icon: Icon(Icons.delete_forever),
+          icon: const Icon(Icons.delete_forever),
           color: Colors.redAccent,
           onPressed: () async {
             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) {
       if (event.status == SyncStatus.completedFirstGalleryImport ||
           event.status == SyncStatus.completedBackup) {
-        Future.delayed(Duration(milliseconds: 2000), () {
+        Future.delayed(const Duration(milliseconds: 2000), () {
           if (mounted) {
             setState(() {
               _showStatus = false;
@@ -56,20 +56,20 @@ class _StatusBarWidgetState extends State<StatusBarWidget> {
             children: [
               AnimatedOpacity(
                 opacity: _showStatus ? 0 : 1,
-                duration: Duration(milliseconds: 1000),
-                child: StatusBarBrandingWidget(),
+                duration: const Duration(milliseconds: 1000),
+                child: const StatusBarBrandingWidget(),
               ),
               AnimatedOpacity(
                 opacity: _showStatus ? 1 : 0,
-                duration: Duration(milliseconds: 1000),
-                child: SyncStatusWidget(),
+                duration: const Duration(milliseconds: 1000),
+                child: const SyncStatusWidget(),
               ),
             ],
           ),
           AnimatedOpacity(
             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);
     }
     if (_event.status == SyncStatus.completedBackup) {
-      return SyncStatusCompletedWidget();
+      return const SyncStatusCompletedWidget();
     }
     return RefreshIndicatorWidget(_event);
   }
@@ -144,7 +144,7 @@ class RefreshIndicatorWidget extends StatelessWidget {
       width: double.infinity,
       alignment: Alignment.center,
       child: SingleChildScrollView(
-        physics: NeverScrollableScrollPhysics(),
+        physics: const NeverScrollableScrollPhysics(),
         child: Column(
           mainAxisAlignment: MainAxisAlignment.center,
           crossAxisAlignment: CrossAxisAlignment.center,
@@ -154,7 +154,7 @@ class RefreshIndicatorWidget extends StatelessWidget {
               crossAxisAlignment: CrossAxisAlignment.center,
               children: [
                 Container(
-                  padding: EdgeInsets.all(2),
+                  padding: const EdgeInsets.all(2),
                   width: 22,
                   height: 22,
                   child: _inProgressIcon,
@@ -210,8 +210,8 @@ class StatusBarBrandingWidget extends StatelessWidget {
   Widget build(BuildContext context) {
     return Container(
       height: kContainerHeight,
-      padding: EdgeInsets.only(left: 12),
-      child: Align(
+      padding: const EdgeInsets.only(left: 12),
+      child: const Align(
         alignment: Alignment.centerLeft,
         child: Text(
           "ente",
@@ -249,8 +249,8 @@ class SyncStatusCompletedWidget extends StatelessWidget {
                   color: Theme.of(context).buttonColor,
                   size: 22,
                 ),
-                Padding(
-                  padding: const EdgeInsets.only(left: 12),
+                const Padding(
+                  padding: EdgeInsets.only(left: 12),
                   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(
       appBar: AppBar(
         elevation: 0,
-        title: Text("Today's logs"),
+        title: const Text("Today's logs"),
       ),
       body: _getBody(),
     );
@@ -40,12 +40,12 @@ class _LogFileViewerState extends State<LogFileViewer> {
       return const EnteLoadingWidget();
     }
     return Container(
-      padding: EdgeInsets.only(left: 12, top: 8, right: 12),
+      padding: const EdgeInsets.only(left: 12, top: 8, right: 12),
       child: SingleChildScrollView(
         child: Text(
           _logs,
-          style: TextStyle(
-            fontFeatures: const [
+          style: const TextStyle(
+            fontFeatures: [
               FontFeature.tabularFigures(),
             ],
             height: 1.2,

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

@@ -25,7 +25,7 @@ class DeduplicatePage extends StatefulWidget {
 }
 
 class _DeduplicatePageState extends State<DeduplicatePage> {
-  static final kHeaderRowCount = 3;
+  static const kHeaderRowCount = 3;
   static final kDeleteIconOverlay = Container(
     decoration: BoxDecoration(
       gradient: LinearGradient(
@@ -87,7 +87,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
     return Scaffold(
       appBar: AppBar(
         elevation: 0,
-        title: Text("Deduplicate Files"),
+        title: const Text("Deduplicate Files"),
       ),
       body: _getBody(),
     );
@@ -123,9 +123,9 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
                 if (_duplicates.isNotEmpty) {
                   return _getSortMenu();
                 } else {
-                  return Padding(
+                  return const Padding(
                     padding: EdgeInsets.only(top: 32),
-                    child: const EmptyState(),
+                    child: EmptyState(),
                   );
                 }
               }
@@ -148,7 +148,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
 
   Padding _getHeader() {
     return Padding(
-      padding: EdgeInsets.fromLTRB(16, 12, 16, 12),
+      padding: const EdgeInsets.fromLTRB(16, 12, 16, 12),
       child: Column(
         crossAxisAlignment: CrossAxisAlignment.start,
         children: [
@@ -157,17 +157,17 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
                 ((_shouldClubByCaptureTime ? " and capture times." : ".")),
             style: Theme.of(context).textTheme.subtitle2,
           ),
-          Padding(
+          const Padding(
             padding: EdgeInsets.all(2),
           ),
           Text(
             "Please review and delete the items you believe are duplicates.",
             style: Theme.of(context).textTheme.subtitle2,
           ),
-          Padding(
+          const Padding(
             padding: EdgeInsets.all(12),
           ),
-          Divider(
+          const Divider(
             height: 0,
           ),
         ],
@@ -177,7 +177,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
 
   Widget _getClubbingConfig() {
     return Padding(
-      padding: EdgeInsets.fromLTRB(12, 0, 12, 4),
+      padding: const EdgeInsets.fromLTRB(12, 0, 12, 4),
       child: CheckboxListTile(
         value: _shouldClubByCaptureTime,
         onChanged: (value) {
@@ -185,7 +185,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
           _resetEntriesAndSelection();
           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,
               children: [
                 sortOptionText(sortKey),
-                Padding(padding: EdgeInsets.only(left: 4)),
+                const Padding(padding: EdgeInsets.only(left: 4)),
                 Icon(
                   Icons.sort,
                   color: Theme.of(context).colorScheme.iconColor,
@@ -289,17 +289,17 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
           child: Column(
             mainAxisAlignment: MainAxisAlignment.end,
             children: [
-              Padding(padding: EdgeInsets.all(2)),
+              const Padding(padding: EdgeInsets.all(2)),
               Text(
                 text,
-                style: TextStyle(
+                style: const TextStyle(
                   fontWeight: FontWeight.bold,
                   fontSize: 14,
                   color: Colors.white,
                 ),
                 textAlign: TextAlign.center,
               ),
-              Padding(padding: EdgeInsets.all(2)),
+              const Padding(padding: EdgeInsets.all(2)),
               Text(
                 formatBytes(size),
                 style: TextStyle(
@@ -307,7 +307,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
                   fontSize: 12,
                 ),
               ),
-              Padding(padding: EdgeInsets.all(2)),
+              const Padding(padding: EdgeInsets.all(2)),
             ],
           ),
           onPressed: () async {
@@ -337,16 +337,16 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
         ),
         GridView.builder(
           shrinkWrap: true,
-          physics: NeverScrollableScrollPhysics(),
+          physics: const NeverScrollableScrollPhysics(),
           // to disable GridView's scrolling
           itemBuilder: (context, index) {
             return _buildFile(context, duplicates.files[index], itemIndex);
           },
           itemCount: duplicates.files.length,
-          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
             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(
         appBar: AppBar(
-          backgroundColor: Color(0x00000000),
+          backgroundColor: const Color(0x00000000),
           elevation: 0,
           actions: _hasBeenEdited()
               ? [
@@ -81,7 +81,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
                         _saturation = kSaturationDefault;
                       });
                     },
-                    icon: Icon(Icons.history),
+                    icon: const Icon(Icons.history),
                   )
                 ]
               : [],
@@ -89,14 +89,14 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
         body: Column(
           children: [
             Expanded(child: _buildImage()),
-            Padding(padding: EdgeInsets.all(4)),
+            const Padding(padding: EdgeInsets.all(4)),
             Column(
               children: [
                 _buildBrightness(),
                 _buildSat(),
               ],
             ),
-            Padding(padding: EdgeInsets.all(8)),
+            const Padding(padding: EdgeInsets.all(8)),
             _buildBottomBar(),
             Padding(padding: EdgeInsets.all(Platform.isIOS ? 16 : 6)),
           ],
@@ -123,7 +123,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
           maxScale: 8.0,
           cropRectPadding: const EdgeInsets.all(20.0),
           hitTestSize: 20.0,
-          cornerColor: Color.fromRGBO(45, 150, 98, 1),
+          cornerColor: const Color.fromRGBO(45, 150, 98, 1),
           editActionDetailsIsChanged: (_) {
             setState(() {
               _hasEdited = true;
@@ -176,7 +176,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
                 size: 20,
               ),
             ),
-            Padding(padding: EdgeInsets.all(2)),
+            const Padding(padding: EdgeInsets.all(2)),
             Text(
               "Flip",
               style: subtitle2.copyWith(
@@ -206,7 +206,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
               Icons.rotate_left,
               color: Theme.of(context).iconTheme.color.withOpacity(0.8),
             ),
-            Padding(padding: EdgeInsets.all(2)),
+            const Padding(padding: EdgeInsets.all(2)),
             Text(
               "Rotate left",
               style: subtitle2.copyWith(
@@ -236,7 +236,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
               Icons.rotate_right,
               color: Theme.of(context).iconTheme.color.withOpacity(0.8),
             ),
-            Padding(padding: EdgeInsets.all(2)),
+            const Padding(padding: EdgeInsets.all(2)),
             Text(
               "Rotate right",
               style: subtitle2.copyWith(
@@ -266,7 +266,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
               Icons.save_alt_outlined,
               color: Theme.of(context).iconTheme.color.withOpacity(0.8),
             ),
-            Padding(padding: EdgeInsets.all(2)),
+            const Padding(padding: EdgeInsets.all(2)),
             Text(
               "Save copy",
               style: subtitle2.copyWith(
@@ -397,7 +397,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
     TextStyle subtitle2 = Theme.of(context).textTheme.subtitle2;
 
     return Container(
-      padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
+      padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
       child: Row(
         children: [
           SizedBox(
@@ -415,8 +415,8 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
                 activeTrackHeight: 4,
                 inactiveTrackHeight: 2,
                 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,
                 tooltipBackgroundColor: Colors.grey[900],
               ),
@@ -443,7 +443,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
     TextStyle subtitle2 = Theme.of(context).textTheme.subtitle2;
 
     return Container(
-      padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
+      padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
       child: Row(
         children: [
           SizedBox(
@@ -460,9 +460,9 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
               data: SfSliderThemeData(
                 activeTrackHeight: 4,
                 inactiveTrackHeight: 2,
-                activeTrackColor: Color.fromRGBO(45, 150, 98, 1),
+                activeTrackColor: const Color.fromRGBO(45, 150, 98, 1),
                 inactiveTrackColor: Colors.grey[900],
-                thumbColor: Color.fromRGBO(45, 150, 98, 1),
+                thumbColor: const Color.fromRGBO(45, 150, 98, 1),
                 thumbRadius: 10,
                 tooltipBackgroundColor: Colors.grey[900],
               ),
@@ -487,17 +487,17 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
 
   Future<void> _showExitConfirmationDialog() async {
     AlertDialog alert = AlertDialog(
-      title: Text("Discard edits?"),
+      title: const Text("Discard edits?"),
       actions: [
         TextButton(
-          child: Text("Yes", style: TextStyle(color: Colors.red)),
+          child: const Text("Yes", style: TextStyle(color: Colors.red)),
           onPressed: () {
             Navigator.of(context, rootNavigator: true).pop('dialog');
             replacePage(context, DetailPage(widget.detailPageConfig));
           },
         ),
         TextButton(
-          child: Text("No", style: TextStyle(color: Colors.white)),
+          child: const Text("No", style: TextStyle(color: Colors.white)),
           onPressed: () {
             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(
       appBar: AppBar(
         elevation: 0,
-        title: Text("Free up space"),
+        title: const Text("Free up space"),
       ),
       body: _getBody(),
     );
@@ -73,11 +73,11 @@ class _FreeSpacePageState extends State<FreeSpacePage> {
           padding: const EdgeInsets.only(left: 36, right: 40),
           child: Row(
             children: [
-              Icon(
+              const Icon(
                 Icons.cloud_done_outlined,
                 color: Color.fromRGBO(45, 194, 98, 1.0),
               ),
-              Padding(padding: EdgeInsets.all(10)),
+              const Padding(padding: EdgeInsets.all(10)),
               Expanded(
                 child: Text(
                   count == 1
@@ -91,16 +91,16 @@ class _FreeSpacePageState extends State<FreeSpacePage> {
             ],
           ),
         ),
-        Padding(padding: EdgeInsets.all(12)),
+        const Padding(padding: EdgeInsets.all(12)),
         Padding(
           padding: const EdgeInsets.only(left: 36, right: 40),
           child: Row(
             children: [
-              Icon(
+              const Icon(
                 Icons.delete_outline,
                 color: Color.fromRGBO(45, 194, 98, 1.0),
               ),
-              Padding(padding: EdgeInsets.all(10)),
+              const Padding(padding: EdgeInsets.all(10)),
               Expanded(
                 child: Text(
                   (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: const EdgeInsets.only(left: 36, right: 40),
           child: Row(
             children: [
-              Icon(
+              const Icon(
                 Icons.devices,
                 color: Color.fromRGBO(45, 194, 98, 1.0),
               ),
-              Padding(padding: EdgeInsets.all(10)),
+              const Padding(padding: EdgeInsets.all(10)),
               Expanded(
                 child: Text(
                   "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(
           width: double.infinity,
-          constraints: BoxConstraints(
+          constraints: const BoxConstraints(
             minHeight: 64,
           ),
           padding: const EdgeInsets.fromLTRB(60, 0, 60, 0),
@@ -147,7 +147,7 @@ class _FreeSpacePageState extends State<FreeSpacePage> {
             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
   Widget build(BuildContext context) {
     final alert = AlertDialog(
-      title: Text("Set wallpaper"),
+      title: const Text("Set wallpaper"),
       content: Column(
         mainAxisSize: MainAxisSize.min,
         children: [
@@ -59,7 +59,7 @@ class _SetWallpaperDialogState extends State<SetWallpaperDialog> {
       ),
       actions: [
         TextButton(
-          child: Text(
+          child: const Text(
             "Ok",
             style: TextStyle(
               color: Colors.white,

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

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

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

@@ -58,7 +58,7 @@ class FadingAppBarState extends State<FadingAppBar> {
         ignoring: _shouldHide,
         child: AnimatedOpacity(
           opacity: _shouldHide ? 0 : 1,
-          duration: Duration(milliseconds: 150),
+          duration: const Duration(milliseconds: 150),
           child: Container(
             decoration: BoxDecoration(
               gradient: LinearGradient(
@@ -119,10 +119,10 @@ class FadingAppBarState extends State<FadingAppBar> {
                           : CupertinoIcons.cloud_download,
                       color: Theme.of(context).iconTheme.color,
                     ),
-                    Padding(
+                    const Padding(
                       padding: EdgeInsets.all(8),
                     ),
-                    Text("Download"),
+                    const Text("Download"),
                   ],
                 ),
               ),
@@ -143,10 +143,10 @@ class FadingAppBarState extends State<FadingAppBar> {
                             : CupertinoIcons.time,
                         color: Theme.of(context).iconTheme.color,
                       ),
-                      Padding(
+                      const Padding(
                         padding: EdgeInsets.all(8),
                       ),
-                      Text("Edit time"),
+                      const Text("Edit time"),
                     ],
                   ),
                 ),
@@ -164,10 +164,10 @@ class FadingAppBarState extends State<FadingAppBar> {
                           : CupertinoIcons.delete,
                       color: Theme.of(context).iconTheme.color,
                     ),
-                    Padding(
+                    const Padding(
                       padding: EdgeInsets.all(8),
                     ),
-                    Text("Delete"),
+                    const Text("Delete"),
                   ],
                 ),
               ),
@@ -187,10 +187,11 @@ class FadingAppBarState extends State<FadingAppBar> {
       ),
     );
     return AppBar(
-      iconTheme: IconThemeData(color: Colors.white), //same for both themes
+      iconTheme:
+          const IconThemeData(color: Colors.white), //same for both themes
       actions: shouldShowActions ? actions : [],
       elevation: 0,
-      backgroundColor: Color(0x00000000),
+      backgroundColor: const Color(0x00000000),
     );
   }
 
@@ -295,7 +296,7 @@ class FadingAppBarState extends State<FadingAppBar> {
             Navigator.of(context, rootNavigator: true).pop();
             widget.onFileDeleted(file);
           },
-          child: Text("Everywhere"),
+          child: const Text("Everywhere"),
         ),
       );
     } else {
@@ -309,7 +310,7 @@ class FadingAppBarState extends State<FadingAppBar> {
             Navigator.of(context, rootNavigator: true).pop();
             // 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();
             // 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();
             widget.onFileDeleted(file);
           },
-          child: Text("Everywhere"),
+          child: const Text("Everywhere"),
         ),
       );
     }
     final action = CupertinoActionSheet(
-      title: Text("Delete file?"),
+      title: const Text("Delete file?"),
       actions: actions,
       cancelButton: CupertinoActionSheetAction(
-        child: Text("Cancel"),
+        child: const Text("Cancel"),
         onPressed: () {
           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(
               padding: const EdgeInsets.only(top: 12, bottom: 12),
               child: IconButton(
-                icon: Icon(
+                icon: const Icon(
                   Icons.tune_outlined,
                   color: Colors.white,
                 ),
@@ -156,7 +156,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
       ignoring: _shouldHide,
       child: AnimatedOpacity(
         opacity: _shouldHide ? 0 : 1,
-        duration: Duration(milliseconds: 150),
+        duration: const Duration(milliseconds: 150),
         child: Align(
           alignment: Alignment.bottomCenter,
           child: Container(
@@ -192,7 +192,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
         child: Padding(
           padding: const EdgeInsets.only(top: 12, bottom: 12),
           child: IconButton(
-            icon: Icon(
+            icon: const Icon(
               Icons.restore_outlined,
               color: Colors.white,
             ),
@@ -222,7 +222,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
         child: Padding(
           padding: const EdgeInsets.only(top: 12, bottom: 12),
           child: IconButton(
-            icon: Icon(
+            icon: const Icon(
               Icons.delete_forever_outlined,
               color: Colors.white,
             ),

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

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

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

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

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

@@ -49,7 +49,7 @@ class FileWidget extends StatelessWidget {
       );
     } else {
       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
   void dispose() {
     super.dispose();
-    Future.delayed(Duration(milliseconds: 10), () {
+    Future.delayed(const Duration(milliseconds: 10), () {
       // Cancel request only if the widget has been unmounted
       if (!mounted && widget.file.isRemoteFile() && !_hasLoadedThumbnail) {
         removePendingGetThumbnailRequestIfAny(widget.file);
@@ -109,7 +109,7 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
       const ThumbnailPlaceHolder(),
       AnimatedOpacity(
         opacity: content == null ? 0 : 1.0,
-        duration: Duration(milliseconds: 200),
+        duration: const Duration(milliseconds: 200),
         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;
 
     return Container(
-      padding: EdgeInsets.only(bottom: 60),
+      padding: const EdgeInsets.only(bottom: 60),
       child: AnimatedOpacity(
         opacity: _hideStuff ? 0.0 : 1.0,
-        duration: Duration(milliseconds: 300),
+        duration: const Duration(milliseconds: 300),
         child: Container(
           height: barHeight,
           color: Colors.transparent,
@@ -158,11 +158,11 @@ class _VideoControlsState extends State<VideoControls> {
             child: AnimatedOpacity(
               opacity:
                   _latestValue != null && !_hideStuff && !_dragging ? 1.0 : 0.0,
-              duration: Duration(milliseconds: 300),
+              duration: const Duration(milliseconds: 300),
               child: GestureDetector(
                 onTap: _playPause,
                 child: Padding(
-                  padding: EdgeInsets.all(12.0),
+                  padding: const EdgeInsets.all(12.0),
                   child: Icon(
                     _latestValue.isPlaying ? Icons.pause : Icons.play_arrow,
                     color: Colors.white, // same for both themes
@@ -183,10 +183,10 @@ class _VideoControlsState extends State<VideoControls> {
         : Duration.zero;
 
     return Container(
-      margin: EdgeInsets.only(left: 20.0, right: 16.0),
+      margin: const EdgeInsets.only(left: 20.0, right: 16.0),
       child: Text(
         formatDuration(position),
-        style: TextStyle(
+        style: const TextStyle(
           fontSize: 12.0,
           color: Colors.white,
         ),
@@ -200,10 +200,10 @@ class _VideoControlsState extends State<VideoControls> {
         : Duration.zero;
 
     return Padding(
-      padding: EdgeInsets.only(right: 20.0),
+      padding: const EdgeInsets.only(right: 20.0),
       child: Text(
         formatDuration(duration),
-        style: TextStyle(
+        style: const TextStyle(
           fontSize: 12.0,
           color: Colors.white,
         ),
@@ -232,7 +232,7 @@ class _VideoControlsState extends State<VideoControls> {
     }
 
     if (chewieController.showControlsOnInitialize) {
-      _initTimer = Timer(Duration(milliseconds: 200), () {
+      _initTimer = Timer(const Duration(milliseconds: 200), () {
         setState(() {
           _hideStuff = false;
         });
@@ -257,7 +257,7 @@ class _VideoControlsState extends State<VideoControls> {
           });
         } else {
           if (isFinished) {
-            controller.seekTo(Duration(seconds: 0));
+            controller.seekTo(const Duration(seconds: 0));
           }
           controller.play();
         }
@@ -282,7 +282,7 @@ class _VideoControlsState extends State<VideoControls> {
   Widget _buildProgressBar() {
     return Expanded(
       child: Padding(
-        padding: EdgeInsets.only(right: 16.0),
+        padding: const EdgeInsets.only(right: 16.0),
         child: MaterialVideoProgressBar(
           controller,
           onDragStart: () {

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

@@ -146,19 +146,19 @@ class _VideoWidgetState extends State<VideoWidget> {
         _getThumbnail(),
         Container(
           color: Colors.black12,
-          constraints: BoxConstraints.expand(),
+          constraints: const BoxConstraints.expand(),
         ),
         Center(
           child: SizedBox.fromSize(
-            size: Size.square(30),
+            size: const Size.square(30),
             child: _progress == null || _progress == 1
-                ? CupertinoActivityIndicator(
+                ? const CupertinoActivityIndicator(
                     color: Colors.white,
                   )
                 : CircularProgressIndicator(
                     backgroundColor: Colors.black,
                     value: _progress,
-                    valueColor: AlwaysStoppedAnimation<Color>(
+                    valueColor: const AlwaysStoppedAnimation<Color>(
                       Color.fromRGBO(45, 194, 98, 1.0),
                     ),
                   ),
@@ -171,7 +171,7 @@ class _VideoWidgetState extends State<VideoWidget> {
   Widget _getThumbnail() {
     return Container(
       color: Colors.black,
-      constraints: BoxConstraints.expand(),
+      constraints: const BoxConstraints.expand(),
       child: ThumbnailWidget(
         widget.file,
         fit: BoxFit.contain,
@@ -196,7 +196,7 @@ class _VideoWidgetState extends State<VideoWidget> {
       looping: true,
       allowMuting: true,
       allowFullScreen: false,
-      customControls: VideoControls(),
+      customControls: const VideoControls(),
     );
     return Container(
       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)
-        .timeout(Duration(seconds: 15))
+        .timeout(const Duration(seconds: 15))
         .onError((e, s) {
       _logger.info("getFile failed ${_file.tag()}", e);
       return null;
@@ -133,7 +133,7 @@ class _ZoomableLiveImageState extends State<ZoomableLiveImage>
     if ((videoFile == null || !videoFile.existsSync()) &&
         _file.isRemoteFile()) {
       videoFile = await getFileFromServer(widget.file, liveVideo: true)
-          .timeout(Duration(seconds: 15))
+          .timeout(const Duration(seconds: 15))
           .onError((e, s) {
         _logger.info("getRemoteFile failed ${_file.tag()}", e);
         return null;

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

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

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

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

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

@@ -42,11 +42,11 @@ class DeviceFolderPage extends StatelessWidget {
           ? _getHeaderWidget()
           : Container(),
       initialFiles: [folder.thumbnail],
-      footer: SizedBox(height: 32),
+      footer: const SizedBox(height: 32),
     );
     return Scaffold(
       appBar: PreferredSize(
-        preferredSize: Size.fromHeight(50.0),
+        preferredSize: const Size.fromHeight(50.0),
         child: GalleryAppBarWidget(
           GalleryType.localFolder,
           folder.name,
@@ -89,14 +89,14 @@ class _BackupConfigurationHeaderWidgetState
     final isBackedUp =
         Configuration.instance.getPathsToBackUp().contains(widget.path);
     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,
       child: Row(
         mainAxisAlignment: MainAxisAlignment.spaceBetween,
         children: [
           isBackedUp
-              ? Text("Backup enabled")
+              ? const Text("Backup enabled")
               : Text(
                   "Backup disabled",
                   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) {
     return AppBar(
       backgroundColor:
-          widget.type == GalleryType.homepage ? Color(0x00000000) : null,
+          widget.type == GalleryType.homepage ? const Color(0x00000000) : null,
       elevation: 0,
       centerTitle: false,
       title: widget.type == GalleryType.homepage
@@ -163,7 +163,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
                 child: Row(
                   children: [
                     Icon(isArchived ? Icons.visibility : Icons.visibility_off),
-                    Padding(
+                    const Padding(
                       padding: EdgeInsets.all(8),
                     ),
                     Text(isArchived ? "Unhide" : "Hide"),

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

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

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

@@ -71,11 +71,11 @@ class _GalleryOverlayWidgetState extends State<GalleryOverlayWidget> {
     return Padding(
       padding: EdgeInsets.only(bottom: bottomPadding),
       child: AnimatedContainer(
-        duration: Duration(milliseconds: 300),
+        duration: const Duration(milliseconds: 300),
         curve: Curves.easeInOut,
         height: filesAreSelected ? 108 : 0,
         child: AnimatedOpacity(
-          duration: Duration(milliseconds: 100),
+          duration: const Duration(milliseconds: 100),
           opacity: filesAreSelected ? 1.0 : 0.0,
           curve: Curves.easeIn,
           child: IgnorePointer(
@@ -196,7 +196,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
                   child: BackdropFilter(
                     filter: ImageFilter.blur(sigmaX: 50, sigmaY: 50),
                     child: Container(
-                      padding: EdgeInsets.symmetric(vertical: 8),
+                      padding: const EdgeInsets.symmetric(vertical: 8),
                       //height: 32,
                       width: 86,
                       color: Theme.of(context)
@@ -355,7 +355,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
             message: "Remove",
             child: IconButton(
               color: Theme.of(context).colorScheme.iconColor,
-              icon: Icon(
+              icon: const Icon(
                 Icons.remove_circle_rounded,
               ),
               onPressed: () {
@@ -397,7 +397,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
         message: "Restore",
         child: IconButton(
           color: Theme.of(context).colorScheme.iconColor,
-          icon: Icon(
+          icon: const Icon(
             Icons.restore,
           ),
           onPressed: () {
@@ -421,7 +421,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
         message: "Delete permanently",
         child: IconButton(
           color: Theme.of(context).colorScheme.iconColor,
-          icon: Icon(
+          icon: const Icon(
             Icons.delete_forever,
           ),
           onPressed: () async {
@@ -488,7 +488,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
             _clearSelectedFiles();
             showToast(context, "Files deleted from device");
           },
-          child: Text("Device"),
+          child: const Text("Device"),
         ),
       );
       actions.add(
@@ -503,7 +503,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
             _clearSelectedFiles();
             showShortToast(context, "Moved to trash");
           },
-          child: Text("ente"),
+          child: const Text("ente"),
         ),
       );
       actions.add(
@@ -517,7 +517,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
             );
             _clearSelectedFiles();
           },
-          child: Text("Everywhere"),
+          child: const Text("Everywhere"),
         ),
       );
     } else {
@@ -532,7 +532,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
             );
             _clearSelectedFiles();
           },
-          child: Text("Delete"),
+          child: const Text("Delete"),
         ),
       );
     }
@@ -546,7 +546,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
       ),
       actions: actions,
       cancelButton: CupertinoActionSheetAction(
-        child: Text("Cancel"),
+        child: const Text("Cancel"),
         onPressed: () {
           Navigator.of(context, rootNavigator: true).pop();
         },
@@ -591,11 +591,11 @@ class _OverlayWidgetState extends State<OverlayWidget> {
               showGenericErrorDialog(context);
             }
           },
-          child: Text("Remove"),
+          child: const Text("Remove"),
         ),
       ],
       cancelButton: CupertinoActionSheetAction(
-        child: Text("Cancel"),
+        child: const Text("Cancel"),
         onPressed: () {
           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(
       appBar: PreferredSize(
-        preferredSize: Size.fromHeight(50.0),
+        preferredSize: const Size.fromHeight(50.0),
         child: GalleryAppBarWidget(
           widget.appBarType,
           "Trash",
@@ -90,20 +90,20 @@ class _TrashPageState extends State<TrashPage> {
         alignment: Alignment.bottomCenter,
         children: [
           gallery,
-          BottomShadowWidget(
+          const BottomShadowWidget(
             offsetDy: 20,
           ),
           AnimatedContainer(
-            duration: Duration(milliseconds: 300),
+            duration: const Duration(milliseconds: 300),
             curve: Curves.easeInOut,
             height: filesAreSelected ? 0 : 80,
             child: AnimatedOpacity(
-              duration: Duration(milliseconds: 100),
+              duration: const Duration(milliseconds: 100),
               opacity: filesAreSelected ? 0.0 : 1.0,
               curve: Curves.easeIn,
               child: IgnorePointer(
                 ignoring: filesAreSelected,
-                child: SafeArea(
+                child: const SafeArea(
                   minimum: EdgeInsets.only(bottom: 6),
                   child: BottomButtonsWidget(),
                 ),
@@ -125,7 +125,7 @@ class _TrashPageState extends State<TrashPage> {
       builder: (context, snapshot) {
         if (snapshot.hasData && snapshot.data > 0) {
           return Padding(
-            padding: EdgeInsets.all(16),
+            padding: const EdgeInsets.all(16),
             child: Text(
               'Items show the number the days remaining before permanent deletion',
               style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16),
@@ -155,7 +155,7 @@ class BottomButtonsWidget extends StatelessWidget {
               filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
               child: Container(
                 height: 40,
-                decoration: BoxDecoration(
+                decoration: const BoxDecoration(
                   color: Color.fromRGBO(255, 101, 101, 0.2),
                 ),
                 child: Center(
@@ -167,7 +167,7 @@ class BottomButtonsWidget extends StatelessWidget {
                     child: Text(
                       'Delete All',
                       style: Theme.of(context).textTheme.subtitle2.copyWith(
-                            color: Color.fromRGBO(255, 101, 101, 1),
+                            color: const Color.fromRGBO(255, 101, 101, 1),
                           ),
                     ),
                   ),

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است