isar_sync_flutter 0.1.0-dev.3 copy "isar_sync_flutter: ^0.1.0-dev.3" to clipboard
isar_sync_flutter: ^0.1.0-dev.3 copied to clipboard

PlatformiOSmacOS

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:

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:

0
likes
160
points
10
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Flutter companion for isar_sync: wire Google Sign-In (Drive) and the icloud_storage plugin into isar_sync's cloud sync adapters.

Repository (GitHub)
View/report issues
Contributing

Topics

#isar #sync #offline-first #google-sign-in #icloud

License

MIT (license)

Dependencies

flutter, google_sign_in, googleapis, http, icloud_storage, isar_sync, path, path_provider

More

Packages that depend on isar_sync_flutter