1
0
Fork 0
forked from Nexus/nexus

treewide: use dot shorthands where possible

Now this feature is stable, we should use it. I might have missed some usecases, but these can be added in future commits.
This commit is contained in:
Henry Hiles 2026-06-02 11:53:14 -04:00
commit d2ec5f035b
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
67 changed files with 391 additions and 534 deletions

View file

@ -13,25 +13,24 @@ class UrlPreview extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) => ConstrainedBox(
constraints: BoxConstraints.loose(Size.fromWidth(400)),
constraints: .loose(.fromWidth(400)),
child: ref
.watch(UrlPreviewController.provider(link))
.betterWhen(
data: (preview) => preview == null
? SizedBox.shrink()
: InkWell(
onTap: () => ref
.watch(LaunchHelper.provider)
.launchUrl(Uri.parse(link)),
onTap: () =>
ref.watch(LaunchHelper.provider).launchUrl(.parse(link)),
child: Card(
margin: EdgeInsets.symmetric(vertical: 4),
margin: .symmetric(vertical: 4),
color: Theme.of(
context,
).colorScheme.surfaceContainerHighest,
child: Padding(
padding: EdgeInsetsGeometry.all(16),
padding: .all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: .start,
spacing: 4,
children: [
if (preview.title != null)
@ -45,9 +44,7 @@ class UrlPreview extends ConsumerWidget {
],
if (preview.imageUrl != null)
ClipRRect(
borderRadius: BorderRadius.all(
Radius.circular(8),
),
borderRadius: .all(.circular(8)),
child: Image(
errorBuilder: (_, _, _) => SizedBox.shrink(),
width: preview.width,
@ -56,7 +53,7 @@ class UrlPreview extends ConsumerWidget {
ref.watch(CrossCacheController.provider),
headers: ref.headers,
),
fit: BoxFit.fitWidth,
fit: .fitWidth,
),
),
],