cbl_flutter 1.0.0-beta.8 copy "cbl_flutter: ^1.0.0-beta.8" to clipboard
cbl_flutter: ^1.0.0-beta.8 copied to clipboard

outdated

Flutter Plugin for Couchbase Lite, an embedded, NoSQL JSON Document Style database, supporting Blobs, Encryption, N1QL Queries, Live Queries, Full-Text Search and Data Sync.

Version License CI codecov

This is the Flutter plugin for Couchbase Lite.

The Couchbase Lite API is in the cbl package. This package is enabling the use of cbl in Flutter apps.

This package is in beta. Use it with caution and report any issues you see.

🎯 Platform Support #

Platform Version Note
iOS >= 10.0
macOS >= 10.14
Android >= 22
Linux == Ubuntu 20.04-x86_64 🐛 Currently broken because of a bug in Flutter.
Most notably, operations trying to return an error crash the app.
Windows >= 10 🚧 Not yet implemented

🔌 Getting started #

  1. Add cbl and cbl_flutter as dependencies:
dependencies:
  cbl: ...
  cbl_flutter: ...
  1. Select the edition of Couchbase Lite you want to use, by adding as a dependency either cbl_flutter_ce for the Community Edition or cbl_flutter_ee for the Enterprise Edition:
  # This dependency selects the Couchbase Lite Community Edition.
  cbl_flutter_ce: ...

⚖️ You need to comply with the Couchbase licensing terms of the edition of Couchbase Lite you select.

  1. Make sure you have set the required minimum target version in the build systems of the platforms you support.

  2. Initialize Couchbase Lite, before using it:

import 'dart:io';

import 'package:cbl_flutter/cbl_flutter.dart';
import 'package:cbl_flutter_ce/cbl_flutter_ce.dart';

Future<void> initCouchbaseLite() async {
  // On mobile platforms, `CblFlutterCe` and `CblFlutterEe` currently need to
  // be registered manually. This is due to a temporary limitation in how Flutter
  // initializes plugins, and will become obsolete eventually.
  if (Platform.isIOS || Platform.isAndroid) {
    CblFlutterCe.registerWith();
  }
  await CouchbaseLiteFlutter.init();
}

Default database directory #

When opening a database without specifying a directory, path_provider's getApplicationSupportDirectory is used to resolve it. See that function's documentation for the concrete locations on the various platforms.

💡 Where to go next #

  • Check out the example app in the Example tab.
  • Look at the usage examples for cbl (go to the latest prerelease).

⚖️ Disclaimer #

⚠️ This is not an official Couchbase product.

44
likes
0
pub points
88%
popularity

Publisher

verified publishercbl-dart.dev

Flutter Plugin for Couchbase Lite, an embedded, NoSQL JSON Document Style database, supporting Blobs, Encryption, N1QL Queries, Live Queries, Full-Text Search and Data Sync.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cbl, cbl_flutter_platform_interface, flutter, path_provider

More

Packages that depend on cbl_flutter