local_storage_cache_platform_interface 2.0.0
local_storage_cache_platform_interface: ^2.0.0 copied to clipboard
A common platform interface for the local_storage_cache plugin.
local_storage_cache_platform_interface #
Platform interface for the local_storage_cache plugin.
This package defines the common interface that all platform implementations must implement. It is not intended to be used directly by end users.
Overview #
This package provides the interface that all platform-specific implementations of local_storage_cache must implement. It ensures consistency across all platforms and enables the federated plugin architecture.
Usage #
This package is used internally by:
local_storage_cache- The main plugin packagelocal_storage_cache_android- Android implementationlocal_storage_cache_ios- iOS implementationlocal_storage_cache_macos- macOS implementationlocal_storage_cache_windows- Windows implementationlocal_storage_cache_linux- Linux implementationlocal_storage_cache_web- Web implementation
For end-user documentation and usage examples, please refer to the main local_storage_cache package documentation.
For Plugin Developers #
To implement a new platform:
- Add this package as a dependency:
dependencies:
local_storage_cache_platform_interface: ^2.0.0
- Extend
LocalStorageCachePlatform:
class MyPlatformImplementation extends LocalStorageCachePlatform {
static void registerWith() {
LocalStorageCachePlatform.instance = MyPlatformImplementation();
}
@override
Future<void> initialize(String databasePath, Map<String, dynamic> config) async {
// Your implementation
}
// Implement all other required methods...
}
- Register your implementation in your plugin's main file
Interface Methods #
The platform interface defines methods for:
- Database initialization and management
- CRUD operations (insert, query, update, delete)
- Transaction support
- Batch operations
- Encryption and decryption
- Secure key storage
- Biometric authentication
- Database import/export
- Storage information retrieval
License #
MIT License - see LICENSE file for details.