From ec07b7150b16b07be6dbb5f615a620c1529636ae Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Tue, 6 Dec 2022 23:14:19 +0530 Subject: [PATCH] Add configuration to store album grid size --- lib/core/configuration.dart | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/core/configuration.dart b/lib/core/configuration.dart index 8917842f6..6c4f6eb3d 100644 --- a/lib/core/configuration.dart +++ b/lib/core/configuration.dart @@ -59,6 +59,8 @@ class Configuration { static const keyAttributesKey = "key_attributes"; static const keyKey = "key"; static const keyShouldBackupOverMobileData = "should_backup_over_mobile_data"; + static const keyAlbumGridSize = "album_grid_size"; + static const defaultAlbumGridSize = 4; static const keyShouldBackupVideos = "should_backup_videos"; // 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 setAlbumGridSize(int value) async { + await _preferences.setInt(keyAlbumGridSize, value); + } + Future setBackupOverMobileData(bool value) async { await _preferences.setBool(keyShouldBackupOverMobileData, value); if (value) {