Connect to Atlas with Dart/Flutter app

I setup my first Atlas Cluster, but alas I don’t have a Dart/Flutter api option.
Of course I have no problems with Dart/Flutter on our internal server(s), but my first Atlas project just threw me a curve.

@Nat_Gross Are you looking for a server side or client side Dart binding?

In order not to confuse terminology, because Mongodb Dart pkg is a server side library that clients use to connect, here is a simple line I use to connect from Android devices:

Db db = new Db("mongodb://localhost:27017/whatever");

So, if Atlas replaces my localhost, how do I connect to it?


Hi Nat,

Welcome to the MongoDB Community!

There is currently no Officially Supported Driver for Dart/Flutter.

The mongo-dart driver is community-supported but unfortunately it does not appear to be actively maintained or overly feature complete. From a quick review of the driver documentation, I don’t see mention of support for TLS/SSL (which is required for Atlas) or SNI extension support in particular (which is required for connecting to Atlas free/shared tier deployments). It’s also not clear what versions of MongoDB server the mongo_dart driver supports.

I found an open pull request for adding TLS/SSL support as well as discussion around supporting the mongodb+srv connection string format. My takeaway is that mongo-dart currently isn’t a recommendable solution for working with modern MongoDB deployments, as these are more basic connectivity requirements. Official drivers are tested against a more comprehensive set of MongoDB specifications so expected behaviour can be rationalised.

I suggest looking into MongoDB Stitch and considering the GraphQL API as an alternative starting point with Dart/Flutter support.


I guess my Atlas aspirations will wait until an official Dart/Flutter driver is released.

A post was split to a new topic: With the graphql Api will we need to have an external server for authentication or notifications?

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.