Need help with flutter_data?
Click the β€œchat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

179 Stars 13 Forks MIT License 517 Commits 8 Opened issues


Seamlessly manage persistent data in your Flutter apps

Services available


Need anything else?

Contributors list

Flutter Data

tests codecov license

Persistent reactive models in Flutter with zero boilerplate

Flutter Data is an offline-first persistence framework that gives you a configurable REST client and powerful model relationships.

Heavily inspired by Ember Data and ActiveRecord


  • Repositories for all models πŸš€
  • Built for offline-first πŸ”Œ
    • Hive-based local storage at its core
    • Failure handling & retry API
  • Intuitive APIs, effortless setup πŸ’™
    • Truly configurable and composable via Dart mixins and codegen
    • Built-in Riverpod providers for all models
  • Exceptional relationship support ⚑️
    • Automatically synchronized, fully traversable relationship graph
    • Reactive relationships

Check out the Documentation or the Tutorial πŸ“š where we build a TO-DO app from the ground up in record time.

Set up

See the quickstart guide for setup and boot configuration.

Prefer an example? Here's the Flutter Data sample setup app with support for Riverpod, Provider and get_it.

πŸ‘©πŸΎβ€πŸ’» Usage

For a given

model annotated with
class User with DataModel {
  final int? id; // ID can be of any type
  final String name;
  User({, required});
  // `User.fromJson` and `toJson` optional

mixin MyJSONServerAdapter on RemoteAdapter { @override String get baseUrl => ""; }

After a code-gen build, Flutter Data will generate a

and utilities such as
Widget build(BuildContext context) {
  final state = useProvider(watchUser(1));
  if (state.isLoading) {
    return Center(child: const CircularProgressIndicator());
  final user = state.model;
  return Text(;

is a shortcut to

Let's see how to update the user:

  onTap: () => 1, name: 'Updated')),
  child: Text('Update'),

will make an HTTP request (to
in this case), parse the incoming JSON and listen for any further changes to the
– whether those are local or remote!

is of type
which has loading, error and data substates. Moreover, the
notifier has a
function available, useful for the classic "pull-to-refresh" scenario.

In addition to the reactivity,

s get extensions and automatic relationships, ActiveRecord-style, so the above becomes:
  onTap: () =>
      User(id: 1, name: 'Updated').init(,
  child: Text('Update')

Some other examples:

final todo = await Todo(title: 'Finish docs').init(;
print(; // 201

final user = await repository.findOne(1, params: { '_embed': 'todos' }); // GET print(user.todos.length); // 20

await user.todos.last.delete();

For an in-depth example check out the Tutorial.

Fully functional app built with Flutter Data? See the code for the finished Flutter Data TO-DOs Sample App.


Fully compatible with the tools we know and love:

Flutter βœ… And pure Dart, too.
Flutter Web βœ… Supported!
json_serializable βœ… Fully supported (but not required)
Riverpod βœ… Supported & automatically wired up
Provider βœ… Supported with minimal extra code
get_it βœ… Supported with minimal extra code
Classic JSON REST API βœ… Built-in support!
JSON:API βœ… Supported via external adapter
Freezed βœ… Supported!

πŸ“² Apps using Flutter Data


βž• Questions and collaborating

Please use Github to ask questions, open issues and send PRs. Thanks!

On Twitter: @flutterdata

Tests can be run with:

pub run test

πŸ“ License


We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.