chore: add always_put_control_body_on_new_line lint (#28352)

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong
2026-05-12 00:47:24 +07:00
committed by GitHub
parent 7837d40f57
commit 12f7b2a005
122 changed files with 774 additions and 263 deletions
@@ -191,8 +191,12 @@ class _AssetPropertiesSectionState extends ConsumerState<_AssetPropertiesSection
}
String _getAssetTypeTitle(BaseAsset asset) {
if (asset is LocalAsset) return 'Local Asset';
if (asset is RemoteAsset) return 'Remote Asset';
if (asset is LocalAsset) {
return 'Local Asset';
}
if (asset is RemoteAsset) {
return 'Remote Asset';
}
return 'Base Asset';
}
}
@@ -245,7 +245,9 @@ class _EditAlbumDialogState extends ConsumerState<_EditAlbumDialog> {
}
Future<void> _handleSave() async {
if (formKey.currentState?.validate() != true) return;
if (formKey.currentState?.validate() != true) {
return;
}
try {
final newTitle = titleController.text.trim();
@@ -95,7 +95,9 @@ class _DriftEditImagePageState extends ConsumerState<DriftEditImagePage> with Ti
return PopScope(
canPop: !hasUnsavedEdits,
onPopInvokedWithResult: (didPop, result) async {
if (didPop) return;
if (didPop) {
return;
}
final shouldDiscard = await _showDiscardChangesDialog() ?? false;
if (shouldDiscard && mounted) {
Navigator.of(context).pop();
@@ -179,7 +179,9 @@ class EditorState {
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (identical(this, other)) {
return true;
}
return other is EditorState &&
other.isApplyingEdits == isApplyingEdits &&
@@ -58,7 +58,9 @@ class _ProfilePictureCropPageState extends ConsumerState<ProfilePictureCropPage>
}
Future<void> _handleDone() async {
if (_isLoading) return;
if (_isLoading) {
return;
}
setState(() {
_isLoading = true;
@@ -72,7 +74,9 @@ class _ProfilePictureCropPageState extends ConsumerState<ProfilePictureCropPage>
.read(uploadProfileImageProvider.notifier)
.upload(xFile, fileName: 'profile-picture.png');
if (!context.mounted) return;
if (!context.mounted) {
return;
}
if (success) {
final profileImagePath = ref.read(uploadProfileImageProvider).profileImagePath;
@@ -102,7 +106,9 @@ class _ProfilePictureCropPageState extends ConsumerState<ProfilePictureCropPage>
);
}
} catch (e) {
if (!context.mounted) return;
if (!context.mounted) {
return;
}
ImmichToast.show(
context: context,
@@ -708,7 +708,9 @@ class _SearchResultGrid extends ConsumerWidget {
bool _onScrollUpdateNotification(ScrollNotification notification) {
final metrics = notification.metrics;
if (metrics.axis != Axis.vertical) return false;
if (metrics.axis != Axis.vertical) {
return false;
}
final isBottomSheet = notification.context?.findAncestorWidgetOfExactType<DraggableScrollableSheet>() != null;
final remaining = metrics.maxScrollExtent - metrics.pixels;
@@ -735,7 +737,9 @@ class _SearchResultGrid extends ConsumerWidget {
final hasMore = ref.watch(paginatedSearchProvider.select((s) => s.nextPage != null));
if (hasMore) return null;
if (hasMore) {
return null;
}
return SliverToBoxAdapter(
child: Padding(
@@ -44,7 +44,9 @@ class PaginatedSearchNotifier extends StateNotifier<SearchState> {
Stream<int> get assetCount => _assetCountController.stream;
Future<void> search(SearchFilter filter) async {
if (state.nextPage == null || state.isLoading) return;
if (state.nextPage == null || state.isLoading) {
return;
}
state = SearchState(assets: state.assets, nextPage: state.nextPage, isLoading: true);