Explorar o código

lint: enable prefer_const_constructors_in_immutables rule

Neeraj Gupta %!s(int64=3) %!d(string=hai) anos
pai
achega
edabfe6da3
Modificáronse 43 ficheiros con 65 adicións e 65 borrados
  1. 1 1
      analysis_options.yaml
  2. 1 1
      lib/app.dart
  3. 2 2
      lib/main.dart
  4. 7 7
      lib/services/user_service.dart
  5. 1 1
      lib/ui/account/email_entry_page.dart
  6. 1 1
      lib/ui/account/login_page.dart
  7. 1 1
      lib/ui/account/ott_verification_page.dart
  8. 1 1
      lib/ui/account/password_entry_page.dart
  9. 1 1
      lib/ui/account/password_reentry_page.dart
  10. 1 1
      lib/ui/account/recovery_page.dart
  11. 1 1
      lib/ui/account/sessions_page.dart
  12. 1 1
      lib/ui/account/two_factor_recovery_page.dart
  13. 2 1
      lib/ui/account/two_factor_setup_page.dart
  14. 1 1
      lib/ui/common/dynamic_fab.dart
  15. 1 1
      lib/ui/common/gradient_button.dart
  16. 1 1
      lib/ui/huge_listview/draggable_scrollbar.dart
  17. 1 1
      lib/ui/huge_listview/huge_listview.dart
  18. 6 6
      lib/ui/landing_page_widget.dart
  19. 1 1
      lib/ui/memories_widget.dart
  20. 3 4
      lib/ui/nav_bar.dart
  21. 2 2
      lib/ui/settings/account_section_widget.dart
  22. 2 2
      lib/ui/settings/app_update_dialog.dart
  23. 1 1
      lib/ui/settings/backup_section_widget.dart
  24. 1 1
      lib/ui/settings/danger_section_widget.dart
  25. 1 1
      lib/ui/settings/details_section_widget.dart
  26. 2 2
      lib/ui/settings/security_section_widget.dart
  27. 5 5
      lib/ui/settings_page.dart
  28. 1 1
      lib/ui/sharing/manage_links_widget.dart
  29. 1 1
      lib/ui/sharing/share_collection_widget.dart
  30. 1 1
      lib/ui/tools/deduplicate_page.dart
  31. 1 1
      lib/ui/tools/free_space_page.dart
  32. 1 1
      lib/ui/tools/lock_screen.dart
  33. 1 1
      lib/ui/viewer/file/detail_page.dart
  34. 1 1
      lib/ui/viewer/file/exif_info_dialog.dart
  35. 1 1
      lib/ui/viewer/file/fading_app_bar.dart
  36. 1 1
      lib/ui/viewer/file/fading_bottom_bar.dart
  37. 1 1
      lib/ui/viewer/file/video_widget.dart
  38. 1 1
      lib/ui/viewer/file/zoomable_image.dart
  39. 1 1
      lib/ui/viewer/file/zoomable_live_image.dart
  40. 1 1
      lib/ui/viewer/gallery/device_folder_page.dart
  41. 1 1
      lib/ui/viewer/gallery/gallery.dart
  42. 1 1
      lib/ui/viewer/gallery/gallery_app_bar_widget.dart
  43. 1 1
      lib/ui/viewer/search/location_search_results_page.dart

+ 1 - 1
analysis_options.yaml

@@ -50,12 +50,12 @@ analyzer:
     constant_identifier_names: warning
     prefer_const_constructors: warning
     prefer_const_declarations: warning
+    prefer_const_constructors_in_immutables: 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_in_immutables: ignore # too many warnings
     prefer_double_quotes: ignore # too many warnings
     avoid_renaming_method_parameters: ignore # incorrect warnings for `equals` overrides
 

+ 1 - 1
lib/app.dart

