RxDB Flutter example
This is an example of how to use RxDB as a database inside of a Flutter application. It is able to insert documents and run and observe queries to create a reactive application that always renders the current database state.
IMPORTANT: This is highly experimental, it works but many parts are missing. If you need any missing functionality, you are expected to make a pull request.
How it works technically
Use the index.js as a reference.
.js file. In this example we do that with
webpack in a npm script here which bundles everything into the
To allow Flutter to access that file during runtime, add it to the
assets inside of your pubspec.yaml:
First you have to use the rxdb dart package as a flutter dependency. Currently the package is not published at the dart pub.dev. Instead you have to install it from the local filesystem inside of your RxDB npm installation.
# inside of pubspec.yaml dependencies: rxdb: path: path/to/your/node_modules/rxdb/src/plugins/flutter/dart
Run the example
- In your terminal, execute
flutter runto start the example application.