storeFilter static method
Stores the filter settings in shared preferences
Implementation
static Future<void> storeFilter(
int rangePhotosValuesStart,
int rangePhotosValuesEnd,
DateTime startDate,
DateTime endDate,
List<String> cameras) async {
// Getting an instance of SharedPreferences
SharedPreferences prefs = await SharedPreferences.getInstance();
// Storing the starting range of photo values
prefs.setInt('rangePhotosValuesStart', rangePhotosValuesStart);
// Storing the ending range of photo values
prefs.setInt('rangePhotosValuesEnd', rangePhotosValuesEnd);
// Storing the start date
prefs.setString('startDate', startDate.toIso8601String());
// Storing the end date
prefs.setString('endDate', endDate.toIso8601String());
// Storing the list of selected cameras
prefs.setStringList('cameras', cameras);
}