fix dart analyze bracket error.

This commit is contained in:
ericz committed 2026-08-11 19:26:41 +02:00
commit 1dbb487fe7
151 files changed
+31087 -1149

No files matched your search

+52
View File
@@ -1,6 +1,7 @@
import 'dart:convert';
import 'package:flutter/foundation.dart';
import '../models/app_settings.dart';
import '../models/image_codec_support.dart';
import '../models/translation_support.dart';
import '../storage/prefs_manager.dart';
import '../utils/app_logger.dart';
@@ -286,6 +287,57 @@ class AppSettingsService extends ChangeNotifier {
await updateSettings(_settings.copyWith(jumpToOldestUnread: value));
}
Future<void> setImageMessagesEnabled(bool value) async {
await updateSettings(_settings.copyWith(imageMessagesEnabled: value));
}
/// See [AppSettings.imageProcessAutomatically]. `main.dart` mirrors this into
/// `ReceivedImageStore.processAutomatically` on every settings change; the
/// store applies it to future arrivals only, so flipping it does not
/// retroactively decode a backlog.
Future<void> setImageProcessAutomatically(bool value) async {
await updateSettings(_settings.copyWith(imageProcessAutomatically: value));
}
// ---- neural image codec (AEIC-SE) ---------------------------------------
Future<void> setImageCodecEnabled(bool value) async {
await updateSettings(_settings.copyWith(imageCodecEnabled: value));
}
Future<void> setImageCodecSelectedModelId(String? value) async {
await updateSettings(_settings.copyWith(imageCodecSelectedModelId: value));
}
Future<void> setImageCodecModelSourceUrl(String? value) async {
await updateSettings(_settings.copyWith(imageCodecModelSourceUrl: value));
}
/// [value] is an [AeicRatePoint.wireValue], not an enum index.
Future<void> setImageCodecRatePoint(int value) async {
await updateSettings(_settings.copyWith(imageCodecRatePoint: value));
}
Future<void> setImageCodecDownloadedModels(
List<ImageCodecModelRecord> value,
) async {
await updateSettings(_settings.copyWith(imageCodecDownloadedModels: value));
}
/// Writes the whole block in one persist, which is what
/// `ImageCodecService` does on every preference change.
Future<void> setImageCodecPreferences(ImageCodecPreferences value) async {
await updateSettings(
_settings.copyWith(
imageCodecEnabled: value.enabled,
imageCodecSelectedModelId: value.selectedModelId,
imageCodecModelSourceUrl: value.modelSourceUrl,
imageCodecRatePoint: value.ratePoint,
imageCodecDownloadedModels: value.downloadedModels,
),
);
}
Future<void> setTranslationEnabled(bool value) async {
await updateSettings(_settings.copyWith(translationEnabled: value));
}