retro 1.0.0 copy "retro: ^1.0.0" to clipboard
retro: ^1.0.0 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
0
pub points
0%
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

License

unknown (license)

Dependencies

cloud_firestore, hive, isar, retry, universal_html

More

Packages that depend on retro