Recently released on pub:

Show more releases

Latest Blog Posts

Formatting Dart code before every git commit

Seth Ladd, on 11 Apr 2015
Dart's dartfmt tool is a really neat utility to automatically format your code. Use the dartfmt tool in your workflow to ensure your code complies with the Dart style guide.Of course, you don't want to manually run dartfmt. Instead, you want to automate it. Use git's pre-commit hook to ensure your code is formatted, before it is committed.Add the following code to your .git/hooks/pre-commit script for your local repo, and make sure the script is executable.#!/bin/bashDARTFMT_OUTPUT=`dartfmt -w . | grep Formatted`if [ -n "$DARTFMT_OUTPUT" ]; then  echo $DARTFMT_OUTPUT  echo "Re-attempt commit."  exit 1else  echo "All Dart files formatted correctly. Yay!"  exit... read more

Enforce formatting for your Dart projects

Kevin Moore, on 08 Apr 2015
A while ago, I wrote about using Travis to add continuous integration to your Dart projects.I've started adding a new trick to tool/travis.sh: format verification.I add a script to my tool directory:#!/bin/shdart_files=$(git ls-tree --name-only --full-tree -r HEAD | grep '.dart$')[ -z "$dart_files" ] && exit 0unformatted=$(dartfmt -n $dart_files)[ -z "$unformatted" ] && exit 0# Some files are not dartfmt'd. Print message and fail.echo >&2 "dart files must be formatted with dartfmt. Please run:"for fn in $unformatted; do echo >&2 " dartfmt -w $PWD/$fn"doneexit 1Then I add a line to the top of travis.sh: # Ensure the source is formatted$(dirname -- "$0")/ensure_dartfmt.shHere's... read more

Partying with IntelliJ IDEA Dart, Java, WebSocket and Glassfish

Yakov Fain, on 06 Apr 2015
Recently I wrote a blog showing how to use the WebSocket protocol to push the data from a Java server to a JavaScript client. This time I’ll keep the same code on the server, but the client will be written in Dart. For this example I was using GlassFish 4.1 server, and IntelliJ IDEA 14.1 […] read more

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

Davy Mitchell, on 03 Apr 2015
Who is ready for another - Dart POW? A weekly look at an interesting Package on pub.dartlang.org 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 :-) read more

Live analysis results with WebStorm 10 and Dart

Seth Ladd, on 31 Mar 2015
Today, JetBrains announced the new WebStorm 10 release, which includes significant enhancements for the Dart developer. The new version adds live analysis feedback, and fixes many reported issues. We highly recommend that all WebStorm users upgrade, and that new Dart developers who want a full-featured IDE try the new WebStorm 10 release.WebStorm now provides on-the-fly code analysis results for Dart code, powered by the Dart Analysis server. You can quickly look through the list of warnings and errors in your project in a tool window or see them highlighted right in the editor.WebStorm can now auto-import new libraries into your... read more