cloud_sync_hive_adapter 0.0.1-rc.1
cloud_sync_hive_adapter: ^0.0.1-rc.1 copied to clipboard
A Flutter plugin for integrating Hive sync functionality.
CloudSyncHiveAdapter #
A local implementation of the SyncAdapter
interface from the cloud_sync
package, using Hive for local storage. This adapter enables synchronization of notes and their associated metadata between your app and a local Hive database.
β¨ Features #
- Stores note metadata (
SyncMetadata
) and detail content (String
) using Hive. - Supports fetching and saving notes with metadata.
- Designed for local use within a sync system (e.g., to back Google Drive or other sync sources).
π¦ Installation #
Add dependencies in your pubspec.yaml
:
dependencies:
hive_ce:
cloud_sync:
cloud_sync_hive_adapter:
π Usage #
import 'package:hive_ce/hive.dart';
import 'package:cloud_sync/cloud_sync.dart';
void main() async {
final metadataBox = await Hive.openBox<SyncMetadata>('metadataBox');
final detailBox = await Hive.openBox<String>('detailBox');
final adapter = CloudSyncHiveAdapter(metadataBox, detailBox);
// Now you can use the adapter with a CloudSync
}
π Class Overview #
class CloudSyncHiveAdapter implements SyncAdapter<SyncMetadata, String>
metadataBox
: Hive box that storesSyncMetadata
.detailBox
: Hive box that stores note details asString
.
π License #
MIT (or your project's license).