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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
517 changed files with 4520 additions and 9514 deletions

View file

@ -45,17 +45,13 @@ class SharedLinkItem extends ConsumerWidget {
if (difference.inHours % 24 > 12) {
dayDifference += 1;
}
expiresText = "shared_link_expires_days"
.tr(namedArgs: {'count': dayDifference.toString()});
expiresText = "shared_link_expires_days".tr(namedArgs: {'count': dayDifference.toString()});
} else if (difference.inHours > 0) {
expiresText = "shared_link_expires_hours"
.tr(namedArgs: {'count': difference.inHours.toString()});
expiresText = "shared_link_expires_hours".tr(namedArgs: {'count': difference.inHours.toString()});
} else if (difference.inMinutes > 0) {
expiresText = "shared_link_expires_minutes"
.tr(namedArgs: {'count': difference.inMinutes.toString()});
expiresText = "shared_link_expires_minutes".tr(namedArgs: {'count': difference.inMinutes.toString()});
} else if (difference.inSeconds > 0) {
expiresText = "shared_link_expires_seconds"
.tr(namedArgs: {'count': difference.inSeconds.toString()});
expiresText = "shared_link_expires_seconds".tr(namedArgs: {'count': difference.inSeconds.toString()});
}
}
return Text(
@ -68,17 +64,14 @@ class SharedLinkItem extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final colorScheme = context.colorScheme;
final isDarkMode = colorScheme.brightness == Brightness.dark;
final thumbnailUrl = sharedLink.thumbAssetId != null
? getThumbnailUrlForRemoteId(sharedLink.thumbAssetId!)
: null;
final thumbnailUrl = sharedLink.thumbAssetId != null ? getThumbnailUrlForRemoteId(sharedLink.thumbAssetId!) : null;
final imageSize = math.min(context.width / 4, 100.0);
void copyShareLinkToClipboard() {
final externalDomain = ref.read(
serverInfoProvider.select((s) => s.serverConfig.externalDomain),
);
var serverUrl =
externalDomain.isNotEmpty ? externalDomain : getServerUrl();
var serverUrl = externalDomain.isNotEmpty ? externalDomain : getServerUrl();
if (serverUrl != null && !serverUrl.endsWith('/')) {
serverUrl += '/';
}
@ -116,9 +109,7 @@ class SharedLinkItem extends ConsumerWidget {
return ConfirmDialog(
title: "delete_shared_link_dialog_title",
content: "confirm_delete_shared_link",
onOk: () => ref
.read(sharedLinksStateProvider.notifier)
.deleteLink(sharedLink.id),
onOk: () => ref.read(sharedLinksStateProvider.notifier).deleteLink(sharedLink.id),
);
},
);
@ -181,8 +172,7 @@ class SharedLinkItem extends ConsumerWidget {
children: [
if (sharedLink.allowUpload) buildInfoChip("upload".tr()),
if (sharedLink.allowDownload) buildInfoChip("download".tr()),
if (sharedLink.showMetadata)
buildInfoChip("shared_link_info_chip_metadata".tr()),
if (sharedLink.showMetadata) buildInfoChip("shared_link_info_chip_metadata".tr()),
],
);
}
@ -197,8 +187,7 @@ class SharedLinkItem extends ConsumerWidget {
iconSize: actionIconSize,
icon: const Icon(Icons.delete_outline),
style: const ButtonStyle(
tapTargetSize:
MaterialTapTargetSize.shrinkWrap, // the '2023' part
tapTargetSize: MaterialTapTargetSize.shrinkWrap, // the '2023' part
),
onPressed: deleteShareLink,
),
@ -208,11 +197,9 @@ class SharedLinkItem extends ConsumerWidget {
iconSize: actionIconSize,
icon: const Icon(Icons.edit_outlined),
style: const ButtonStyle(
tapTargetSize:
MaterialTapTargetSize.shrinkWrap, // the '2023' part
tapTargetSize: MaterialTapTargetSize.shrinkWrap, // the '2023' part
),
onPressed: () => context
.pushRoute(SharedLinkEditRoute(existingLink: sharedLink)),
onPressed: () => context.pushRoute(SharedLinkEditRoute(existingLink: sharedLink)),
),
IconButton(
splashRadius: 25,
@ -220,8 +207,7 @@ class SharedLinkItem extends ConsumerWidget {
iconSize: actionIconSize,
icon: const Icon(Icons.copy_outlined),
style: const ButtonStyle(
tapTargetSize:
MaterialTapTargetSize.shrinkWrap, // the '2023' part
tapTargetSize: MaterialTapTargetSize.shrinkWrap, // the '2023' part
),
onPressed: copyShareLinkToClipboard,
),