Some time ago I picked up HTML5 Canvas, 2nd Edition by Steve Fulton and Jeff Fulton, from O’Reilly. I wanted to learn some Canvas tricks for myself and just get a feel for it (plus I love learning new things!). O’Reilly has since gone ahead and made this book available for free online. Check out HTML5 Canvas. The online version also includes interactive components.
Now for the bad news… The original examples I had converted have all been lost due to a botched OS update before I had them hosted on an external repository. So I will be starting the process over from scratch and continually adding new examples as I proceed through the book again. You can see the example I have completed on my GitHub Repository. Feel free to watch or star this repository to be notified as I upload new examples.
A few things to note regarding the examples. First I tried to stay relatively true to the examples from the book. That said, I also used some more Dart-ish conventions in a number of areas to make the most of the functionality that Dart offers, such as cascades (oh the type those alone saved me!) and class-based inheritance. The examples are listed under the web/ directory (per standard Pub Package Layout Conventions), and then are subdivided into their respective directories.
While the code itself will be commented, I will not include the accompanying text explanations from the book. I highly recommend that you follow the online version (mentioned previously), or better yet buy the eBook and support the original authors! In a couple of instances I have left the code as it is from the original samples, however I have added comments indicating that some statements may not be required (possible errata for the book?). I’d love to hear your thoughts on the ports and if they were helpful in anyway.