refactor: Update to Dart 3.10 with . shorthands

This commit is contained in:
Christian Kußowski 2025-11-30 12:54:06 +01:00
commit 1ea649f01e
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
167 changed files with 3351 additions and 3912 deletions

View file

@ -38,15 +38,17 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
final filteredImagePackImageEntried = pack.images.entries.toList();
if (searchFilter?.isNotEmpty ?? false) {
filteredImagePackImageEntried.removeWhere(
(e) => !(e.key.toLowerCase().contains(searchFilter!.toLowerCase()) ||
(e.value.body
?.toLowerCase()
.contains(searchFilter!.toLowerCase()) ??
false)),
(e) =>
!(e.key.toLowerCase().contains(searchFilter!.toLowerCase()) ||
(e.value.body?.toLowerCase().contains(
searchFilter!.toLowerCase(),
) ??
false)),
);
}
final imageKeys =
filteredImagePackImageEntried.map((e) => e.key).toList();
final imageKeys = filteredImagePackImageEntried
.map((e) => e.key)
.toList();
if (imageKeys.isEmpty) {
return const SizedBox.shrink();
}
@ -82,8 +84,9 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
key: ValueKey(image.url.toString()),
onTap: () {
// copy the image
final imageCopy =
ImagePackImageContent.fromJson(image.toJson().copy());
final imageCopy = ImagePackImageContent.fromJson(
image.toJson().copy(),
);
// set the body, if it doesn't exist, to the key
imageCopy.body ??= imageKeys[imageIndex];
widget.onSelected(imageCopy);
@ -137,7 +140,7 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
SliverFillRemaining(
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisSize: .min,
children: [
Text(L10n.of(context).noEmotesFound),
const SizedBox(height: 12),