# Dart & Flutter library to communicate with a Directus REST API

**URL:** https://community.directus.com/t/dart-flutter-library-to-communicate-with-a-directus-rest-api/333
**Category:** Showcase
**Tags:** flutter, dart
**Created:** [May 15, 2025, 8:52pm UTC](https://community.directus.com/t/dart-flutter-library-to-communicate-with-a-directus-rest-api/333 "2025-05-15T20:52:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![maxbritto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/maxbritto/32/306_2.png) [@maxbritto](https://community.directus.com/u/maxbritto)
#### Post date: [May 15, 2025, 8:52pm UTC](https://community.directus.com/t/dart-flutter-library-to-communicate-with-a-directus-rest-api/333/1 "2025-05-15T20:52:08Z")

</div>

I’ve created this lib to use internally on many Flutter project I was working on.  
But I’m also a Teacher at [https://www.purplegiraffe.fr/](https://www.purplegiraffe.fr/) where I teach about Flutter and Directus ; therefore many of my students were requesting help to communicate with their Directus instance.

I decided to open-source this lib and some of my students started to contribute nice features on it. Main features are :

- Authentication management with automatic token refresh and the possibility to save restore tokens,
- Create one class per collection en enjoy automatic parsing and url building,
- One `DirectusApiManager` class with most of the useful functions,
- Support for CRUD over each collection,
- Support for websockets,
- Local caching engine to limit the number of request to the directus instance,
- Helper classes for filters and sort properties,
- Support for File uploads,
- Automated tests,

What should be improved :

- Documentation should be enough to get started but advanced features needs more love on that part,

Sources : [GitHub - maxbritto/directus\_api\_manager: Dart & Flutter library to communicate with a Directus REST API](https://github.com/maxbritto/directus_api_manager)

I hope you’ll find it useful.  
Happy Coding!

---

<div class="post-metadata">

### Author: ![ymys](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/ymys/32/190_2.png) [@ymys](https://community.directus.com/u/ymys)
#### Post date: [June 10, 2025, 7:45am UTC](https://community.directus.com/t/dart-flutter-library-to-communicate-with-a-directus-rest-api/333/2 "2025-06-10T07:45:03Z")

</div>

Have you read this? [Fetch Data From Directus with Flutter | Directus Docs](https://docs.directus.io/blog/getting-started-with-directus-and-flutter.html)

Personally, I use Flutterflow and Directus.

---

<div class="post-metadata">

### Author: ![maxbritto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/maxbritto/32/306_2.png) [@maxbritto](https://community.directus.com/u/maxbritto)
#### Post date: [June 10, 2025, 3:56pm UTC](https://community.directus.com/t/dart-flutter-library-to-communicate-with-a-directus-rest-api/333/3 "2025-06-10T15:56:21Z")

</div>

Thanks for the link!  
This tutorial is really basic and mostly is a Flutter beginner tutorial on how to call an API.  
All the complicated parts of the Directus API are not in this tutorial : authentification, refreshing of tokens after a certain times, use of filters, etc.  
The tutorial probably uses an all public collection for demo purposes but this not what would be used in production.  
This lib I’ve shared manages all of this and beyond (caching, json parsing, smart updating, etc.)
