A todo list application built with the Atlas Device SDK for Flutter and Atlas Device Sync.
TIP: Follow along with the Flutter Tutorial to see how to build, modify, and run this template app.
[!WARNING] As of September 2024, Atlas Device SDKs are deprecated. Atlas Device SDKs will reach end-of-life and will no longer be maintained by MongoDB on September 30, 2025.
The template app in this repository should only be used as a reference for the on-device database and not to create a new app based on Device Sync. Refer to the deprecation page for details.
You can get started with this template app in two ways:
The easiest way to work with this template app is to create a new App Services App based on this Flutter template. The app is configured to run this client as a Real-Time Sync demo and comes pre-populated with the correct values for your app.
To create an App from the UI:
To create an App from the CLI:
appservices login --api-key="<YOUR-API-KEY>" --private-api-key="<YOUR-PRIVATE-API-KEY>"
appservices apps create --template flutter.todo.flex -n "<YOUR-APP-NAME>"
cd "<YOUR-APP-NAME>"/frontend/flutter.todo.flex
You're all set with a pre-configured app that's ready to run!
If you choose to clone this project from GitHub, you can use it with an existing App Services App or you can create a new one. The only requirement is that your app has Device Sync enabled.
Open your /assets/config/atlasConfig.json
file. It should contain the
following:
YOUR-APP-ID-123XYZ
.https://services.cloud.mongodb.com
in most cases.https://cloud.mongodb.com/links/<YOUR-ATLAS-PROJECT-ID>/explorer/<YOUR-CLUSTER-NAME>/database/collection/find
.Update with the values for your app:
Cluster0
.flutter pub get
flutter run
flutter run
.flutter devices
, andflutter run -d <device-id>
For more information on running a Flutter app, refer to the Flutter Test Drive documentation.
Once you're up and running, you can get started building on this template.
Or you can follow along with the Flutter Tutorial to learn how to build on top of this template app.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'String'
This error occurs if the dataExplorerLink
field in your
/assets/config/atlasConfig.json
is invalid.
To resolve it, ensure the dataExplorerLink
field is populated with the correct
project ID and cluster name values.
NOTE: If you used the Flutter template app, then this field should have been pre-populated with the correct URL.
Please report issues with the template at https://github.com/mongodb-university/realm-template-apps/issues/new.
For more information on this and the other available Atlas Device SDK template apps, check out the App Services Template App documentation.
Learn more about developing with the Flutter SDK with the Atlas Device SDK and API docs.
Check out some example Flutter and Dart apps built using the Flutter SDK in the realm-dart-samples GitHub repo.