Files
finlog/finlog_app/fluttery/lib/preferences/preferences.dart

41 lines
1.4 KiB
Dart

import 'package:fluttery/fluttery.dart';
/// providing methods for managing persistent storage of key-value pairs.
abstract class Preferences implements Service {
/// Stores a string value with the given [key].
Future<void> setString(String key, String value);
/// Retrieves the string value associated with the given [key].
Future<String?> getString(String key);
/// Stores an integer value with the given [key].
Future<void> setInt(String key, int value);
/// Retrieves the integer value associated with the given [key].
Future<int?> getInt(String key);
/// Stores a boolean value with the given [key].
Future<void> setBool(String key, bool value);
/// Retrieves the boolean value associated with the given [key].
Future<bool?> getBool(String key);
/// Stores a double value with the given [key].
Future<void> setDouble(String key, double value);
/// Retrieves the double value associated with the given [key].
Future<double?> getDouble(String key);
/// Stores a list of strings with the given [key].
Future<void> setStringList(String key, List<String> value);
/// Retrieves the list of strings associated with the given [key].
Future<List<String>?> getStringList(String key);
/// Removes the key-value pair associated with the given [key].
Future<void> remove(String key);
/// Clears all key-value pairs in the preferences.
Future<void> clear();
}