isar_sync_flutter 0.1.0-dev.3
isar_sync_flutter: ^0.1.0-dev.3 copied to clipboard
Flutter companion for isar_sync: wire Google Sign-In (Drive) and the icloud_storage plugin into isar_sync's cloud sync adapters.
isar_sync_flutter #
Flutter companion package for isar_sync.
It provides direct integrations for:
- Google Sign-In -> Google Drive appData sync adapter
- iCloud plugin (
icloud_storage) -> isar_sync iCloud adapter client
Install #
dependencies:
isar_sync: ^0.1.0-dev.3
isar_sync_flutter: ^0.1.0-dev.3
Google Sign-In -> Drive Adapter #
import 'package:isar_sync/isar_sync.dart';
import 'package:isar_sync_flutter/isar_sync_flutter.dart';
final driveAuth = GoogleSignInDriveAuth();
await driveAuth.initialize();
final session = await driveAuth.authenticateAndCreateAdapter(
namespace: 'my-app-prod',
);
final token = session.accessToken; // Bearer token value
final adapter = session.adapter;
final core = SyncCore(
queue: queue,
adapter: adapter,
applyEngine: applyEngine,
cursorStore: cursorStore,
);
await core.syncOnce();
iCloud Plugin -> ICloudSyncAdapter #
import 'package:isar_sync/isar_sync.dart';
import 'package:isar_sync_flutter/isar_sync_flutter.dart';
final icloudClient = await ICloudStorageSyncClient.fromTemporaryDirectory(
containerId: 'iCloud.com.example.myapp',
);
final adapter = ICloudSyncAdapter(
client: icloudClient,
namespace: 'my-app-prod',
);
Example App #
See example app for end-to-end bidirectional demo:
-
Google Sign-In token + Drive sync
-
iCloud sync tab (iOS/macOS)
Run it:
cd example
flutter pub get
flutter run
Notes #
- Google Drive API OAuth setup is required for production apps.
- iCloud requires iCloud capability and container configuration in Xcode.
Platform Checklist Automation #
Run automated platform setup checks: