Friday, 3 April 2015

Dart POW - (Package Of The Week) #4 dart-reddit

Who is ready for another - Dart POW? A weekly look at an interesting Package on

reddit is a library for Dart that allows read-only API access to the popular link sharing site Reddit.

The following example fetches the latest links from the Dart sub-reddit.

import "package:reddit/reddit.dart";
import "package:http/http.dart";
import 'dart:convert';

main() {
  Reddit reddit = new Reddit(new Client());

  reddit.sub("dartlang").top("month").listen((result) {

    Map data = JSON.decode(result.toString());
    List Titles = data["data"]["children"];
    Titles.forEach((headline) => print(headline["data"]["title"]));


Feel free to leave a comment with suggestions for the next Dart POW post! Don't be too shy to suggest your own package :-)