Docs Menu

Data Types - Flutter SDK

On this page

  • Dart Types
  • Reference Realm Objects
  • Example

The Flutter SDK currently only supports Dart-language data types. The Flutter SDK does not support MongoDB.BSON types or Realm-specific types at the moment.

Realm supports the following Dart language data types:

  • int
  • double
  • bool
  • String
  • List<T>, where T is any of the supported data types or a RealmModel

You can also reference one or more Realm objects from another. Learn more in the relationship properties documentation.

Example
Model with supported data types
part 'car.g.dart';
@RealmModel()
class _Car {
@PrimaryKey()
late int id;
String? licensePlate;
bool isElectric = false;
double milesDriven = 0;
late List<String> attributes;
late _Person? owner;
}
@RealmModel()
class _Person {
@PrimaryKey()
late int id;
late String name;
late int age;
}
←  Query Language - Flutter SDKRealm Studio →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.