Monday, 30 September 2013

Download Client Side Data As A File Using The Dart Language

A quick Dart tip! I am working on an update to the Dart Class Generator and wanted to improve the User experience from COPY + PASTE. In HTML5, it is possible to send data from a variable to the client as a file download from client side code. Best of all it is really easy to code - this example is for text.To use put a call to this in your button handling code.

  void downloadFileToClient(String filename, String text){
    AnchorElement tl = document.createElement('a');
    tl..attributes['href'] = 'data:text/plain;charset=utf-8,' + Uri.encodeComponent(text)
      ..attributes['download'] = filename
      ..click();   
  }

That's it - nothing server side required at all! I should emphasise this is also possible in pure JS - can't comment on browser support.

Saturday, 28 September 2013

This Week In Dart #10

The Dart Editor and SDK was updated to version 0.7.5.3_r27776. The most interesting new feature being the 'Deploy Polymer App' menu option as it shows Polymer.dart is clearly being adopted very quickly and WebUI being pushed out within just a few builds.

Oreilly Media carried the article 'Build Reusable Widgets for the Web with Polymer and Dart' by Seth Ladd. This step by step guide takes you through creating a control with autocomplete.

The Dart community is growing with Dartisans having 3100+ members and StackOverflow having 1500 Dart Questions.

Dart engineer Emily Fortuna (pictured!) presents at the Seattle GDG Devfest, Sept 28. "Dev Fest is an all-day event for you to learn new Google technologies."

In case you missed it, this blog carried the post 'Top 5 Live Websites Already Using The Dart Language' which has turned out to be the most popular post on this blog so far! It's great to see Dart out in the real world.

Have a great week and build something awesome with Dart!

Tuesday, 24 September 2013

Top 5 Live Websites Already Using The Dart Language

Update Mar 2015 -

Here's an updated Top Ten List of Dart websites and companies who use Dart.



Update Jan 2015 -

This post is from 2013. For a more extensive and up to date list, please see 'Who Uses Dart' on the official Dart site. Thanks!



The Dart is still heading towards that magical 1.0 release but that is not stopping pioneering developers using the language. It is not just limited to internal tools. Already there are several live public websites running real applications in Dart. Let's take a look at them.



Google's German Election Map was written using Dart. It provides a Google Maps display of the results by district. "Dart is used for the UI, and to draw the district boundaries".




Staying with maps for a moment, Counties Power Outages is a New Zealand site for tracking power faults and scheduled work.



VectorShapes describes itself as 'an App Bazaar for designers, artists and developers looking for different ways to incorporate web technology into their craft'. This site was built with Dart and SVG and is well worth a look.


 
Blossom is a 'Lean Product Management' web tool written in Dart and has been in production since early this year. The tool is aimed at start ups but has some big names in its Happy Customers list.



Finally Woven a new community site "Woven is a Miami-based startup dedicated to helping groups work together more effectively. We’re building an online platform that helps groups coordinate their activities around a shared cause."

Feel free to leave a link to your Dart Language powered website in the comments below!

Monday, 23 September 2013

This Week In Dart #9

The Dart Editor and SDK was updated to version 0.7.3.1_r27487 with the Performance and Analysis fixes. Also the Dart Editor was given a TODO comment feature. Interestingly the option to create a new Web_UI project has been removed.

Recently Google pushed Chrome desktop apps and one of the Dart Editor team members is working on a Chrome App called Drake. Drake describes itself as 'A Chrome app based web development environment' and is written in Dart. I will trying this out very soon!

Seth Ladd has updated his Polymer.dart samples "Auto-complete, GWT Contacts example, and polymer-element-ification for the Polymer.dart mini-samples.". These samples have proved invaluable for most of my Polymer experiments. Also don't miss his up to date presentation on Dart from the JavaZone conference.

Chris Strom shared a blog post regarding unit testing of a Dart canvas application.

Staying with HTML5, dart-webgl a re-write of learningwebgl.com lessons to Dart. Take the web into the third dimension! I can see Teapots in front of my eyes already...

Friday, 13 September 2013

This Week In Dart #8

After a little summer break, TWID is back! I have missed researching and writing this part of the blog very much. Thanks for your patience.

The Dart Editor and SDK was updated to version 0.7.2.1_r27268 with Search, Performance and Analysis fixes.

The DartLang website has an updated Polymer.dart section. This is packed with examples and advice for upgrading from WebUI. A recent build of the Dart Editor also allows creation of a Polymer.dart app from the 'New Application...' menu.

Over on Tumblr is PixelCycle movies - my favourite is the missle command one. These were created with Pixel Cycle which was written in Dart with some Go server side.

I had a quick go too!

Finally Kevin Moore shared some impressive Dart performance (dart2js) graphs on G+ and numbers which show some impressive advances.

Wednesday, 11 September 2013

Starr Rose

We continue our adventures in Dart and Canvas, with the Starr Rose. This mesh is named after its creator mathematician Norton Starr. Of course, I am keeping it colourful and also adding an interactive element. Click on the canvas to draw a Rose - create an autumnal scene which is fitting as we reach the end of another summer.

Code is available on GitHub and the live demo is here. You may note that this is the first of the Diving Into Dart demo's to use Polymer. Also all Polymer demos will be linked into a single repository.

Tuesday, 3 September 2013

Brief Hiatus

I am busy this week on PyWeek 17. Writing a game in 7 days is very demanding so the blog will be quiet. Anyone fancy organising a Dart Game Jam? :-)