flutter_realm 0.2.2

Codemagic build status

flutter_realm #

A Flutter plugin to use Realm Database.

Note: This plugin is still under development, and some APIs might not be available yet. Feedback and Pull Requests are most welcome!

Important #

Current implementation requires definition of schema in native Java and ObjC host apps.

Getting Started #

See the example directory for a complete sample app using Realm Database.

Setup #

Features #

  • [x] Persistent and In-memory Realm
  • [x] deleteAllObjects
  • [x] Get allObjects by classname
  • [x] Create object
  • [x] Delete object
  • [x] Update object
  • [x] Query with >, >=, <, <=, =, != and contains operators on fields
  • [x] Subscribe on queries and allObjects
  • [x] Fields with array of String and int
  • [x] Realm Sync
  • [x] JWT and Username&Password authorization

0.2.2 #

  • Fix currentUser null mapping.

0.2.1 #

  • Fix dependency on meta.

0.2.0 #

  • Breaking changes: replace Realm.initialize with Realm.open.
  • Breaking changes: remove Realm prefix in class names.
  • Add support multiple Realms.
  • Add support the Realm Sync.
  • Add Username&Password and JWT authorization.
  • Introduce SyncUser.

0.1.0 #

  • Breaking changes: update dependencies to uuid 2.0.1
  • Add subscriptions.
  • Add contain operator in queries.

0.0.1 #

  • Initial release.

example/README.md

Example #

  • Run integration tests for database with flutter driver --target=test_driver/realm_database.dart.
  • Run integration tests for Realm Sync with INSTANCE_LINK=<your_instance_host> flutter driver --target=test_driver/realm_sync.dart.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_realm: ^0.2.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_realm/flutter_realm.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
59
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

We analyzed this package on Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-0.48 points)

56 out of 57 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (meta).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
meta ^1.1.0 1.1.6 1.1.7
rxdart ^0.22.0 0.22.1+1
uuid ^2.0.1 2.0.2
Transitive dependencies
charcode 1.1.2
collection 1.14.11 1.14.12
convert 2.1.1
crypto 2.1.2
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test