From 4e8d8d676891f00de56974e453cd84fd381047d3 Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Tue, 28 May 2024 23:10:33 +0800 Subject: [PATCH] Fix new linter warnings --- app/lib/api/api_util.dart | 6 +-- app/lib/bloc/home_search_suggestion.dart | 9 ++-- app/lib/bloc/list_album_share_outlier.dart | 11 ++-- app/lib/bloc/list_importable_album.dart | 10 ++-- app/lib/bloc/list_tag.dart | 9 ++-- app/lib/bloc/ls_dir.dart | 9 ++-- app/lib/bloc/ls_trashbin.dart | 13 ++--- app/lib/bloc/scan_local_dir.dart | 7 ++- app/lib/bloc/search.dart | 17 ++----- app/lib/bloc/search_suggestion.dart | 4 +- app/lib/entity/album/item.dart | 6 +-- app/lib/entity/album/provider.dart | 21 +++----- app/lib/entity/album/sort_provider.dart | 8 +-- app/lib/entity/collection/adapter.dart | 12 ++--- app/lib/entity/person/adapter.dart | 4 +- app/lib/legacy/connect.dart | 7 ++- app/lib/legacy/sign_in.dart | 4 +- app/lib/widget/about_geocoding_dialog.dart | 4 +- app/lib/widget/album_dir_picker.dart | 4 +- app/lib/widget/album_importer.dart | 4 +- .../widget/album_share_outlier_browser.dart | 4 +- .../widget/animated_smooth_clip_r_rect.dart | 3 +- app/lib/widget/changelog.dart | 4 +- app/lib/widget/collection_grid_item.dart | 4 +- app/lib/widget/connect.dart | 7 ++- app/lib/widget/dialog_scaffold.dart | 4 +- app/lib/widget/dir_picker.dart | 4 +- app/lib/widget/draggable.dart | 4 +- app/lib/widget/empty_list_indicator.dart | 4 +- app/lib/widget/enhanced_photo_browser.dart | 4 +- app/lib/widget/home.dart | 4 +- app/lib/widget/home_app_bar.dart | 4 +- app/lib/widget/home_search.dart | 13 ++--- app/lib/widget/home_search_suggestion.dart | 4 +- app/lib/widget/horizontal_page_viewer.dart | 12 ++--- app/lib/widget/image_editor.dart | 7 ++- .../widget/image_editor/color_toolbar.dart | 4 +- .../widget/image_editor/crop_controller.dart | 9 ++-- .../widget/image_editor/toolbar_button.dart | 4 +- .../image_editor/transform_toolbar.dart | 7 ++- app/lib/widget/image_enhancer.dart | 4 +- app/lib/widget/image_viewer.dart | 11 ++-- app/lib/widget/list_tile_center_leading.dart | 4 +- app/lib/widget/local_file_viewer.dart | 4 +- app/lib/widget/measurable_item_list.dart | 6 +-- app/lib/widget/measure.dart | 12 ++--- .../measureable_sliver_staggered_grid.dart | 9 ++-- .../widget/photo_date_time_edit_dialog.dart | 4 +- app/lib/widget/photo_list_item.dart | 51 ++++++++----------- app/lib/widget/processing_dialog.dart | 4 +- app/lib/widget/root_picker.dart | 4 +- app/lib/widget/selectable.dart | 4 +- app/lib/widget/selection_app_bar.dart | 4 +- .../widget/settings/enhancement_settings.dart | 3 +- app/lib/widget/settings/theme_settings.dart | 3 +- app/lib/widget/setup.dart | 4 +- app/lib/widget/share_folder_picker.dart | 4 +- .../share_link_multiple_files_dialog.dart | 4 +- app/lib/widget/shared_album_info_dialog.dart | 4 +- app/lib/widget/shared_file_viewer.dart | 4 +- app/lib/widget/sign_in.dart | 4 +- app/lib/widget/simple_input_dialog.dart | 4 +- app/lib/widget/slideshow_dialog.dart | 4 +- app/lib/widget/slideshow_viewer.dart | 4 +- app/lib/widget/splash.dart | 4 +- app/lib/widget/tag_picker_dialog.dart | 4 +- app/lib/widget/trashbin_browser.dart | 4 +- app/lib/widget/trashbin_viewer.dart | 4 +- app/lib/widget/video_viewer.dart | 4 +- app/lib/widget/viewer.dart | 4 +- app/lib/widget/viewer_bottom_app_bar.dart | 4 +- app/lib/widget/viewer_detail_pane.dart | 7 ++- app/lib/widget/zoom_menu_button.dart | 7 ++- app/test/entity/exif_test.dart | 2 +- app/test/snack_bar_manager_test.dart | 2 +- np_ui/lib/src/switch_form_field.dart | 18 +++---- np_ui/lib/src/unbounded_list_tile.dart | 4 +- 77 files changed, 213 insertions(+), 297 deletions(-) diff --git a/app/lib/api/api_util.dart b/app/lib/api/api_util.dart index cbe0218a..e6fcf91f 100644 --- a/app/lib/api/api_util.dart +++ b/app/lib/api/api_util.dart @@ -1,4 +1,4 @@ -/// Helper functions working with remote Nextcloud server +// Helper functions working with remote Nextcloud server import 'dart:convert'; import 'package:clock/clock.dart'; @@ -131,7 +131,7 @@ String getAccountAvatarUrl(Account account, int size) => String getAccountAvatarUrlRelative(Account account, int size) => "avatar/${account.userId}/$size"; -/// Initiate a login with Nextclouds login flow v2: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html#login-flow-v2 +/// Initiate a login with Nextcloud login flow v2: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html#login-flow-v2 Future initiateLogin(Uri uri) async { final response = await Api.fromBaseUrl(uri).request( "POST", @@ -151,7 +151,7 @@ Future initiateLogin(Uri uri) async { } } -/// Retrieve App Password after successful initiation of login with Nextclouds login flow v2: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html#login-flow-v2 +/// Retrieve App Password after successful initiation of login with Nextcloud login flow v2: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html#login-flow-v2 Future _getAppPassword( InitiateLoginPollOptions options) async { Uri baseUrl; diff --git a/app/lib/bloc/home_search_suggestion.dart b/app/lib/bloc/home_search_suggestion.dart index 49e09490..33b4fb18 100644 --- a/app/lib/bloc/home_search_suggestion.dart +++ b/app/lib/bloc/home_search_suggestion.dart @@ -104,20 +104,17 @@ class HomeSearchSuggestionBlocInit extends HomeSearchSuggestionBlocState { } class HomeSearchSuggestionBlocLoading extends HomeSearchSuggestionBlocState { - const HomeSearchSuggestionBlocLoading(List results) - : super(results); + const HomeSearchSuggestionBlocLoading(super.results); } class HomeSearchSuggestionBlocSuccess extends HomeSearchSuggestionBlocState { - const HomeSearchSuggestionBlocSuccess(List results) - : super(results); + const HomeSearchSuggestionBlocSuccess(super.results); } @toString class HomeSearchSuggestionBlocFailure extends HomeSearchSuggestionBlocState { const HomeSearchSuggestionBlocFailure( - List results, this.exception) - : super(results); + List super.results, this.exception); @override String toString() => _$toString(); diff --git a/app/lib/bloc/list_album_share_outlier.dart b/app/lib/bloc/list_album_share_outlier.dart index cda5914d..c961c3b0 100644 --- a/app/lib/bloc/list_album_share_outlier.dart +++ b/app/lib/bloc/list_album_share_outlier.dart @@ -116,22 +116,17 @@ class ListAlbumShareOutlierBlocInit extends ListAlbumShareOutlierBlocState { } class ListAlbumShareOutlierBlocLoading extends ListAlbumShareOutlierBlocState { - const ListAlbumShareOutlierBlocLoading( - Account? account, List items) - : super(account, items); + const ListAlbumShareOutlierBlocLoading(super.account, super.items); } class ListAlbumShareOutlierBlocSuccess extends ListAlbumShareOutlierBlocState { - const ListAlbumShareOutlierBlocSuccess( - Account? account, List items) - : super(account, items); + const ListAlbumShareOutlierBlocSuccess(super.account, super.items); } @toString class ListAlbumShareOutlierBlocFailure extends ListAlbumShareOutlierBlocState { const ListAlbumShareOutlierBlocFailure( - Account? account, List items, this.exception) - : super(account, items); + super.account, super.items, this.exception); @override String toString() => _$toString(); diff --git a/app/lib/bloc/list_importable_album.dart b/app/lib/bloc/list_importable_album.dart index 73dc6a76..63f6f200 100644 --- a/app/lib/bloc/list_importable_album.dart +++ b/app/lib/bloc/list_importable_album.dart @@ -58,20 +58,16 @@ class ListImportableAlbumBlocInit extends ListImportableAlbumBlocState { } class ListImportableAlbumBlocLoading extends ListImportableAlbumBlocState { - const ListImportableAlbumBlocLoading(List items) - : super(items); + const ListImportableAlbumBlocLoading(super.items); } class ListImportableAlbumBlocSuccess extends ListImportableAlbumBlocState { - const ListImportableAlbumBlocSuccess(List items) - : super(items); + const ListImportableAlbumBlocSuccess(super.items); } @toString class ListImportableAlbumBlocFailure extends ListImportableAlbumBlocState { - const ListImportableAlbumBlocFailure( - List items, this.exception) - : super(items); + const ListImportableAlbumBlocFailure(super.items, this.exception); @override String toString() => _$toString(); diff --git a/app/lib/bloc/list_tag.dart b/app/lib/bloc/list_tag.dart index 1d6e3cb3..e4e70b4e 100644 --- a/app/lib/bloc/list_tag.dart +++ b/app/lib/bloc/list_tag.dart @@ -42,19 +42,16 @@ class ListTagBlocInit extends ListTagBlocState { } class ListTagBlocLoading extends ListTagBlocState { - const ListTagBlocLoading(Account? account, List items) - : super(account, items); + const ListTagBlocLoading(super.account, super.items); } class ListTagBlocSuccess extends ListTagBlocState { - const ListTagBlocSuccess(Account? account, List items) - : super(account, items); + const ListTagBlocSuccess(super.account, super.items); } @toString class ListTagBlocFailure extends ListTagBlocState { - const ListTagBlocFailure(Account? account, List items, this.exception) - : super(account, items); + const ListTagBlocFailure(super.account, super.items, this.exception); @override String toString() => _$toString(); diff --git a/app/lib/bloc/ls_dir.dart b/app/lib/bloc/ls_dir.dart index 2def780a..5e1d063b 100644 --- a/app/lib/bloc/ls_dir.dart +++ b/app/lib/bloc/ls_dir.dart @@ -106,20 +106,17 @@ class LsDirBlocInit extends LsDirBlocState { } class LsDirBlocLoading extends LsDirBlocState { - const LsDirBlocLoading(Account? account, File root, List items) - : super(account, root, items); + const LsDirBlocLoading(super.account, super.root, super.items); } class LsDirBlocSuccess extends LsDirBlocState { - const LsDirBlocSuccess(Account? account, File root, List items) - : super(account, root, items); + const LsDirBlocSuccess(super.account, super.root, super.items); } @toString class LsDirBlocFailure extends LsDirBlocState { const LsDirBlocFailure( - Account? account, File root, List items, this.exception) - : super(account, root, items); + super.account, super.root, super.items, this.exception); @override String toString() => _$toString(); diff --git a/app/lib/bloc/ls_trashbin.dart b/app/lib/bloc/ls_trashbin.dart index e50823dd..8cf1aa9a 100644 --- a/app/lib/bloc/ls_trashbin.dart +++ b/app/lib/bloc/ls_trashbin.dart @@ -54,20 +54,16 @@ class LsTrashbinBlocInit extends LsTrashbinBlocState { } class LsTrashbinBlocLoading extends LsTrashbinBlocState { - const LsTrashbinBlocLoading(Account? account, List items) - : super(account, items); + const LsTrashbinBlocLoading(super.account, super.items); } class LsTrashbinBlocSuccess extends LsTrashbinBlocState { - const LsTrashbinBlocSuccess(Account? account, List items) - : super(account, items); + const LsTrashbinBlocSuccess(super.account, super.items); } @toString class LsTrashbinBlocFailure extends LsTrashbinBlocState { - const LsTrashbinBlocFailure( - Account? account, List items, this.exception) - : super(account, items); + const LsTrashbinBlocFailure(super.account, super.items, this.exception); @override String toString() => _$toString(); @@ -78,8 +74,7 @@ class LsTrashbinBlocFailure extends LsTrashbinBlocState { /// The state of this bloc is inconsistent. This typically means that the data /// may have been changed externally class LsTrashbinBlocInconsistent extends LsTrashbinBlocState { - const LsTrashbinBlocInconsistent(Account? account, List items) - : super(account, items); + const LsTrashbinBlocInconsistent(super.account, super.items); } @npLog diff --git a/app/lib/bloc/scan_local_dir.dart b/app/lib/bloc/scan_local_dir.dart index efbab194..20aa3c76 100644 --- a/app/lib/bloc/scan_local_dir.dart +++ b/app/lib/bloc/scan_local_dir.dart @@ -53,17 +53,16 @@ class ScanLocalDirBlocInit extends ScanLocalDirBlocState { } class ScanLocalDirBlocLoading extends ScanLocalDirBlocState { - const ScanLocalDirBlocLoading(List files) : super(files); + const ScanLocalDirBlocLoading(super.files); } class ScanLocalDirBlocSuccess extends ScanLocalDirBlocState { - const ScanLocalDirBlocSuccess(List files) : super(files); + const ScanLocalDirBlocSuccess(super.files); } @toString class ScanLocalDirBlocFailure extends ScanLocalDirBlocState { - const ScanLocalDirBlocFailure(List files, this.exception) - : super(files); + const ScanLocalDirBlocFailure(super.files, this.exception); @override String toString() => _$toString(); diff --git a/app/lib/bloc/search.dart b/app/lib/bloc/search.dart index 238e06eb..aa71f62b 100644 --- a/app/lib/bloc/search.dart +++ b/app/lib/bloc/search.dart @@ -66,22 +66,17 @@ class SearchBlocInit extends SearchBlocState { } class SearchBlocLoading extends SearchBlocState { - const SearchBlocLoading( - Account? account, SearchCriteria criteria, List items) - : super(account, criteria, items); + const SearchBlocLoading(super.account, super.criteria, super.items); } class SearchBlocSuccess extends SearchBlocState { - const SearchBlocSuccess( - Account? account, SearchCriteria criteria, List items) - : super(account, criteria, items); + const SearchBlocSuccess(super.account, super.criteria, super.items); } @toString class SearchBlocFailure extends SearchBlocState { - const SearchBlocFailure(Account? account, SearchCriteria criteria, - List items, this.exception) - : super(account, criteria, items); + const SearchBlocFailure( + super.account, super.criteria, super.items, this.exception); @override String toString() => _$toString(); @@ -92,9 +87,7 @@ class SearchBlocFailure extends SearchBlocState { /// The state of this bloc is inconsistent. This typically means that the data /// may have been changed externally class SearchBlocInconsistent extends SearchBlocState { - const SearchBlocInconsistent( - Account? account, SearchCriteria criteria, List items) - : super(account, criteria, items); + const SearchBlocInconsistent(super.account, super.criteria, super.items); } @npLog diff --git a/app/lib/bloc/search_suggestion.dart b/app/lib/bloc/search_suggestion.dart index b744d93c..d98e170b 100644 --- a/app/lib/bloc/search_suggestion.dart +++ b/app/lib/bloc/search_suggestion.dart @@ -51,11 +51,11 @@ class SearchSuggestionBlocInit extends SearchSuggestionBlocState { } class SearchSuggestionBlocLoading extends SearchSuggestionBlocState { - const SearchSuggestionBlocLoading(List results) : super(results); + const SearchSuggestionBlocLoading(super.results); } class SearchSuggestionBlocSuccess extends SearchSuggestionBlocState { - const SearchSuggestionBlocSuccess(List results) : super(results); + const SearchSuggestionBlocSuccess(super.results); } @npLog diff --git a/app/lib/entity/album/item.dart b/app/lib/entity/album/item.dart index f136022d..cbfa97c5 100644 --- a/app/lib/entity/album/item.dart +++ b/app/lib/entity/album/item.dart @@ -128,10 +128,10 @@ class AlbumFileItem extends AlbumItem { @toString class AlbumLabelItem extends AlbumItem { AlbumLabelItem({ - required CiString addedBy, - required DateTime addedAt, + required super.addedBy, + required super.addedAt, required this.text, - }) : super(addedBy: addedBy, addedAt: addedAt); + }); factory AlbumLabelItem.fromJson( JsonObj json, CiString addedBy, DateTime addedAt) { diff --git a/app/lib/entity/album/provider.dart b/app/lib/entity/album/provider.dart index 07415761..cfb66350 100644 --- a/app/lib/entity/album/provider.dart +++ b/app/lib/entity/album/provider.dart @@ -98,12 +98,9 @@ abstract class AlbumProviderBase extends AlbumProvider { @ToString(extraParams: r"{bool isDeep = false}") class AlbumStaticProvider extends AlbumProviderBase { AlbumStaticProvider({ - DateTime? latestItemTime, + super.latestItemTime, required List items, - }) : items = UnmodifiableListView(items), - super( - latestItemTime: latestItemTime, - ); + }) : items = UnmodifiableListView(items); factory AlbumStaticProvider.fromJson(JsonObj json) { return AlbumStaticProvider( @@ -157,18 +154,16 @@ class AlbumStaticProvider extends AlbumProviderBase { abstract class AlbumDynamicProvider extends AlbumProviderBase { AlbumDynamicProvider({ - DateTime? latestItemTime, - }) : super(latestItemTime: latestItemTime); + super.latestItemTime, + }); } @ToString(extraParams: r"{bool isDeep = false}") class AlbumDirProvider extends AlbumDynamicProvider { AlbumDirProvider({ required this.dirs, - DateTime? latestItemTime, - }) : super( - latestItemTime: latestItemTime, - ); + super.latestItemTime, + }); factory AlbumDirProvider.fromJson(JsonObj json) { return AlbumDirProvider( @@ -220,8 +215,8 @@ class AlbumDirProvider extends AlbumDynamicProvider { class AlbumTagProvider extends AlbumDynamicProvider { AlbumTagProvider({ required this.tags, - DateTime? latestItemTime, - }) : super(latestItemTime: latestItemTime); + super.latestItemTime, + }); factory AlbumTagProvider.fromJson(JsonObj json) => AlbumTagProvider( latestItemTime: json["latestItemTime"] == null diff --git a/app/lib/entity/album/sort_provider.dart b/app/lib/entity/album/sort_provider.dart index 633e2d16..537f0909 100644 --- a/app/lib/entity/album/sort_provider.dart +++ b/app/lib/entity/album/sort_provider.dart @@ -145,8 +145,8 @@ abstract class AlbumReversibleSortProvider extends AlbumSortProvider { @toString class AlbumTimeSortProvider extends AlbumReversibleSortProvider { const AlbumTimeSortProvider({ - required bool isAscending, - }) : super(isAscending: isAscending); + required super.isAscending, + }); factory AlbumTimeSortProvider.fromJson(JsonObj json) { return AlbumTimeSortProvider( @@ -164,8 +164,8 @@ class AlbumTimeSortProvider extends AlbumReversibleSortProvider { @toString class AlbumFilenameSortProvider extends AlbumReversibleSortProvider { const AlbumFilenameSortProvider({ - required bool isAscending, - }) : super(isAscending: isAscending); + required super.isAscending, + }); factory AlbumFilenameSortProvider.fromJson(JsonObj json) { return AlbumFilenameSortProvider( diff --git a/app/lib/entity/collection/adapter.dart b/app/lib/entity/collection/adapter.dart index e16455a2..9e6cd977 100644 --- a/app/lib/entity/collection/adapter.dart +++ b/app/lib/entity/collection/adapter.dart @@ -30,17 +30,17 @@ abstract class CollectionAdapter { static CollectionAdapter of( DiContainer c, Account account, Collection collection) { switch (collection.contentProvider.runtimeType) { - case CollectionAlbumProvider: + case const (CollectionAlbumProvider): return CollectionAlbumAdapter(c, account, collection); - case CollectionLocationGroupProvider: + case const (CollectionLocationGroupProvider): return CollectionLocationGroupAdapter(c, account, collection); - case CollectionMemoryProvider: + case const (CollectionMemoryProvider): return CollectionMemoryAdapter(c, account, collection); - case CollectionNcAlbumProvider: + case const (CollectionNcAlbumProvider): return CollectionNcAlbumAdapter(c, account, collection); - case CollectionPersonProvider: + case const (CollectionPersonProvider): return CollectionPersonAdapter(c, account, collection); - case CollectionTagProvider: + case const (CollectionTagProvider): return CollectionTagAdapter(c, account, collection); default: throw UnsupportedError( diff --git a/app/lib/entity/person/adapter.dart b/app/lib/entity/person/adapter.dart index 72221d8e..e89c970b 100644 --- a/app/lib/entity/person/adapter.dart +++ b/app/lib/entity/person/adapter.dart @@ -12,9 +12,9 @@ abstract class PersonAdapter { static PersonAdapter of(DiContainer c, Account account, Person person) { switch (person.contentProvider.runtimeType) { - case PersonFaceRecognitionProvider: + case const (PersonFaceRecognitionProvider): return PersonFaceRecognitionAdapter(c, account, person); - case PersonRecognizeProvider: + case const (PersonRecognizeProvider): return PersonRecognizeAdapter(c, account, person); default: throw UnsupportedError( diff --git a/app/lib/legacy/connect.dart b/app/lib/legacy/connect.dart index b88328b4..8258659e 100644 --- a/app/lib/legacy/connect.dart +++ b/app/lib/legacy/connect.dart @@ -38,9 +38,9 @@ class Connect extends StatefulWidget { ); const Connect({ - Key? key, + super.key, required this.account, - }) : super(key: key); + }); Connect.fromArgs(ConnectArguments args, {Key? key}) : this( @@ -248,9 +248,8 @@ class _ConnectState extends State { class _WebDavUrlDialog extends StatefulWidget { const _WebDavUrlDialog({ - Key? key, required this.account, - }) : super(key: key); + }); @override createState() => _WebDavUrlDialogState(); diff --git a/app/lib/legacy/sign_in.dart b/app/lib/legacy/sign_in.dart index e23f0090..71fd1f62 100644 --- a/app/lib/legacy/sign_in.dart +++ b/app/lib/legacy/sign_in.dart @@ -25,9 +25,7 @@ part 'sign_in.g.dart'; class SignIn extends StatefulWidget { static const routeName = "/sign-in-legacy"; - const SignIn({ - Key? key, - }) : super(key: key); + const SignIn({super.key}); @override createState() => _SignInState(); diff --git a/app/lib/widget/about_geocoding_dialog.dart b/app/lib/widget/about_geocoding_dialog.dart index 46cfd7c0..bb4e04e5 100644 --- a/app/lib/widget/about_geocoding_dialog.dart +++ b/app/lib/widget/about_geocoding_dialog.dart @@ -2,9 +2,7 @@ import 'package:flutter/material.dart'; import 'package:nc_photos/app_localizations.dart'; class AboutGeocodingDialog extends StatelessWidget { - const AboutGeocodingDialog({ - Key? key, - }) : super(key: key); + const AboutGeocodingDialog({super.key}); @override build(BuildContext context) { diff --git a/app/lib/widget/album_dir_picker.dart b/app/lib/widget/album_dir_picker.dart index 700ca82e..c16bb3c2 100644 --- a/app/lib/widget/album_dir_picker.dart +++ b/app/lib/widget/album_dir_picker.dart @@ -28,9 +28,9 @@ class AlbumDirPicker extends StatefulWidget { ); const AlbumDirPicker({ - Key? key, + super.key, required this.account, - }) : super(key: key); + }); AlbumDirPicker.fromArgs(AlbumDirPickerArguments args, {Key? key}) : this( diff --git a/app/lib/widget/album_importer.dart b/app/lib/widget/album_importer.dart index 7a7e9112..426a3a77 100644 --- a/app/lib/widget/album_importer.dart +++ b/app/lib/widget/album_importer.dart @@ -42,9 +42,9 @@ class AlbumImporter extends StatefulWidget { ); const AlbumImporter({ - Key? key, + super.key, required this.account, - }) : super(key: key); + }); AlbumImporter.fromArgs(AlbumImporterArguments args, {Key? key}) : this( diff --git a/app/lib/widget/album_share_outlier_browser.dart b/app/lib/widget/album_share_outlier_browser.dart index f1a90814..a7281ead 100644 --- a/app/lib/widget/album_share_outlier_browser.dart +++ b/app/lib/widget/album_share_outlier_browser.dart @@ -40,10 +40,10 @@ class AlbumShareOutlierBrowser extends StatefulWidget { ); const AlbumShareOutlierBrowser({ - Key? key, + super.key, required this.account, required this.album, - }) : super(key: key); + }); AlbumShareOutlierBrowser.fromArgs(AlbumShareOutlierBrowserArguments args, {Key? key}) diff --git a/app/lib/widget/animated_smooth_clip_r_rect.dart b/app/lib/widget/animated_smooth_clip_r_rect.dart index 6040fe82..6af03964 100644 --- a/app/lib/widget/animated_smooth_clip_r_rect.dart +++ b/app/lib/widget/animated_smooth_clip_r_rect.dart @@ -59,8 +59,7 @@ class BorderSideTween extends Tween { /// The [begin] and [end] properties must be non-null before the tween is /// first used, but the arguments can be null if the values are going to be /// filled in later. - BorderSideTween({BorderSide? begin, BorderSide? end}) - : super(begin: begin, end: end); + BorderSideTween({super.begin, super.end}); /// Returns the value this variable has at the given animation clock value. @override diff --git a/app/lib/widget/changelog.dart b/app/lib/widget/changelog.dart index 9408942d..94db88bb 100644 --- a/app/lib/widget/changelog.dart +++ b/app/lib/widget/changelog.dart @@ -34,9 +34,9 @@ class Changelog extends StatelessWidget { _changelogs.keys.first > fromVersion; const Changelog({ - Key? key, + super.key, this.fromVersion, - }) : super(key: key); + }); Changelog.fromArgs(ChangelogArguments args, {Key? key}) : this( diff --git a/app/lib/widget/collection_grid_item.dart b/app/lib/widget/collection_grid_item.dart index 12713496..ca59ed6b 100644 --- a/app/lib/widget/collection_grid_item.dart +++ b/app/lib/widget/collection_grid_item.dart @@ -2,13 +2,13 @@ import 'package:flutter/material.dart'; class CollectionGridItem extends StatelessWidget { const CollectionGridItem({ - Key? key, + super.key, required this.cover, required this.title, this.subtitle, this.subtitle2, this.icon, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/app/lib/widget/connect.dart b/app/lib/widget/connect.dart index 31eb3199..635303f0 100644 --- a/app/lib/widget/connect.dart +++ b/app/lib/widget/connect.dart @@ -39,9 +39,9 @@ class Connect extends StatefulWidget { ); const Connect({ - Key? key, + super.key, required this.uri, - }) : super(key: key); + }); Connect.fromArgs(ConnectArguments args, {Key? key}) : this( @@ -303,9 +303,8 @@ class _ConnectState extends State { class _WebDavUrlDialog extends StatefulWidget { const _WebDavUrlDialog({ - Key? key, required this.account, - }) : super(key: key); + }); @override createState() => _WebDavUrlDialogState(); diff --git a/app/lib/widget/dialog_scaffold.dart b/app/lib/widget/dialog_scaffold.dart index 2c4a0b2c..0470994b 100644 --- a/app/lib/widget/dialog_scaffold.dart +++ b/app/lib/widget/dialog_scaffold.dart @@ -5,10 +5,10 @@ import 'package:flutter/material.dart'; /// Scaffold is needed for [SnackBar] to show correctly on top of a dialog class DialogScaffold extends StatelessWidget { const DialogScaffold({ - Key? key, + super.key, required this.body, this.canPop = true, - }) : super(key: key); + }); @override build(BuildContext context) { diff --git a/app/lib/widget/dir_picker.dart b/app/lib/widget/dir_picker.dart index e705e7c5..621323c0 100644 --- a/app/lib/widget/dir_picker.dart +++ b/app/lib/widget/dir_picker.dart @@ -21,14 +21,14 @@ part 'dir_picker.g.dart'; class DirPicker extends StatefulWidget { const DirPicker({ - Key? key, + super.key, required this.account, required this.strippedRootDir, this.initialPicks, this.isMultipleSelections = true, this.validator, this.onConfirmed, - }) : super(key: key); + }); @override createState() => DirPickerState(); diff --git a/app/lib/widget/draggable.dart b/app/lib/widget/draggable.dart index 4db84e7f..f44a95c0 100644 --- a/app/lib/widget/draggable.dart +++ b/app/lib/widget/draggable.dart @@ -7,7 +7,7 @@ part 'draggable.g.dart'; @npLog class Draggable extends StatelessWidget { const Draggable({ - Key? key, + super.key, required this.data, required this.child, this.feedback, @@ -16,7 +16,7 @@ class Draggable extends StatelessWidget { this.onDragStarted, this.onDragEndedAny, this.feedbackSize, - }) : super(key: key); + }); @override build(BuildContext context) { diff --git a/app/lib/widget/empty_list_indicator.dart b/app/lib/widget/empty_list_indicator.dart index 323aad4f..fc65e462 100644 --- a/app/lib/widget/empty_list_indicator.dart +++ b/app/lib/widget/empty_list_indicator.dart @@ -3,10 +3,10 @@ import 'package:flutter/widgets.dart'; class EmptyListIndicator extends StatelessWidget { const EmptyListIndicator({ - Key? key, + super.key, required this.icon, required this.text, - }) : super(key: key); + }); @override build(BuildContext context) { diff --git a/app/lib/widget/enhanced_photo_browser.dart b/app/lib/widget/enhanced_photo_browser.dart index a70ba942..b7cb512a 100644 --- a/app/lib/widget/enhanced_photo_browser.dart +++ b/app/lib/widget/enhanced_photo_browser.dart @@ -48,9 +48,9 @@ class EnhancedPhotoBrowser extends StatefulWidget { ); const EnhancedPhotoBrowser({ - Key? key, + super.key, required this.filename, - }) : super(key: key); + }); EnhancedPhotoBrowser.fromArgs(EnhancedPhotoBrowserArguments args, {Key? key}) : this( diff --git a/app/lib/widget/home.dart b/app/lib/widget/home.dart index 4641f59b..360293a8 100644 --- a/app/lib/widget/home.dart +++ b/app/lib/widget/home.dart @@ -41,9 +41,9 @@ class Home extends StatefulWidget { ); const Home({ - Key? key, + super.key, required this.account, - }) : super(key: key); + }); Home.fromArgs(HomeArguments args, {Key? key}) : this( diff --git a/app/lib/widget/home_app_bar.dart b/app/lib/widget/home_app_bar.dart index cbb8e456..73636aac 100644 --- a/app/lib/widget/home_app_bar.dart +++ b/app/lib/widget/home_app_bar.dart @@ -13,13 +13,13 @@ import 'package:np_ui/np_ui.dart'; /// AppBar for home screens class HomeSliverAppBar extends StatelessWidget { const HomeSliverAppBar({ - Key? key, + super.key, required this.account, this.actions, this.menuActions, this.onSelectedMenuActions, this.isShowProgressIcon = false, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/app/lib/widget/home_search.dart b/app/lib/widget/home_search.dart index 69bca44b..926e5a09 100644 --- a/app/lib/widget/home_search.dart +++ b/app/lib/widget/home_search.dart @@ -44,9 +44,9 @@ part 'home_search.g.dart'; class HomeSearch extends StatefulWidget { const HomeSearch({ - Key? key, + super.key, required this.account, - }) : super(key: key); + }); @override createState() => _HomeSearchState(); @@ -609,10 +609,9 @@ extension on SearchFileType { class _FilterBubbleList extends StatelessWidget { const _FilterBubbleList({ - Key? key, required this.filters, this.onEditPressed, - }) : super(key: key); + }); @override build(BuildContext context) { @@ -681,9 +680,8 @@ class _FilterBubbleList extends StatelessWidget { class _FilterEditDialog extends StatefulWidget { const _FilterEditDialog({ - Key? key, required this.searchState, - }) : super(key: key); + }); @override createState() => _FilterEditDialogState(); @@ -763,14 +761,13 @@ class _FilterEditFormValue { class _FilterDropdown extends StatefulWidget { const _FilterDropdown({ - Key? key, required this.label, required this.items, required this.itemStringifier, this.initialValue, this.onValueChanged, this.onSaved, - }) : super(key: key); + }); @override createState() => _FilterDropdownState(); diff --git a/app/lib/widget/home_search_suggestion.dart b/app/lib/widget/home_search_suggestion.dart index 3d79323d..09a4f2cb 100644 --- a/app/lib/widget/home_search_suggestion.dart +++ b/app/lib/widget/home_search_suggestion.dart @@ -30,10 +30,10 @@ class HomeSearchSuggestionController { class HomeSearchSuggestion extends StatefulWidget { const HomeSearchSuggestion({ - Key? key, + super.key, required this.account, required this.controller, - }) : super(key: key); + }); @override createState() => _HomeSearchSuggestionState(); diff --git a/app/lib/widget/horizontal_page_viewer.dart b/app/lib/widget/horizontal_page_viewer.dart index 9e51d186..6b48df36 100644 --- a/app/lib/widget/horizontal_page_viewer.dart +++ b/app/lib/widget/horizontal_page_viewer.dart @@ -6,7 +6,7 @@ import 'package:np_platform_util/np_platform_util.dart'; class HorizontalPageViewer extends StatefulWidget { HorizontalPageViewer({ - Key? key, + super.key, this.pageCount, required this.pageBuilder, this.initialPage = 0, @@ -14,8 +14,7 @@ class HorizontalPageViewer extends StatefulWidget { this.viewportFraction = 1, this.canSwitchPage = true, this.onPageChanged, - }) : controller = controller ?? HorizontalPageViewerController(), - super(key: key); + }) : controller = controller ?? HorizontalPageViewerController(); @override createState() => _HorizontalPageViewerState(); @@ -91,10 +90,9 @@ class _HorizontalPageViewerState extends State { controller: widget.controller._pageController, itemCount: widget.pageCount, itemBuilder: widget.pageBuilder, - physics: - getRawPlatform() != NpPlatform.web && widget.canSwitchPage - ? null - : const NeverScrollableScrollPhysics(), + physics: getRawPlatform() != NpPlatform.web && widget.canSwitchPage + ? null + : const NeverScrollableScrollPhysics(), ), if (getRawPlatform() == NpPlatform.web) ..._buildNavigationButtons(context), diff --git a/app/lib/widget/image_editor.dart b/app/lib/widget/image_editor.dart index 036c210d..426132f4 100644 --- a/app/lib/widget/image_editor.dart +++ b/app/lib/widget/image_editor.dart @@ -41,10 +41,10 @@ class ImageEditor extends StatefulWidget { ); const ImageEditor({ - Key? key, + super.key, required this.account, required this.file, - }) : super(key: key); + }); ImageEditor.fromArgs(ImageEditorArguments args, {Key? key}) : this( @@ -351,12 +351,11 @@ enum _ToolType { class _ToolButton extends StatelessWidget { const _ToolButton({ - Key? key, required this.icon, required this.label, required this.onPressed, this.isSelected = false, - }) : super(key: key); + }); @override build(BuildContext context) { diff --git a/app/lib/widget/image_editor/color_toolbar.dart b/app/lib/widget/image_editor/color_toolbar.dart index e1725ff7..a0da8ae9 100644 --- a/app/lib/widget/image_editor/color_toolbar.dart +++ b/app/lib/widget/image_editor/color_toolbar.dart @@ -25,10 +25,10 @@ abstract class ColorArguments { class ColorToolbar extends StatefulWidget { const ColorToolbar({ - Key? key, + super.key, required this.initialState, required this.onActiveFiltersChanged, - }) : super(key: key); + }); @override createState() => _ColorToolbarState(); diff --git a/app/lib/widget/image_editor/crop_controller.dart b/app/lib/widget/image_editor/crop_controller.dart index 7ace5346..fa36427b 100644 --- a/app/lib/widget/image_editor/crop_controller.dart +++ b/app/lib/widget/image_editor/crop_controller.dart @@ -15,11 +15,11 @@ part 'crop_controller.g.dart'; /// This widget only work when width == device width! class CropController extends StatelessWidget { const CropController({ - Key? key, + super.key, required this.image, required this.initialState, this.onCropChanged, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -41,11 +41,10 @@ class CropController extends StatelessWidget { class _WrappedCropController extends StatefulWidget { const _WrappedCropController({ - Key? key, required this.image, required this.initialState, this.onCropChanged, - }) : super(key: key); + }); @override State createState() => _WrappedCropControllerState(); @@ -429,7 +428,7 @@ class _WrappedCropControllerState extends State<_WrappedCropController> { class _TouchDot extends StatelessWidget { static const double size = 24; - const _TouchDot({Key? key}) : super(key: key); + const _TouchDot(); @override build(BuildContext context) { diff --git a/app/lib/widget/image_editor/toolbar_button.dart b/app/lib/widget/image_editor/toolbar_button.dart index 64e981d1..1ad681dd 100644 --- a/app/lib/widget/image_editor/toolbar_button.dart +++ b/app/lib/widget/image_editor/toolbar_button.dart @@ -9,13 +9,13 @@ import 'package:np_ui/np_ui.dart'; /// current order. class ToolbarButton extends StatelessWidget { const ToolbarButton({ - Key? key, + super.key, required this.icon, required this.label, required this.onPressed, this.isSelected = false, this.activationOrder, - }) : super(key: key); + }); @override build(BuildContext context) { diff --git a/app/lib/widget/image_editor/transform_toolbar.dart b/app/lib/widget/image_editor/transform_toolbar.dart index 5f055c20..11aa1628 100644 --- a/app/lib/widget/image_editor/transform_toolbar.dart +++ b/app/lib/widget/image_editor/transform_toolbar.dart @@ -16,12 +16,12 @@ abstract class TransformArguments { class TransformToolbar extends StatefulWidget { const TransformToolbar({ - Key? key, + super.key, required this.initialState, required this.onActiveFiltersChanged, required this.isCropModeChanged, required this.onCropToolDeactivated, - }) : super(key: key); + }); @override createState() => _TransformToolbarState(); @@ -243,11 +243,10 @@ class _OrientationArguments implements TransformArguments { class _OrientationButton extends StatelessWidget { const _OrientationButton({ - Key? key, required this.label, required this.onPressed, this.isSelected = false, - }) : super(key: key); + }); @override build(BuildContext context) { diff --git a/app/lib/widget/image_enhancer.dart b/app/lib/widget/image_enhancer.dart index 87a3b59b..98b7b58e 100644 --- a/app/lib/widget/image_enhancer.dart +++ b/app/lib/widget/image_enhancer.dart @@ -871,9 +871,7 @@ class _StylePickerResult { } class _StylePicker extends StatefulWidget { - const _StylePicker({ - Key? key, - }) : super(key: key); + const _StylePicker(); @override createState() => _StylePickerState(); diff --git a/app/lib/widget/image_viewer.dart b/app/lib/widget/image_viewer.dart index 4ba02e66..82fb2ffa 100644 --- a/app/lib/widget/image_viewer.dart +++ b/app/lib/widget/image_viewer.dart @@ -20,14 +20,14 @@ part 'image_viewer.g.dart'; class LocalImageViewer extends StatefulWidget { const LocalImageViewer({ - Key? key, + super.key, required this.file, required this.canZoom, this.onLoaded, this.onHeightChanged, this.onZoomStarted, this.onZoomEnded, - }) : super(key: key); + }); @override createState() => _LocalImageViewerState(); @@ -82,7 +82,7 @@ class _LocalImageViewerState extends State { class RemoteImageViewer extends StatefulWidget { const RemoteImageViewer({ - Key? key, + super.key, required this.account, required this.file, required this.canZoom, @@ -90,7 +90,7 @@ class RemoteImageViewer extends StatefulWidget { this.onHeightChanged, this.onZoomStarted, this.onZoomEnded, - }) : super(key: key); + }); @override createState() => _RemoteImageViewerState(); @@ -214,13 +214,12 @@ class _RemoteImageViewerState extends State { class _ImageViewer extends StatefulWidget { const _ImageViewer({ - Key? key, required this.child, required this.canZoom, this.onHeightChanged, this.onZoomStarted, this.onZoomEnded, - }) : super(key: key); + }); @override createState() => _ImageViewerState(); diff --git a/app/lib/widget/list_tile_center_leading.dart b/app/lib/widget/list_tile_center_leading.dart index f22c4b1b..b72d27cb 100644 --- a/app/lib/widget/list_tile_center_leading.dart +++ b/app/lib/widget/list_tile_center_leading.dart @@ -10,9 +10,9 @@ import 'package:flutter/widgets.dart'; /// than 1 line class ListTileCenterLeading extends StatelessWidget { const ListTileCenterLeading({ - Key? key, + super.key, required this.child, - }) : super(key: key); + }); @override build(BuildContext context) => SizedBox( diff --git a/app/lib/widget/local_file_viewer.dart b/app/lib/widget/local_file_viewer.dart index 344a5ed7..9a358e5b 100644 --- a/app/lib/widget/local_file_viewer.dart +++ b/app/lib/widget/local_file_viewer.dart @@ -30,10 +30,10 @@ class LocalFileViewer extends StatefulWidget { ); const LocalFileViewer({ - Key? key, + super.key, required this.streamFiles, required this.startIndex, - }) : super(key: key); + }); LocalFileViewer.fromArgs(LocalFileViewerArguments args, {Key? key}) : this( diff --git a/app/lib/widget/measurable_item_list.dart b/app/lib/widget/measurable_item_list.dart index d4f4f4a4..a6ca25d8 100644 --- a/app/lib/widget/measurable_item_list.dart +++ b/app/lib/widget/measurable_item_list.dart @@ -13,14 +13,14 @@ abstract class MeasurableItemListState { class MeasurableItemList extends StatefulWidget { const MeasurableItemList({ - Key? key, + super.key, required this.maxCrossAxisExtent, required this.itemCount, required this.itemBuilder, required this.staggeredTileBuilder, this.mainAxisSpacing = 0, this.onMaxExtentChanged, - }) : super(key: key); + }); @override createState() => _MeasurableItemListState(); @@ -137,7 +137,7 @@ class _MeasurableItemListState extends State } class _GridKey extends GlobalObjectKey { - const _GridKey(Object value) : super(value); + const _GridKey(super.value); @override operator ==(Object other) { diff --git a/app/lib/widget/measure.dart b/app/lib/widget/measure.dart index 8f8c9bde..e7cbad5e 100644 --- a/app/lib/widget/measure.dart +++ b/app/lib/widget/measure.dart @@ -8,10 +8,10 @@ class MeasureSize extends SingleChildRenderObjectWidget { final OnWidgetSizeChanged onChange; const MeasureSize({ - Key? key, + super.key, required this.onChange, - required Widget child, - }) : super(key: key, child: child); + required Widget super.child, + }); @override RenderObject createRenderObject(BuildContext context) { @@ -41,10 +41,10 @@ class _MeasureSizeRenderObject extends RenderProxyBox { class SliverMeasureExtent extends SingleChildRenderObjectWidget { const SliverMeasureExtent({ - Key? key, + super.key, required this.onChange, - required Widget child, - }) : super(key: key, child: child); + required Widget super.child, + }); @override RenderObject createRenderObject(BuildContext context) { diff --git a/app/lib/widget/measureable_sliver_staggered_grid.dart b/app/lib/widget/measureable_sliver_staggered_grid.dart index 3c62d06c..e5fd6f9a 100644 --- a/app/lib/widget/measureable_sliver_staggered_grid.dart +++ b/app/lib/widget/measureable_sliver_staggered_grid.dart @@ -4,7 +4,7 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; // ignore: must_be_immutable class MeasurableSliverStaggeredGrid extends SliverStaggeredGrid { MeasurableSliverStaggeredGrid.extentBuilder({ - Key? key, + super.key, required double maxCrossAxisExtent, required IndexedStaggeredTileBuilder staggeredTileBuilder, required IndexedWidgetBuilder itemBuilder, @@ -12,7 +12,6 @@ class MeasurableSliverStaggeredGrid extends SliverStaggeredGrid { double mainAxisSpacing = 0, double crossAxisSpacing = 0, }) : super( - key: key, gridDelegate: SliverStaggeredGridDelegateWithMaxCrossAxisExtent( maxCrossAxisExtent: maxCrossAxisExtent, mainAxisSpacing: mainAxisSpacing, @@ -42,9 +41,9 @@ class MeasurableSliverStaggeredGrid extends SliverStaggeredGrid { class RenderMeasurableSliverStaggeredGrid extends RenderSliverStaggeredGrid with WidgetsBindingObserver { RenderMeasurableSliverStaggeredGrid({ - required RenderSliverVariableSizeBoxChildManager childManager, - required SliverStaggeredGridDelegate gridDelegate, - }) : super(childManager: childManager, gridDelegate: gridDelegate); + required super.childManager, + required super.gridDelegate, + }); /// Calculate the height of this staggered grid view /// diff --git a/app/lib/widget/photo_date_time_edit_dialog.dart b/app/lib/widget/photo_date_time_edit_dialog.dart index be7dcdb3..f8e1cb40 100644 --- a/app/lib/widget/photo_date_time_edit_dialog.dart +++ b/app/lib/widget/photo_date_time_edit_dialog.dart @@ -8,9 +8,9 @@ part 'photo_date_time_edit_dialog.g.dart'; class PhotoDateTimeEditDialog extends StatefulWidget { const PhotoDateTimeEditDialog({ - Key? key, + super.key, required this.initialDateTime, - }) : super(key: key); + }); @override createState() => _PhotoDateTimeEditDialogState(); diff --git a/app/lib/widget/photo_list_item.dart b/app/lib/widget/photo_list_item.dart index 1f5a7f05..ff34e937 100644 --- a/app/lib/widget/photo_list_item.dart +++ b/app/lib/widget/photo_list_item.dart @@ -48,16 +48,12 @@ abstract class PhotoListFileItem extends SelectableItem { class PhotoListImageItem extends PhotoListFileItem { const PhotoListImageItem({ - required int fileIndex, - required FileDescriptor file, + required super.fileIndex, + required super.file, required this.account, required this.previewUrl, - required bool shouldShowFavoriteBadge, - }) : super( - fileIndex: fileIndex, - file: file, - shouldShowFavoriteBadge: shouldShowFavoriteBadge, - ); + required super.shouldShowFavoriteBadge, + }); @override Widget buildWidget(BuildContext context) => PhotoListImage( @@ -74,16 +70,12 @@ class PhotoListImageItem extends PhotoListFileItem { class PhotoListVideoItem extends PhotoListFileItem { const PhotoListVideoItem({ - required int fileIndex, - required FileDescriptor file, + required super.fileIndex, + required super.file, required this.account, required this.previewUrl, - required bool shouldShowFavoriteBadge, - }) : super( - fileIndex: fileIndex, - file: file, - shouldShowFavoriteBadge: shouldShowFavoriteBadge, - ); + required super.shouldShowFavoriteBadge, + }); @override buildWidget(BuildContext context) => PhotoListVideo( @@ -146,12 +138,9 @@ abstract class PhotoListLocalFileItem extends SelectableItem { class PhotoListLocalImageItem extends PhotoListLocalFileItem { const PhotoListLocalImageItem({ - required int fileIndex, - required LocalFile file, - }) : super( - fileIndex: fileIndex, - file: file, - ); + required super.fileIndex, + required super.file, + }); @override buildWidget(BuildContext context) { @@ -209,14 +198,14 @@ class PhotoListLocalImageItem extends PhotoListLocalFileItem { class PhotoListImage extends StatelessWidget { const PhotoListImage({ - Key? key, + super.key, required this.account, required this.previewUrl, this.padding = const EdgeInsets.all(2), this.isGif = false, this.isFavorite = false, this.heroKey, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -285,11 +274,11 @@ class PhotoListImage extends StatelessWidget { class PhotoListVideo extends StatelessWidget { const PhotoListVideo({ - Key? key, + super.key, required this.account, required this.previewUrl, this.isFavorite = false, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -337,9 +326,9 @@ class PhotoListVideo extends StatelessWidget { class PhotoListLabel extends StatelessWidget { const PhotoListLabel({ - Key? key, + super.key, required this.text, - }) : super(key: key); + }); @override build(BuildContext context) { @@ -360,10 +349,10 @@ class PhotoListLabel extends StatelessWidget { class PhotoListLabelEdit extends PhotoListLabel { const PhotoListLabelEdit({ - Key? key, - required String text, + super.key, + required super.text, required this.onEditPressed, - }) : super(key: key, text: text); + }); @override build(BuildContext context) { diff --git a/app/lib/widget/processing_dialog.dart b/app/lib/widget/processing_dialog.dart index 162b2e57..5b3ae427 100644 --- a/app/lib/widget/processing_dialog.dart +++ b/app/lib/widget/processing_dialog.dart @@ -2,9 +2,9 @@ import 'package:flutter/material.dart'; class ProcessingDialog extends StatelessWidget { const ProcessingDialog({ - Key? key, + super.key, required this.text, - }) : super(key: key); + }); @override build(BuildContext context) { diff --git a/app/lib/widget/root_picker.dart b/app/lib/widget/root_picker.dart index fd41a359..42438d56 100644 --- a/app/lib/widget/root_picker.dart +++ b/app/lib/widget/root_picker.dart @@ -32,9 +32,9 @@ class RootPicker extends StatefulWidget { ); const RootPicker({ - Key? key, + super.key, required this.account, - }) : super(key: key); + }); RootPicker.fromArgs(RootPickerArguments args, {Key? key}) : this( diff --git a/app/lib/widget/selectable.dart b/app/lib/widget/selectable.dart index 39210ad1..c0516f26 100644 --- a/app/lib/widget/selectable.dart +++ b/app/lib/widget/selectable.dart @@ -5,7 +5,7 @@ import 'package:nc_photos/widget/animated_smooth_clip_r_rect.dart'; // Overlay a check mark if an item is selected class Selectable extends StatelessWidget { const Selectable({ - Key? key, + super.key, required this.child, this.isSelected = false, required this.iconSize, @@ -14,7 +14,7 @@ class Selectable extends StatelessWidget { this.indicatorAlignment = Alignment.topLeft, this.onTap, this.onLongPress, - }) : super(key: key); + }); @override build(BuildContext context) { diff --git a/app/lib/widget/selection_app_bar.dart b/app/lib/widget/selection_app_bar.dart index cee87a52..1532cff9 100644 --- a/app/lib/widget/selection_app_bar.dart +++ b/app/lib/widget/selection_app_bar.dart @@ -3,11 +3,11 @@ import 'package:nc_photos/app_localizations.dart'; class SelectionAppBar extends StatelessWidget { const SelectionAppBar({ - Key? key, + super.key, required this.count, this.onClosePressed, this.actions, - }) : super(key: key); + }); @override build(BuildContext context) { diff --git a/app/lib/widget/settings/enhancement_settings.dart b/app/lib/widget/settings/enhancement_settings.dart index 64411c1d..3d7a09a4 100644 --- a/app/lib/widget/settings/enhancement_settings.dart +++ b/app/lib/widget/settings/enhancement_settings.dart @@ -171,11 +171,10 @@ class _WrappedEnhancementSettingsState class _SizeSlider extends StatefulWidget { const _SizeSlider({ - Key? key, required this.initialWidth, required this.initialHeight, this.onChanged, - }) : super(key: key); + }); @override createState() => _SizeSliderState(); diff --git a/app/lib/widget/settings/theme_settings.dart b/app/lib/widget/settings/theme_settings.dart index 25b90e60..b691dd62 100644 --- a/app/lib/widget/settings/theme_settings.dart +++ b/app/lib/widget/settings/theme_settings.dart @@ -505,7 +505,6 @@ class _PresetItem { /// Based on the original HueRingPicker class _HueRingPicker extends StatefulWidget { const _HueRingPicker({ - Key? key, required this.pickerColor, required this.onColorChanged, // ignore: unused_element @@ -516,7 +515,7 @@ class _HueRingPicker extends StatefulWidget { this.displayThumbColor = true, // ignore: unused_element this.pickerAreaBorderRadius = const BorderRadius.all(Radius.zero), - }) : super(key: key); + }); final Color pickerColor; final ValueChanged onColorChanged; diff --git a/app/lib/widget/setup.dart b/app/lib/widget/setup.dart index 46bc7802..f9fe5909 100644 --- a/app/lib/widget/setup.dart +++ b/app/lib/widget/setup.dart @@ -11,9 +11,7 @@ bool isNeedSetup() => Pref().getSetupProgressOr() & _PageId.all != _PageId.all; class Setup extends StatefulWidget { static const routeName = "/setup"; - const Setup({ - Key? key, - }) : super(key: key); + const Setup({super.key}); @override createState() => _SetupState(); diff --git a/app/lib/widget/share_folder_picker.dart b/app/lib/widget/share_folder_picker.dart index 845df6bf..98890b33 100644 --- a/app/lib/widget/share_folder_picker.dart +++ b/app/lib/widget/share_folder_picker.dart @@ -29,10 +29,10 @@ class ShareFolderPicker extends StatefulWidget { ); const ShareFolderPicker({ - Key? key, + super.key, required this.account, required this.initialValue, - }) : super(key: key); + }); ShareFolderPicker.fromArgs(ShareFolderPickerArguments args, {Key? key}) : this( diff --git a/app/lib/widget/share_link_multiple_files_dialog.dart b/app/lib/widget/share_link_multiple_files_dialog.dart index 948d0eed..b7b1ca40 100644 --- a/app/lib/widget/share_link_multiple_files_dialog.dart +++ b/app/lib/widget/share_link_multiple_files_dialog.dart @@ -14,9 +14,9 @@ class ShareLinkMultipleFilesDialogResult { class ShareLinkMultipleFilesDialog extends StatefulWidget { const ShareLinkMultipleFilesDialog({ - Key? key, + super.key, this.shouldAskPassword = false, - }) : super(key: key); + }); @override createState() => _ShareLinkMultipleFilesDialogState(); diff --git a/app/lib/widget/shared_album_info_dialog.dart b/app/lib/widget/shared_album_info_dialog.dart index 40704be1..9844413d 100644 --- a/app/lib/widget/shared_album_info_dialog.dart +++ b/app/lib/widget/shared_album_info_dialog.dart @@ -5,9 +5,7 @@ import 'package:nc_photos/help_utils.dart' as help_utils; import 'package:nc_photos/url_launcher_util.dart'; class SharedAlbumInfoDialog extends StatefulWidget { - const SharedAlbumInfoDialog({ - Key? key, - }) : super(key: key); + const SharedAlbumInfoDialog({super.key}); @override createState() => _SharedAlbumInfoDialogState(); diff --git a/app/lib/widget/shared_file_viewer.dart b/app/lib/widget/shared_file_viewer.dart index 0eb48b4f..290607f9 100644 --- a/app/lib/widget/shared_file_viewer.dart +++ b/app/lib/widget/shared_file_viewer.dart @@ -44,11 +44,11 @@ class SharedFileViewer extends StatefulWidget { ); const SharedFileViewer({ - Key? key, + super.key, required this.account, required this.file, required this.shares, - }) : super(key: key); + }); SharedFileViewer.fromArgs(SharedFileViewerArguments args, {Key? key}) : this( diff --git a/app/lib/widget/sign_in.dart b/app/lib/widget/sign_in.dart index 4884001b..9d0e474a 100644 --- a/app/lib/widget/sign_in.dart +++ b/app/lib/widget/sign_in.dart @@ -24,9 +24,7 @@ part 'sign_in.g.dart'; class SignIn extends StatefulWidget { static const routeName = "/sign-in"; - const SignIn({ - Key? key, - }) : super(key: key); + const SignIn({super.key}); @override createState() => _SignInState(); diff --git a/app/lib/widget/simple_input_dialog.dart b/app/lib/widget/simple_input_dialog.dart index f38b2535..ed73c700 100644 --- a/app/lib/widget/simple_input_dialog.dart +++ b/app/lib/widget/simple_input_dialog.dart @@ -2,14 +2,14 @@ import 'package:flutter/material.dart'; class SimpleInputDialog extends StatefulWidget { const SimpleInputDialog({ - Key? key, + super.key, required this.buttonText, this.titleText, this.initialText, this.hintText, this.validator, this.obscureText = false, - }) : super(key: key); + }); @override createState() => _SimpleInputDialogState(); diff --git a/app/lib/widget/slideshow_dialog.dart b/app/lib/widget/slideshow_dialog.dart index 228f3046..156e65ca 100644 --- a/app/lib/widget/slideshow_dialog.dart +++ b/app/lib/widget/slideshow_dialog.dart @@ -37,12 +37,12 @@ class SlideshowConfig { class SlideshowDialog extends StatefulWidget { const SlideshowDialog({ - Key? key, + super.key, required this.duration, required this.isShuffle, required this.isRepeat, required this.isReverse, - }) : super(key: key); + }); @override createState() => _SlideshowDialogState(); diff --git a/app/lib/widget/slideshow_viewer.dart b/app/lib/widget/slideshow_viewer.dart index dcdb7dc2..7e7caf5b 100644 --- a/app/lib/widget/slideshow_viewer.dart +++ b/app/lib/widget/slideshow_viewer.dart @@ -42,12 +42,12 @@ class SlideshowViewer extends StatefulWidget { ); const SlideshowViewer({ - Key? key, + super.key, required this.account, required this.streamFiles, required this.startIndex, required this.config, - }) : super(key: key); + }); SlideshowViewer.fromArgs(SlideshowViewerArguments args, {Key? key}) : this( diff --git a/app/lib/widget/splash.dart b/app/lib/widget/splash.dart index e42e6af6..1593eca7 100644 --- a/app/lib/widget/splash.dart +++ b/app/lib/widget/splash.dart @@ -31,9 +31,7 @@ part 'splash.g.dart'; class Splash extends StatefulWidget { static const routeName = "/splash"; - const Splash({ - Key? key, - }) : super(key: key); + const Splash({super.key}); @override createState() => _SplashState(); diff --git a/app/lib/widget/tag_picker_dialog.dart b/app/lib/widget/tag_picker_dialog.dart index 4a45c684..bc754e85 100644 --- a/app/lib/widget/tag_picker_dialog.dart +++ b/app/lib/widget/tag_picker_dialog.dart @@ -15,9 +15,9 @@ import 'package:np_string/np_string.dart'; class TagPickerDialog extends StatefulWidget { const TagPickerDialog({ - Key? key, + super.key, required this.account, - }) : super(key: key); + }); @override createState() => _TagPickerDialogState(); diff --git a/app/lib/widget/trashbin_browser.dart b/app/lib/widget/trashbin_browser.dart index 233b28c7..039e9a35 100644 --- a/app/lib/widget/trashbin_browser.dart +++ b/app/lib/widget/trashbin_browser.dart @@ -50,9 +50,9 @@ class TrashbinBrowser extends StatefulWidget { ); const TrashbinBrowser({ - Key? key, + super.key, required this.account, - }) : super(key: key); + }); TrashbinBrowser.fromArgs(TrashbinBrowserArguments args, {Key? key}) : this( diff --git a/app/lib/widget/trashbin_viewer.dart b/app/lib/widget/trashbin_viewer.dart index b81dbcf5..8a31c6cb 100644 --- a/app/lib/widget/trashbin_viewer.dart +++ b/app/lib/widget/trashbin_viewer.dart @@ -40,11 +40,11 @@ class TrashbinViewer extends StatefulWidget { ); const TrashbinViewer({ - Key? key, + super.key, required this.account, required this.streamFiles, required this.startIndex, - }) : super(key: key); + }); TrashbinViewer.fromArgs(TrashbinViewerArguments args, {Key? key}) : this( diff --git a/app/lib/widget/video_viewer.dart b/app/lib/widget/video_viewer.dart index 096732da..9ed13a9b 100644 --- a/app/lib/widget/video_viewer.dart +++ b/app/lib/widget/video_viewer.dart @@ -25,7 +25,7 @@ part 'video_viewer.g.dart'; class VideoViewer extends StatefulWidget { const VideoViewer({ - Key? key, + super.key, required this.account, required this.file, this.onLoaded, @@ -36,7 +36,7 @@ class VideoViewer extends StatefulWidget { this.isControlVisible = false, this.canPlay = true, this.canLoop = true, - }) : super(key: key); + }); @override createState() => _VideoViewerState(); diff --git a/app/lib/widget/viewer.dart b/app/lib/widget/viewer.dart index 16a5690d..339e0df3 100644 --- a/app/lib/widget/viewer.dart +++ b/app/lib/widget/viewer.dart @@ -76,12 +76,12 @@ class Viewer extends StatefulWidget { ); const Viewer({ - Key? key, + super.key, required this.account, required this.streamFiles, required this.startIndex, this.fromCollection, - }) : super(key: key); + }); Viewer.fromArgs(ViewerArguments args, {Key? key}) : this( diff --git a/app/lib/widget/viewer_bottom_app_bar.dart b/app/lib/widget/viewer_bottom_app_bar.dart index 0f39be8e..16a6f4cd 100644 --- a/app/lib/widget/viewer_bottom_app_bar.dart +++ b/app/lib/widget/viewer_bottom_app_bar.dart @@ -5,9 +5,9 @@ import 'package:flutter/material.dart'; /// Buttons are spread evenly across the horizontal axis class ViewerBottomAppBar extends StatelessWidget { const ViewerBottomAppBar({ - Key? key, + super.key, required this.children, - }) : super(key: key); + }); @override build(BuildContext context) { diff --git a/app/lib/widget/viewer_detail_pane.dart b/app/lib/widget/viewer_detail_pane.dart index 271f7473..65e5bbcb 100644 --- a/app/lib/widget/viewer_detail_pane.dart +++ b/app/lib/widget/viewer_detail_pane.dart @@ -53,7 +53,7 @@ class ViewerSingleCollectionData { class ViewerDetailPane extends StatefulWidget { const ViewerDetailPane({ - Key? key, + super.key, required this.account, required this.fd, this.fromCollection, @@ -62,7 +62,7 @@ class ViewerDetailPane extends StatefulWidget { required this.onUnarchivePressed, required this.onDeletePressed, this.onSlideshowPressed, - }) : super(key: key); + }); @override createState() => _ViewerDetailPaneState(); @@ -529,11 +529,10 @@ class _ViewerDetailPaneState extends State { class _DetailPaneButton extends StatelessWidget { const _DetailPaneButton({ - Key? key, required this.icon, required this.label, required this.onPressed, - }) : super(key: key); + }); @override build(BuildContext context) { diff --git a/app/lib/widget/zoom_menu_button.dart b/app/lib/widget/zoom_menu_button.dart index d8845975..1fccec76 100644 --- a/app/lib/widget/zoom_menu_button.dart +++ b/app/lib/widget/zoom_menu_button.dart @@ -3,12 +3,12 @@ import 'package:nc_photos/app_localizations.dart'; class ZoomMenuButton extends StatelessWidget { const ZoomMenuButton({ - Key? key, + super.key, required this.initialZoom, required this.minZoom, required this.maxZoom, this.onZoomChanged, - }) : super(key: key); + }); @override build(BuildContext context) { @@ -34,12 +34,11 @@ class ZoomMenuButton extends StatelessWidget { class _PopupMenuZoom extends PopupMenuEntry { const _PopupMenuZoom({ - Key? key, required this.initialValue, required this.minValue, required this.maxValue, this.onChanged, - }) : super(key: key); + }); @override represents(void value) => false; diff --git a/app/test/entity/exif_test.dart b/app/test/entity/exif_test.dart index 340be38d..6ed41239 100644 --- a/app/test/entity/exif_test.dart +++ b/app/test/entity/exif_test.dart @@ -220,7 +220,7 @@ extension on Rational { } class _Rational extends Rational with EquatableMixin { - _Rational(int numerator, int denominator) : super(numerator, denominator); + _Rational(super.numerator, super.denominator); factory _Rational.of(Rational r) { return _Rational(r.numerator, r.denominator); diff --git a/app/test/snack_bar_manager_test.dart b/app/test/snack_bar_manager_test.dart index 56ca4a99..1b37d8f7 100644 --- a/app/test/snack_bar_manager_test.dart +++ b/app/test/snack_bar_manager_test.dart @@ -31,7 +31,7 @@ void main() { } class _TestWidget extends StatefulWidget { - const _TestWidget(this.manager, {Key? key}) : super(key: key); + const _TestWidget(this.manager); @override createState() => _TestWidgetState(); diff --git a/np_ui/lib/src/switch_form_field.dart b/np_ui/lib/src/switch_form_field.dart index 121f2c8b..6197f952 100644 --- a/np_ui/lib/src/switch_form_field.dart +++ b/np_ui/lib/src/switch_form_field.dart @@ -2,24 +2,18 @@ import 'package:flutter/material.dart'; class SwitchFormField extends FormField { SwitchFormField({ - Key? key, - required bool initialValue, + super.key, + required bool super.initialValue, Widget? title, Widget? subtitle, Widget? subtitleTrue, Widget? subtitleFalse, bool? dense, - FormFieldSetter? onSaved, - FormFieldValidator? validator, - bool enabled = true, - AutovalidateMode? autovalidateMode, + super.onSaved, + super.validator, + super.enabled, + super.autovalidateMode, }) : super( - key: key, - onSaved: onSaved, - validator: validator, - initialValue: initialValue, - enabled: enabled, - autovalidateMode: autovalidateMode, builder: (field) { final value = field.value ?? initialValue; return SwitchListTile( diff --git a/np_ui/lib/src/unbounded_list_tile.dart b/np_ui/lib/src/unbounded_list_tile.dart index 657758f1..a0ae6654 100644 --- a/np_ui/lib/src/unbounded_list_tile.dart +++ b/np_ui/lib/src/unbounded_list_tile.dart @@ -4,13 +4,13 @@ import 'package:np_ui/src/material3.dart'; /// A [ListTile]-like widget with unbounded height class UnboundedListTile extends StatelessWidget { const UnboundedListTile({ - Key? key, + super.key, this.leading, required this.title, this.subtitle, this.trailing, this.onTap, - }) : super(key: key); + }); @override Widget build(BuildContext context) {