@@ -20,7 +20,7 @@ class EnteApp extends StatefulWidget {
   final Future<void> Function(String) runBackgroundTask;
   final Future<void> Function(String) killBackgroundTask;
 
-  EnteApp(
+  const EnteApp(
     this.runBackgroundTask,
     this.killBackgroundTask, {
     Key key,

+ 2 - 2
lib/main.dart

@@ -60,8 +60,8 @@ Future<void> _runInForeground() async {
     _scheduleFGSync('appStart in FG');
     runApp(
       AppLock(
-        builder: (args) => EnteApp(_runBackgroundTask, _killBGTask),
-        lockScreen: LockScreen(),
+        builder: (args) => const EnteApp(_runBackgroundTask, _killBGTask),
+        lockScreen: const LockScreen(),
         enabled: Configuration.instance.shouldShowLockScreen(),
         lightTheme: lightThemeData,
         darkTheme: darkThemeData,

+ 7 - 7
lib/services/user_service.dart

@@ -230,9 +230,9 @@ class UserService {
         } else {
           await _saveConfiguration(response);
           if (Configuration.instance.getEncryptedToken() != null) {
-            page = PasswordReentryPage();
+            page = const PasswordReentryPage();
           } else {
-            page = PasswordEntryPage();
+            page = const PasswordEntryPage();
           }
         }
         Navigator.of(context).pushAndRemoveUntil(
@@ -418,7 +418,7 @@ class UserService {
         Navigator.of(context).pushAndRemoveUntil(
           MaterialPageRoute(
             builder: (BuildContext context) {
-              return PasswordReentryPage();
+              return const PasswordReentryPage();
             },
           ),
           (route) => route.isFirst,
@@ -432,7 +432,7 @@ class UserService {
         Navigator.of(context).pushAndRemoveUntil(
           MaterialPageRoute(
             builder: (BuildContext context) {
-              return LoginPage();
+              return const LoginPage();
             },
           ),
           (route) => route.isFirst,
@@ -486,7 +486,7 @@ class UserService {
         Navigator.of(context).pushAndRemoveUntil(
           MaterialPageRoute(
             builder: (BuildContext context) {
-              return LoginPage();
+              return const LoginPage();
             },
           ),
           (route) => route.isFirst,
@@ -551,7 +551,7 @@ class UserService {
         Navigator.of(context).pushAndRemoveUntil(
           MaterialPageRoute(
             builder: (BuildContext context) {
-              return PasswordReentryPage();
+              return const PasswordReentryPage();
             },
           ),
           (route) => route.isFirst,
@@ -564,7 +564,7 @@ class UserService {
         Navigator.of(context).pushAndRemoveUntil(
           MaterialPageRoute(
             builder: (BuildContext context) {
-              return LoginPage();
+              return const LoginPage();
             },
           ),
           (route) => route.isFirst,

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

@@ -17,7 +17,7 @@ import 'package:photos/utils/data_util.dart';
 import 'package:step_progress_indicator/step_progress_indicator.dart';
 
 class EmailEntryPage extends StatefulWidget {
-  EmailEntryPage({Key key}) : super(key: key);
+  const EmailEntryPage({Key key}) : super(key: key);
 
   @override
   State<EmailEntryPage> createState() => _EmailEntryPageState();

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

@@ -7,7 +7,7 @@ import 'package:photos/ui/common/dynamic_fab.dart';
 import 'package:photos/ui/common/web_page.dart';
 
 class LoginPage extends StatefulWidget {
-  LoginPage({Key key}) : super(key: key);
+  const LoginPage({Key key}) : super(key: key);
 
   @override
   State<LoginPage> createState() => _LoginPageState();

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

@@ -9,7 +9,7 @@ class OTTVerificationPage extends StatefulWidget {
   final bool isChangeEmail;
   final bool isCreateAccountScreen;
 
-  OTTVerificationPage(
+  const OTTVerificationPage(
     this.email, {
     this.isChangeEmail = false,
     this.isCreateAccountScreen = false,

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

@@ -24,7 +24,7 @@ enum PasswordEntryMode {
 class PasswordEntryPage extends StatefulWidget {
   final PasswordEntryMode mode;
 
-  PasswordEntryPage({this.mode = PasswordEntryMode.set, Key key})
+  const PasswordEntryPage({this.mode = PasswordEntryMode.set, Key key})
       : super(key: key);
 
   @override

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

@@ -9,7 +9,7 @@ import 'package:photos/ui/home_widget.dart';
 import 'package:photos/utils/dialog_util.dart';
 
 class PasswordReentryPage extends StatefulWidget {
-  PasswordReentryPage({Key key}) : super(key: key);
+  const PasswordReentryPage({Key key}) : super(key: key);
 
   @override
   State<PasswordReentryPage> createState() => _PasswordReentryPageState();

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

@@ -57,7 +57,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
                 builder: (BuildContext context) {
                   return WillPopScope(
                     onWillPop: () async => false,
-                    child: PasswordEntryPage(
+                    child: const PasswordEntryPage(
                       mode: PasswordEntryMode.reset,
                     ),
                   );

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

@@ -10,7 +10,7 @@ import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/toast_util.dart';
 
 class SessionsPage extends StatefulWidget {
-  SessionsPage({Key key}) : super(key: key);
+  const SessionsPage({Key key}) : super(key: key);
 
   @override
   State<SessionsPage> createState() => _SessionsPageState();

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

@@ -9,7 +9,7 @@ class TwoFactorRecoveryPage extends StatefulWidget {
   final String encryptedSecret;
   final String secretDecryptionNonce;
 
-  TwoFactorRecoveryPage(
+  const TwoFactorRecoveryPage(
     this.sessionID,
     this.encryptedSecret,
     this.secretDecryptionNonce, {

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

@@ -15,7 +15,8 @@ class TwoFactorSetupPage extends StatefulWidget {
   final String secretCode;
   final String qrCode;
 
-  TwoFactorSetupPage(this.secretCode, this.qrCode, {Key key}) : super(key: key);
+  const TwoFactorSetupPage(this.secretCode, this.qrCode, {Key key})
+      : super(key: key);
 
   @override
   State<TwoFactorSetupPage> createState() => _TwoFactorSetupPageState();

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

@@ -9,7 +9,7 @@ class DynamicFAB extends StatelessWidget {
   final String buttonText;
   final Function onPressedFunction;
 
-  DynamicFAB({
+  const DynamicFAB({
     Key key,
     this.isKeypadOpen,
     this.buttonText,

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

@@ -11,7 +11,7 @@ class GradientButton extends StatelessWidget {
   // padding between the text and icon
   final double paddingValue;
 
-  GradientButton({
+  const GradientButton({
     Key key,
     this.child,
     this.linearGradientColors = const [

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

@@ -18,7 +18,7 @@ class DraggableScrollbar extends StatefulWidget {
   final String Function(int) labelTextBuilder;
   final bool isEnabled;
 
-  DraggableScrollbar({
+  const DraggableScrollbar({
     Key key,
     @required this.child,
     this.backgroundColor = Colors.white,

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

@@ -54,7 +54,7 @@ class HugeListView<T> extends StatefulWidget {
 
   final bool isDraggableScrollbarEnabled;
 
-  HugeListView({
+  const HugeListView({
     Key key,
     this.controller,
     @required this.startIndex,

+ 6 - 6
lib/ui/landing_page_widget.dart

@@ -145,15 +145,15 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
   void _navigateToSignUpPage() {
     Widget page;
     if (Configuration.instance.getEncryptedToken() == null) {
-      page = EmailEntryPage();
+      page = const EmailEntryPage();
     } else {
       // No key
       if (Configuration.instance.getKeyAttributes() == null) {
         // Never had a key
-        page = PasswordEntryPage();
+        page = const PasswordEntryPage();
       } else if (Configuration.instance.getKey() == null) {
         // Yet to decrypt the key
-        page = PasswordReentryPage();
+        page = const PasswordReentryPage();
       } else {
         // All is well, user just has not subscribed
         page = getSubscriptionPage(isOnBoarding: true);
@@ -171,15 +171,15 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
   void _navigateToSignInPage() {
     Widget page;
     if (Configuration.instance.getEncryptedToken() == null) {
-      page = LoginPage();
+      page = const LoginPage();
     } else {
       // No key
       if (Configuration.instance.getKeyAttributes() == null) {
         // Never had a key
-        page = PasswordEntryPage();
+        page = const PasswordEntryPage();
       } else if (Configuration.instance.getKey() == null) {
         // Yet to decrypt the key
-        page = PasswordReentryPage();
+        page = const PasswordReentryPage();
       } else {
         // All is well, user just has not subscribed
         page = getSubscriptionPage(isOnBoarding: true);

+ 1 - 1
lib/ui/memories_widget.dart

@@ -197,7 +197,7 @@ class FullScreenMemory extends StatefulWidget {
   final List<Memory> memories;
   final int index;
 
-  FullScreenMemory(this.title, this.memories, this.index, {Key key})
+  const FullScreenMemory(this.title, this.memories, this.index, {Key key})
       : super(key: key);
 
   @override

+ 3 - 4
lib/ui/nav_bar.dart

@@ -74,12 +74,13 @@ class _GNavState extends State<GNav> {
 
   @override
   Widget build(BuildContext context) {
+    debugPrint(
+      '${(_GNavState).toString()} - build with index ${widget.selectedIndex}',
+    );
     selectedIndex = widget.selectedIndex;
 
     return Container(
       color: widget.backgroundColor ?? Colors.transparent,
-      // padding: EdgeInsets.all(12),
-      // alignment: Alignment.center,
       child: Row(
         mainAxisAlignment: widget.mainAxisAlignment,
         children: widget.tabs
@@ -300,7 +301,6 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
   void initState() {
     super.initState();
     _expanded = widget.active;
-
     expandController =
         AnimationController(vsync: this, duration: widget.duration)
           ..addListener(() => setState(() {}));
@@ -309,7 +309,6 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
   @override
   void dispose() {
     expandController.dispose();
-
     super.dispose();
   }
 

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

@@ -16,7 +16,7 @@ import 'package:photos/utils/navigation_util.dart';
 import 'package:photos/utils/toast_util.dart';
 
 class AccountSectionWidget extends StatefulWidget {
-  AccountSectionWidget({Key key}) : super(key: key);
+  const AccountSectionWidget({Key key}) : super(key: key);
 
   @override
   AccountSectionWidgetState createState() => AccountSectionWidgetState();
@@ -114,7 +114,7 @@ class AccountSectionWidgetState extends State<AccountSectionWidget> {
             Navigator.of(context).push(
               MaterialPageRoute(
                 builder: (BuildContext context) {
-                  return PasswordEntryPage(
+                  return const PasswordEntryPage(
                     mode: PasswordEntryMode.update,
                   );
                 },

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

@@ -8,7 +8,7 @@ import 'package:photos/services/update_service.dart';
 class AppUpdateDialog extends StatefulWidget {
   final LatestVersionInfo latestVersionInfo;
 
-  AppUpdateDialog(this.latestVersionInfo, {Key key}) : super(key: key);
+  const AppUpdateDialog(this.latestVersionInfo, {Key key}) : super(key: key);
 
   @override
   State<AppUpdateDialog> createState() => _AppUpdateDialogState();
@@ -95,7 +95,7 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
 class ApkDownloaderDialog extends StatefulWidget {
   final LatestVersionInfo versionInfo;
 
-  ApkDownloaderDialog(this.versionInfo, {Key key}) : super(key: key);
+  const ApkDownloaderDialog(this.versionInfo, {Key key}) : super(key: key);
 
   @override
   State<ApkDownloaderDialog> createState() => _ApkDownloaderDialogState();

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

@@ -21,7 +21,7 @@ import 'package:photos/utils/toast_util.dart';
 import 'package:url_launcher/url_launcher.dart';
 
 class BackupSectionWidget extends StatefulWidget {
-  BackupSectionWidget({Key key}) : super(key: key);
+  const BackupSectionWidget({Key key}) : super(key: key);
 
   @override
   BackupSectionWidgetState createState() => BackupSectionWidgetState();

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

@@ -8,7 +8,7 @@ import 'package:photos/ui/settings/settings_text_item.dart';
 import 'package:url_launcher/url_launcher.dart';
 
 class DangerSectionWidget extends StatefulWidget {
-  DangerSectionWidget({Key key}) : super(key: key);
+  const DangerSectionWidget({Key key}) : super(key: key);
 
   @override
   State<DangerSectionWidget> createState() => _DangerSectionWidgetState();

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

@@ -12,7 +12,7 @@ import 'package:photos/ui/payment/subscription.dart';
 import 'package:photos/utils/data_util.dart';
 
 class DetailsSectionWidget extends StatefulWidget {
-  DetailsSectionWidget({Key key}) : super(key: key);
+  const DetailsSectionWidget({Key key}) : super(key: key);
 
   @override
   State<DetailsSectionWidget> createState() => _DetailsSectionWidgetState();

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

@@ -19,7 +19,7 @@ import 'package:photos/utils/auth_util.dart';
 import 'package:photos/utils/toast_util.dart';
 
 class SecuritySectionWidget extends StatefulWidget {
-  SecuritySectionWidget({Key key}) : super(key: key);
+  const SecuritySectionWidget({Key key}) : super(key: key);
 
   @override
   State<SecuritySectionWidget> createState() => _SecuritySectionWidgetState();
@@ -261,7 +261,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
           Navigator.of(context).push(
             MaterialPageRoute(
               builder: (BuildContext context) {
-                return SessionsPage();
+                return const SessionsPage();
               },
             ),
           );

+ 5 - 5
lib/ui/settings_page.dart

@@ -67,16 +67,16 @@ class SettingsPage extends StatelessWidget {
     contents.add(const Padding(padding: EdgeInsets.all(4)));
     if (hasLoggedIn) {
       contents.addAll([
-        DetailsSectionWidget(),
+        const DetailsSectionWidget(),
         const Padding(padding: EdgeInsets.only(bottom: 24)),
-        BackupSectionWidget(),
+        const BackupSectionWidget(),
         sectionDivider,
-        AccountSectionWidget(),
+        const AccountSectionWidget(),
         sectionDivider,
       ]);
     }
     contents.addAll([
-      SecuritySectionWidget(),
+      const SecuritySectionWidget(),
       sectionDivider,
       const SupportSectionWidget(),
       sectionDivider,
@@ -87,7 +87,7 @@ class SettingsPage extends StatelessWidget {
     if (hasLoggedIn) {
       contents.addAll([
         sectionDivider,
-        DangerSectionWidget(),
+        const DangerSectionWidget(),
       ]);
     }
 

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

@@ -17,7 +17,7 @@ import 'package:tuple/tuple.dart';
 class ManageSharedLinkWidget extends StatefulWidget {
   final Collection collection;
 
-  ManageSharedLinkWidget({Key key, this.collection}) : super(key: key);
+  const ManageSharedLinkWidget({Key key, this.collection}) : super(key: key);
 
   @override
   State<ManageSharedLinkWidget> createState() => _ManageSharedLinkWidgetState();

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

@@ -29,7 +29,7 @@ import 'package:photos/utils/toast_util.dart';
 class SharingDialog extends StatefulWidget {
   final Collection collection;
 
-  SharingDialog(this.collection, {Key key}) : super(key: key);
+  const SharingDialog(this.collection, {Key key}) : super(key: key);
 
   @override
   State<SharingDialog> createState() => _SharingDialogState();

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

@@ -18,7 +18,7 @@ import 'package:photos/utils/toast_util.dart';
 class DeduplicatePage extends StatefulWidget {
   final List<DuplicateFiles> duplicates;
 
-  DeduplicatePage(this.duplicates, {Key key}) : super(key: key);
+  const DeduplicatePage(this.duplicates, {Key key}) : super(key: key);
 
   @override
   State<DeduplicatePage> createState() => _DeduplicatePageState();

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

@@ -9,7 +9,7 @@ import 'package:photos/utils/delete_file_util.dart';
 class FreeSpacePage extends StatefulWidget {
   final BackupStatus status;
 
-  FreeSpacePage(this.status, {Key key}) : super(key: key);
+  const FreeSpacePage(this.status, {Key key}) : super(key: key);
 
   @override
   State<FreeSpacePage> createState() => _FreeSpacePageState();

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

@@ -5,7 +5,7 @@ import 'package:photos/ui/tools/app_lock.dart';
 import 'package:photos/utils/auth_util.dart';
 
 class LockScreen extends StatefulWidget {
-  LockScreen({Key key}) : super(key: key);
+  const LockScreen({Key key}) : super(key: key);
 
   @override
   State<LockScreen> createState() => _LockScreenState();

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

@@ -53,7 +53,7 @@ class DetailPageConfiguration {
 class DetailPage extends StatefulWidget {
   final DetailPageConfiguration config;
 
-  DetailPage(this.config, {key}) : super(key: key);
+  const DetailPage(this.config, {key}) : super(key: key);
 
   @override
   State<DetailPage> createState() => _DetailPageState();

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

@@ -7,7 +7,7 @@ import 'package:photos/utils/exif_util.dart';
 
 class ExifInfoDialog extends StatefulWidget {
   final File file;
-  ExifInfoDialog(this.file, {Key key}) : super(key: key);
+  const ExifInfoDialog(this.file, {Key key}) : super(key: key);
 
   @override
   State<ExifInfoDialog> createState() => _ExifInfoDialogState();

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

@@ -31,7 +31,7 @@ class FadingAppBar extends StatefulWidget implements PreferredSizeWidget {
   final bool shouldShowActions;
   final int userID;
 
-  FadingAppBar(
+  const FadingAppBar(
     this.file,
     this.onFileDeleted,
     this.userID,

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

@@ -20,7 +20,7 @@ class FadingBottomBar extends StatefulWidget {
   final Function(File) onEditRequested;
   final bool showOnlyInfoButton;
 
-  FadingBottomBar(
+  const FadingBottomBar(
     this.file,
     this.onEditRequested,
     this.showOnlyInfoButton, {

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

@@ -19,7 +19,7 @@ class VideoWidget extends StatefulWidget {
   final String tagPrefix;
   final Function(bool) playbackCallback;
 
-  VideoWidget(
+  const VideoWidget(
     this.file, {
     this.autoPlay = false,
     this.tagPrefix,

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

@@ -19,7 +19,7 @@ class ZoomableImage extends StatefulWidget {
   final String tagPrefix;
   final Decoration backgroundDecoration;
 
-  ZoomableImage(
+  const ZoomableImage(
     this.photo, {
     Key key,
     this.shouldDisableScroll,

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

@@ -18,7 +18,7 @@ class ZoomableLiveImage extends StatefulWidget {
   final String tagPrefix;
   final Decoration backgroundDecoration;
 
-  ZoomableLiveImage(
+  const ZoomableLiveImage(
     this.file, {
     Key key,
     this.shouldDisableScroll,

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

@@ -75,7 +75,7 @@ class DeviceFolderPage extends StatelessWidget {
 class BackupConfigurationHeaderWidget extends StatefulWidget {
   final String path;
 
-  BackupConfigurationHeaderWidget(this.path, {Key key}) : super(key: key);
+  const BackupConfigurationHeaderWidget(this.path, {Key key}) : super(key: key);
 
   @override
   State<BackupConfigurationHeaderWidget> createState() =>

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

@@ -37,7 +37,7 @@ class Gallery extends StatefulWidget {
   final bool smallerTodayFont;
   final String albumName;
 
-  Gallery({
+  const Gallery({
     @required this.asyncLoader,
     @required this.selectedFiles,
     @required this.tagPrefix,

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

@@ -22,7 +22,7 @@ class GalleryAppBarWidget extends StatefulWidget {
   final String path;
   final Collection collection;
 
-  GalleryAppBarWidget(
+  const GalleryAppBarWidget(
     this.type,
     this.title,
     this.selectedFiles, {

+ 1 - 1
lib/ui/viewer/search/location_search_results_page.dart

@@ -18,7 +18,7 @@ class LocationSearchResultsPage extends StatefulWidget {
   final ViewPort viewPort;
   final String name;
 
-  LocationSearchResultsPage(this.viewPort, this.name, {Key key})
+  const LocationSearchResultsPage(this.viewPort, this.name, {Key key})
       : super(key: key);
 
   @override