flutter_data 1.3.2 copy "flutter_data: ^1.3.2" to clipboard
flutter_data: ^1.3.2 copied to clipboard

outdated

The seamless way to work with persistent data models in Flutter. Inspired by Ember Data and ActiveRecord.

example/lib/main.dart

import 'dart:io';
import 'package:flutter_data/flutter_data.dart';

import 'main.data.dart';
import 'models/user.dart';

// NOTE: FOR AN UPDATED AND COMPLETE FLUTTER EXAMPLE FOLLOW
// https://github.com/flutterdata/tutorial

void main() async {
  late final Directory _dir;
  final container = ProviderContainer(
    overrides: [
      configureRepositoryLocalStorage(
        baseDirFn: () => _dir.path,
        encryptionKey: _encryptionKey,
      ),
    ],
  );

  try {
    _dir = await Directory('tmp').create();
    _dir.deleteSync(recursive: true);

    await container.read(repositoryInitializerProvider().future);

    final usersRepo = container.read(usersRepositoryProvider);
    final user =
        await usersRepo.findOne(1, params: {'_embed': 'tasks', '_limit': 5});
    assert(user!.tasks.length == 5);
  } finally {
    if (_dir.existsSync()) {
      _dir.deleteSync(recursive: true);
    }
  }
}

const List<int> _encryptionKey = [
  146,
  54,
  40,
  58,
  46,
  90,
  152,
  02,
  193,
  210,
  220,
  199,
  16,
  96,
  107,
  4,
  243,
  133,
  171,
  31,
  241,
  26,
  149,
  53,
  172,
  36,
  121,
  103,
  17,
  155,
  120,
  61
];
360
likes
0
pub points
83%
popularity

Publisher

verified publisherflutterdata.dev

The seamless way to work with persistent data models in Flutter. Inspired by Ember Data and ActiveRecord.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

analyzer, async, build, build_resolvers, collection, crypto, equatable, glob, hive, http, inflection3, json_annotation, meta, path, pubspec_parse, recase, riverpod, source_gen, state_notifier, uuid

More

Packages that depend on flutter_data