retro 1.0.6 copy "retro: ^1.0.6" to clipboard
retro: ^1.0.6 copied to clipboard

Repository pattern implementation in Dart, with out of the box support for common storage libraries.

example/retro_example.dart

import 'package:retro/retro.dart';

import 'tweet.dart';

void main() {
  final memoryRepository = MemoryRepository<Tweet, String>(
      toJson: (tweet) => tweet.toJson(),
      fromJson: Tweet.fromJson,
      idGetter: (tweet) => tweet.id);

  memoryRepository.insert(Tweet(
      id: "123",
      content: "Hello world",
      createdAt: DateTime.now(),
      userId: "abc",
      userName: "John Doe",
      visible: true,
      tags: ["economy", "country"]));

  final tweet = memoryRepository.get("123");
  print(tweet);
}
0
likes
140
pub points
13%
popularity

Publisher

verified publishertomasweigenast.com

Repository pattern implementation in Dart, with out of the box support for common storage libraries.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

hive, meta, retry, universal_html

More

Packages that depend on retro