Add configuration to store album grid size
This commit is contained in:
parent
3b28725458
commit
ec07b7150b
|
@ -59,6 +59,8 @@ class Configuration {
|
||||||
static const keyAttributesKey = "key_attributes";
|
static const keyAttributesKey = "key_attributes";
|
||||||
static const keyKey = "key";
|
static const keyKey = "key";
|
||||||
static const keyShouldBackupOverMobileData = "should_backup_over_mobile_data";
|
static const keyShouldBackupOverMobileData = "should_backup_over_mobile_data";
|
||||||
|
static const keyAlbumGridSize = "album_grid_size";
|
||||||
|
static const defaultAlbumGridSize = 4;
|
||||||
static const keyShouldBackupVideos = "should_backup_videos";
|
static const keyShouldBackupVideos = "should_backup_videos";
|
||||||
|
|
||||||
// keyShouldKeepDeviceAwake is used to determine whether the device screen
|
// keyShouldKeepDeviceAwake is used to determine whether the device screen
|
||||||
|
@ -534,6 +536,18 @@ class Configuration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getAlbumGridSize() {
|
||||||
|
if (_preferences.containsKey(keyAlbumGridSize)) {
|
||||||
|
return _preferences.getInt(keyAlbumGridSize)!;
|
||||||
|
} else {
|
||||||
|
return defaultAlbumGridSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> setAlbumGridSize(int value) async {
|
||||||
|
await _preferences.setInt(keyAlbumGridSize, value);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> setBackupOverMobileData(bool value) async {
|
Future<void> setBackupOverMobileData(bool value) async {
|
||||||
await _preferences.setBool(keyShouldBackupOverMobileData, value);
|
await _preferences.setBool(keyShouldBackupOverMobileData, value);
|
||||||
if (value) {
|
if (value) {
|
||||||
|
|
Loading…
Reference in a new issue