mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-12 00:40:28 +00:00
Add voice image packet retry
This commit is contained in:
@@ -5,9 +5,11 @@ class ImagePreferences {
|
||||
static const String _maxSizeKey = 'image_max_size';
|
||||
// Keep the legacy key name so existing users retain their saved value.
|
||||
static const String _qualityKey = 'image_quality';
|
||||
static const String _grayscaleKey = 'image_grayscale';
|
||||
|
||||
static const int defaultMaxSize = 256;
|
||||
static const int defaultQuality = 90;
|
||||
static const bool defaultGrayscale = true;
|
||||
|
||||
static const List<int> supportedSizes = [64, 128, 256];
|
||||
|
||||
@@ -32,4 +34,14 @@ class ImagePreferences {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setInt(_qualityKey, compression.clamp(10, 90));
|
||||
}
|
||||
|
||||
static Future<bool> getGrayscale() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
return prefs.getBool(_grayscaleKey) ?? defaultGrayscale;
|
||||
}
|
||||
|
||||
static Future<void> setGrayscale(bool value) async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setBool(_grayscaleKey, value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user