chore: bump line length to 120 (#20191)

This commit is contained in:
shenlong
2025-07-25 08:07:22 +05:30
committed by GitHub
parent 977c9b96ba
commit ad65e9011a
517 changed files with 4520 additions and 9514 deletions
@@ -25,13 +25,11 @@ class AddToAlbumSliverList extends HookConsumerWidget {
final albumSortMode = ref.watch(albumSortByOptionsProvider);
final albumSortIsReverse = ref.watch(albumSortOrderProvider);
final sortedAlbums = albumSortMode.sortFn(albums, albumSortIsReverse);
final sortedSharedAlbums =
albumSortMode.sortFn(sharedAlbums, albumSortIsReverse);
final sortedSharedAlbums = albumSortMode.sortFn(sharedAlbums, albumSortIsReverse);
return SliverList(
delegate: SliverChildBuilderDelegate(
childCount: albums.length + (sharedAlbums.isEmpty ? 0 : 1),
(context, index) {
delegate:
SliverChildBuilderDelegate(childCount: albums.length + (sharedAlbums.isEmpty ? 0 : 1), (context, index) {
// Build shared expander
if (index == 0 && sortedSharedAlbums.isNotEmpty) {
return Padding(
@@ -47,9 +45,7 @@ class AddToAlbumSliverList extends HookConsumerWidget {
itemCount: sortedSharedAlbums.length,
itemBuilder: (context, index) => AlbumThumbnailListTile(
album: sortedSharedAlbums[index],
onTap: enabled
? () => onAddToAlbum(sortedSharedAlbums[index])
: () {},
onTap: enabled ? () => onAddToAlbum(sortedSharedAlbums[index]) : () {},
),
),
],
@@ -109,9 +109,7 @@ class AlbumThumbnailCard extends ConsumerWidget {
borderRadius: const BorderRadius.all(
Radius.circular(20),
),
child: album.thumbnail.value == null
? buildEmptyThumbnail()
: buildAlbumThumbnail(),
child: album.thumbnail.value == null ? buildEmptyThumbnail() : buildAlbumThumbnail(),
),
),
if (showTitle) ...[
@@ -50,10 +50,8 @@ class AlbumThumbnailListTile extends StatelessWidget {
type: AssetMediaSize.thumbnail,
),
httpHeaders: ApiService.getRequestHeaders(),
cacheKey:
getAlbumThumbNailCacheKey(album, type: AssetMediaSize.thumbnail),
errorWidget: (context, url, error) =>
const Icon(Icons.image_not_supported_outlined),
cacheKey: getAlbumThumbNailCacheKey(album, type: AssetMediaSize.thumbnail),
errorWidget: (context, url, error) => const Icon(Icons.image_not_supported_outlined),
);
}
@@ -70,9 +68,7 @@ class AlbumThumbnailListTile extends StatelessWidget {
children: [
ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child: album.thumbnail.value == null
? buildEmptyThumbnail()
: buildAlbumThumbnail(),
child: album.thumbnail.value == null ? buildEmptyThumbnail() : buildAlbumThumbnail(),
),
Expanded(
child: Padding(
@@ -12,8 +12,7 @@ import 'package:immich_mobile/providers/album/current_album.provider.dart';
import 'package:immich_mobile/routing/router.dart';
import 'package:immich_mobile/widgets/common/immich_toast.dart';
class AlbumViewerAppbar extends HookConsumerWidget
implements PreferredSizeWidget {
class AlbumViewerAppbar extends HookConsumerWidget implements PreferredSizeWidget {
const AlbumViewerAppbar({
super.key,
required this.userId,
@@ -53,13 +52,10 @@ class AlbumViewerAppbar extends HookConsumerWidget
final newAlbumDescription = albumViewer.editDescriptionText;
final isEditAlbum = albumViewer.isEditAlbum;
final comments = album.shared
? ref.watch(activityStatisticsProvider(album.remoteId!))
: 0;
final comments = album.shared ? ref.watch(activityStatisticsProvider(album.remoteId!)) : 0;
deleteAlbum() async {
final bool success =
await ref.watch(albumProvider.notifier).deleteAlbum(album);
final bool success = await ref.watch(albumProvider.notifier).deleteAlbum(album);
context.navigateTo(const TabControllerRoute(children: [AlbumsRoute()]));
@@ -112,8 +108,7 @@ class AlbumViewerAppbar extends HookConsumerWidget
}
void onLeaveAlbumPressed() async {
bool isSuccess =
await ref.watch(albumProvider.notifier).leaveAlbum(album);
bool isSuccess = await ref.watch(albumProvider.notifier).leaveAlbum(album);
if (isSuccess) {
context.navigateTo(const TabControllerRoute(children: [AlbumsRoute()]));
@@ -152,8 +147,7 @@ class AlbumViewerAppbar extends HookConsumerWidget
}
void onSortOrderToggled() async {
final updatedAlbum =
await ref.read(albumProvider.notifier).toggleSortOrder(album);
final updatedAlbum = await ref.read(albumProvider.notifier).toggleSortOrder(album);
if (updatedAlbum == null) {
ImmichToast.show(
@@ -241,8 +235,7 @@ class AlbumViewerAppbar extends HookConsumerWidget
children: [
...buildBottomSheetActions(),
if (onAddPhotos != null) ...commonActions,
if (onAddPhotos != null && userId == album.ownerId)
...ownerActions,
if (onAddPhotos != null && userId == album.ownerId) ...ownerActions,
],
),
),
@@ -281,9 +274,7 @@ class AlbumViewerAppbar extends HookConsumerWidget
return IconButton(
onPressed: () async {
if (newAlbumTitle.isNotEmpty) {
bool isSuccess = await ref
.watch(albumViewerProvider.notifier)
.changeAlbumTitle(album, newAlbumTitle);
bool isSuccess = await ref.watch(albumViewerProvider.notifier).changeAlbumTitle(album, newAlbumTitle);
if (!isSuccess) {
ImmichToast.show(
context: context,
@@ -294,9 +285,8 @@ class AlbumViewerAppbar extends HookConsumerWidget
}
titleFocusNode.unfocus();
} else if (newAlbumDescription.isNotEmpty) {
bool isSuccessDescription = await ref
.watch(albumViewerProvider.notifier)
.changeAlbumDescription(album, newAlbumDescription);
bool isSuccessDescription =
await ref.watch(albumViewerProvider.notifier).changeAlbumDescription(album, newAlbumDescription);
if (!isSuccessDescription) {
ImmichToast.show(
context: context,
@@ -330,8 +320,7 @@ class AlbumViewerAppbar extends HookConsumerWidget
leading: buildLeadingButton(),
centerTitle: false,
actions: [
if (album.shared && (album.activityEnabled || comments != 0))
buildActivitiesButton(),
if (album.shared && (album.activityEnabled || comments != 0)) buildActivitiesButton(),
if (album.isRemote) ...[
IconButton(
splashRadius: 25,
@@ -19,15 +19,13 @@ class AlbumViewerEditableDescription extends HookConsumerWidget {
final albumViewerState = ref.watch(albumViewerProvider);
final descriptionTextEditController = useTextEditingController(
text: albumViewerState.isEditAlbum &&
albumViewerState.editDescriptionText.isNotEmpty
text: albumViewerState.isEditAlbum && albumViewerState.editDescriptionText.isNotEmpty
? albumViewerState.editDescriptionText
: albumDescription,
);
void onFocusModeChange() {
if (!descriptionFocusNode.hasFocus &&
descriptionTextEditController.text.isEmpty) {
if (!descriptionFocusNode.hasFocus && descriptionTextEditController.text.isEmpty) {
ref.watch(albumViewerProvider.notifier).setEditDescriptionText("");
descriptionTextEditController.text = "";
}
@@ -49,9 +47,7 @@ class AlbumViewerEditableDescription extends HookConsumerWidget {
onChanged: (value) {
if (value.isEmpty) {
} else {
ref
.watch(albumViewerProvider.notifier)
.setEditDescriptionText(value);
ref.watch(albumViewerProvider.notifier).setEditDescriptionText(value);
}
},
focusNode: descriptionFocusNode,
@@ -62,9 +58,7 @@ class AlbumViewerEditableDescription extends HookConsumerWidget {
onTap: () {
context.focusScope.requestFocus(descriptionFocusNode);
ref
.watch(albumViewerProvider.notifier)
.setEditDescriptionText(albumDescription);
ref.watch(albumViewerProvider.notifier).setEditDescriptionText(albumDescription);
ref.watch(albumViewerProvider.notifier).enableEditAlbum();
if (descriptionTextEditController.text == '') {
@@ -19,8 +19,7 @@ class AlbumViewerEditableTitle extends HookConsumerWidget {
final albumViewerState = ref.watch(albumViewerProvider);
final titleTextEditController = useTextEditingController(
text: albumViewerState.isEditAlbum &&
albumViewerState.editTitleText.isNotEmpty
text: albumViewerState.isEditAlbum && albumViewerState.editTitleText.isNotEmpty
? albumViewerState.editTitleText
: albumName,
);
@@ -16,8 +16,7 @@ class RemoteAlbumSharedUserIcons extends ConsumerWidget {
return const SizedBox();
}
final sharedUsersAsync =
ref.watch(remoteAlbumSharedUsersProvider(currentAlbum.id));
final sharedUsersAsync = ref.watch(remoteAlbumSharedUsersProvider(currentAlbum.id));
return sharedUsersAsync.maybeWhen(
data: (sharedUsers) {