realm_common 0.3.1+beta icon indicating copy to clipboard operation
realm_common: ^0.3.1+beta copied to clipboard

Hosts the common code shared between realm, realm_dart and realm_generator packages. This package is part of the official Realm Flutter and Realm Dart SDKs.

Realm

License

Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the Realm SDK for Flutter™ and Dart™.

This project is in the Alpha stage. All API's might change without warning and no guarantees are given about stability. Do not use it in production.

Getting Started #

To use the Realm SDK for Flutter add the realm package to your pubspec.yaml dependencies.

To use the Realm SDK for Dart add the realm_dart package to your pubspec.yaml dependencies.

  • Import Realm.

      import 'package:realm/realm.dart';
    
  • Define a data model class _Car.

      @RealmModel()
      class _Car {
        late String make;
    
        late String model;
    
        int? kilometers = 500;
      }
    
  • Generate RealmObject class Car from data model class _Car.

      dart run realm generate
    
  • Open a Realm and add some objects.

      var config = Configuration([Car.schema]);
      var realm = Realm(config);
    
      var car = Car("Telsa", "Model Y", kilometers: 5);
      realm.write(() {
        realm.add(car);
      }
    
  • Query objects in Realm.

      var cars = realm.all<Car>();
      Car myCar = cars[0];
      print("My car is ${myCar.make} model ${myCar.model}");
    
      cars = realm.all<Car>().query("make == 'Tesla'");
    

Documentation #

For API documentation go to

For a complete documentation go to Realm Flutter and Dart SDK Docs.

The "Dart" name and logo and the "Flutter" name and logo are trademarks owned by Google.
1
likes
110
pub points
41%
popularity

Publisher

verified publisher iconrealm.io

Hosts the common code shared between realm, realm_dart and realm_generator packages. This package is part of the official Realm Flutter and Realm Dart SDKs.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Icon for licenses.unknown (LICENSE)

Dependencies

objectid, sane_uuid

More

Packages that depend on realm_common