import 'package:shared_preferences/shared_preferences.dart'; class SettingsService { final Future _prefs = SharedPreferences.getInstance(); void setStringSetting(String settingKey, String settingValue) => _prefs.then((pref) => pref.setString(settingKey, settingValue)); Future getStringSetting(String settingKey) => _prefs.then((pref) => pref.getString(settingKey)); void setIntSetting(String settingKey, int settingValue) => _prefs.then((pref) => pref.setInt(settingKey, settingValue)); Future getIntSetting(String settingKey) => _prefs.then((pref) => pref.getInt(settingKey)); //Add other setters and getters if needed //other possible SharedPreferences Types: Int, Bool, Double, StringList //see https://pub.dev/packages/shared_preferences }