Recently released on pub:

Show more releases

Latest Blog Posts

Dart 1.8: library improvements and experimental support for enums

Anders Thorhauge Sandholm, on 28 Nov 2014
Would you like to try out Dart’s upcoming support for enums? In Dart Editor under Tools > Preferences > Experimental you can “Enable Enums Support” and start experimenting with code like:With Dart 1.8, a number of library improvements have also landed. In dart:collection, SplayTree added toSet() method, and in dart:convert a JsonUtf8Encoder class was added. In dart:core, the following three things were added: New properties and constructors for RangeErrorA new IndexError class - used by the RangeError.index constructorOptional start and end arguments for the String.fromCharCodes constructor.In dart:io we added support for the ALPN extension of the TLS secure networking protocol for Client and... read more

TDD a Polymer (Dart) Form Element

Chris Strom, on 27 Nov 2014
After last night, I am leaning toward being bad. Well, not too bad, but I have given up on trying to implement custom Polymer form elements the right way. Instead I begin to think the best approach is to break encapsulation of Polymer elements so that they can inject hidden <input> elements into the containing document containing the necessary data.I am not entirely sure how this is going to work in practice, but I think I can describe some of the functionality as: var _el, _form, _container; group("<x-pizza>", (){ setUp((){ /* ... */ }); group('acts like <input>', (){ test('value property... read more

Native Form Inputs with Polymer

Chris Strom, on 26 Nov 2014
Polymer's inability to define form elements still bugs me. Recent work to support this in Paper Elements is progress, but sometimes you just don't want an input element that looks like a Google property. I have a solution in Patterns in Polymer. Said solution works with minimal overhead in both JavaScript and Dart. Still, there is overhead and the penalty is paid by the developer using my awesome custom element... which makes my awesome custom element slightly less awesome. The current approach in Patterns in Polymer requires additional code to sync a hidden <input>'s value with that of the Polymer... read more

Better Polymer.dart Tests with Futures

Chris Strom, on 25 Nov 2014
I lamented Polymer.dart's JavaScript-y callback nature yesterday. But I didn't do much about it. Ultimately I cannot do much until the library matures into more of a Dart library. The Patterns in Polymer book needs to track the library, not my weakly held, strong opinions (and I do admit that it makes sense to track the JavaScript Polymer for now). That said, I do think it worth exploring Dart futures as a means for cleaning up my tests. Last night's test looks like: group('syncing <input> values', (){ var input; setUp((){ input = _container.append(createElement('<input>')); syncInputFromAttr(input, _el, 'state'); _el.model.firstHalfToppings.add('pepperoni'); }); test('updates the... read more

Testing Polymer.dart Synchronization with Form Input Fields

Chris Strom, on 24 Nov 2014
Surprisingly, none of my Dart tests are failing. Or have failed. It's not that I expect Dart tests to fail with any regularity—far from it. It is just that the tests for the JavaScript version of Patterns in Polymer seem to fail every other week or so. It probably helps that Polymer.dart has remained at 0.15 for a while now. I could also use some better tests. And since I went to all that trouble last night to write a test describing the JavaScript code from the chapter on synchronizing the plain-old form <input> value with Polymer, it seems only... read more