APIKeySharedPref class
APIKeySharedPref
to presist data in the app locally
A utility class for managing and persisting API keys session data locally using shared_preferences
.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
addApiKey(
ApiKeyModel newApiKey) → Future< void> - Add a single API key to the session
-
clearApiKeys(
) → Future< void> - Clear all API keys from the session
-
editApiKey(
String name, String newKey, String serviceType) → Future< void> - Edit a single API key in the session
-
getApiKeys(
) → Future< List< ApiKeyModel> > - Retrieve API keys for the API session
-
getDefaultApiKey(
String serviceType) → Future< ApiKeyModel?> - Retrieve the default API key for a specific service type
-
init(
) → Future< void> - Initializes the SharedPreferences instance for local data storage.
-
removeApiKey(
String name, String serviceType) → Future< void> - Remove a single API key from the session
-
saveApiKeys(
List< ApiKeyModel> apiKeys) → Future<void> - Save API keys for the API session
-
saveDefaultApiKey(
String serviceType, String keyName) → Future< void> - Save the default API key for a specific service type