objectbox_sync_flutter_libs 6.0.0-preview.0 copy "objectbox_sync_flutter_libs: ^6.0.0-preview.0" to clipboard
objectbox_sync_flutter_libs: ^6.0.0-preview.0 copied to clipboard

Fast Flutter database for persisting Dart objects. This package contains Flutter runtime libraries for ObjectBox, including ObjectBox Sync.

ObjectBox database (with Sync) libraries for Flutter #

pub package

This package provides the native ObjectBox database library, with the Sync client included, as a Flutter plugin for supported platforms. Check the Sync docs for more details. You should add this package as a dependency when using ObjectBox with Flutter.

Configure the mesh Sync like this:

import 'package:objectbox/objectbox.dart';
import 'package:objectbox_sync_flutter_libs/objectbox_sync_flutter_libs.dart'
    show createMeshConfig;

final mesh = await createMeshConfig('mesh-id');
final client = SyncClient(store, urls, credentials, mesh: mesh);

On Android, apps using Mesh Sync must declare the permissions required by the Nearby transport in android/app/src/main/AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
    <uses-permission
        android:name="android.permission.BLUETOOTH_SCAN"
        android:usesPermissionFlags="neverForLocation" />
    <uses-permission
        android:name="android.permission.NEARBY_WIFI_DEVICES"
        android:usesPermissionFlags="neverForLocation" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application>
        ...
    </application>
</manifest>

By default, createMeshConfig() requests missing runtime permissions while creating the mesh network. If your app handles these runtime permissions itself, pass requestPermissions: false:

final mesh = await createMeshConfig(
  'mesh-id',
  androidRequestPermissions: false,
);

See package objectbox for more details and information how to use it.

12
likes
0
points
3.93k
downloads

Publisher

verified publisherobjectbox.io

Weekly Downloads

Fast Flutter database for persisting Dart objects. This package contains Flutter runtime libraries for ObjectBox, including ObjectBox Sync.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, objectbox, path_provider

More

Packages that depend on objectbox_sync_flutter_libs

Packages that implement objectbox_sync_flutter_libs