Docs Menu
Docs Home
/ /
Atlas Device SDKs
/
/

Install Atlas Device SDK for Flutter

On this page

  • Requirements
  • Supported Platforms
  • Install the SDK
  • Create a Project
  • Add the SDK to the Project
  • Update the Package Version
  • Update the pubspec.yaml File
  • Install the Updated Package
  • Regenerate Object Models
  • Import the SDK
  • Platform-Specific Considerations
  • Apple Privacy Manifest

Use Atlas Device SDK in a Flutter project to build cross-platform applications with Flutter and Dart. This guide provides instructions for installing the SDK in a Flutter project. For details about installing the SDK in a standalone Dart project, refer to Install Atlas Device SDK.

Install Flutter with Dart in your development environment. The Flutter installation includes Dart. To learn how, refer to the official Flutter Installation Guide.

When building a project with Flutter, the SDK requires the following minimum versions:

  • Flutter version 3.19.0 or later.

  • Dart version 3.3.0 or later.

When using the SDK in a Flutter or standalone Dart project, you can build for the following platforms:

  • iOS

  • Android

  • macOS

  • Windows running on 64-bit architecture

  • Linux running on 64-bit architecture

Important

Unsupported Platforms

The SDK does not currently support the following platforms through the Dart or Flutter libraries:

  • Web

  • Windows running on ARM64 or 32-bit architectures

  • Linux running on ARM64 or 32-bit architectures

Visit the respective "Build for Platforms" page for more details about library and language support:

1

To create a Flutter project, run the following commands:

flutter create <app_name>
cd <app_name>

For more information, refer to Flutter's Get Started Guide.

2

To add the Flutter SDK to your project, run the following command:

flutter pub add realm

This downloads the realm package, and adds it to your project.

In your pubspec.yaml file, you should see:

pubspec.yaml
dependencies:
realm: <latest_version>

Note

Using Networking in your macOS App

If you are developing with Flutter in the macOS App Sandbox and require network access, you must enable network entitlements in your app. By default, network requests are not allowed due to built-in macOS security settings.

To learn how to change your app's macOS entitlements, refer to Device Sync and App Sandbox Entitlements.

To change the version of the SDK in your project, perform the following steps:

1

Update the package version in your pubspec.yaml file dependencies.

pubspec.yaml
dependencies:
realm: <updated_version>
2

From the command line, run the following command to install the updated version:

dart pub upgrade realm

Then, run the following command to install the updated SDK's native binaries:

dart run realm install
3

Changes to the package version may affect the functionality of the object models. From the command line, run the following command to regenerate object models with new and updated functionality:

dart run realm generate

Important

SDK v2.0.0 Breaking Change to Generated Files

SDK version 2.0.0 introduces an update to the builder, which impacts how files generate. In v2.0.0 and later, all generated files use the .realm.dart naming convention instead of .g.dart.

This is a breaking change for existing apps. For information on how to upgrade an existing app from an earlier SDK version to v2.0.0 or later, refer to Upgrade to Flutter SDK v2.0.0.

To use the SDK in your app, import the package into any files that use it:

ExampleFile.dart
import 'package:realm/realm.dart';

When building for Apple platforms, Apple requires any apps or third-party SDKs that use required reasons APIs to provide a privacy manifest. The manifest contains details about the app's or SDK's data collection and use practices, and it must be included when submitting new apps or app updates to the Apple App Store.

Some of the SDK language and framework libraries provide a privacy manifest to streamline this process. Starting in version 2.2.0, the Dart and Flutter libraries provide a privacy manifest.

For details, refer to The Atlas Device SDK Apple Privacy Manifest.

← 
 →