repository 1.0.0 copy "repository: ^1.0.0" to clipboard
repository: ^1.0.0 copied to clipboard

outdated

Structure for doing compositional high-level data management.

example/main.dart

import 'package:http/http.dart' as http;

import 'package:repository/repository.dart';

void main() {
  var comicUrls = CachedRepository<String>(
    source: ComicMetadataDownloader(),
    cache: InMemoryStorage(),
  );
}

class ComicMetadataDownloader extends Repository<String> {
  ComicMetadataDownloader() : super(isFinite: false, isMutable: false);

  @override
  Stream<String> fetch(Id<String> id) async* {
    yield http.get('https://xkcd.com/$id/info.0.json')['img'] as String;
  }
}
9
likes
0
pub points
36%
popularity

Publisher

verified publisheryanncabral.dev

Structure for doing compositional high-level data management.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta, rxdart

More

Packages that depend on repository