StorageInterface class abstract

Abstract interface for storage operations.

This interface defines the contract for storing and retrieving authentication-related data. Implement this interface to provide custom storage solutions.

Example Implementation

class MyStorage implements StorageInterface {
  final _storage = <String, String>{};

  @override
  Future<String?> read(String key) async => _storage[key];

  @override
  Future<void> write(String key, String value) async => _storage[key] = value;

  @override
  Future<void> delete(String key) async => _storage.remove(key);

  @override
  Future<bool> containsKey(String key) async => _storage.containsKey(key);
}

See also:

  • SecureStorageImpl for the default implementation
Implementers

Constructors

StorageInterface()

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

containsKey(String key) Future<bool>
Checks if a key exists.
delete(String key) Future<void>
Deletes a value from storage.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String key) Future<String?>
Reads a value from storage.
toString() String
A string representation of this object.
inherited
write(String key, String value) Future<void>
Writes a value to storage.

Operators

operator ==(Object other) bool
The equality operator.
inherited