Dart Essentials
eBook - ePub

Dart Essentials

Martin Sikora

  1. 232 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Dart Essentials

Martin Sikora

Book details
Book preview
Table of contents

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Dart Essentials an online PDF/ePUB?
Yes, you can access Dart Essentials by Martin Sikora in PDF and/or ePUB format, as well as other popular books in Computer Science & Web Development. We have over one million books available in our catalogue for you to explore.



Dart Essentials

Table of Contents

Dart Essentials
About the Author
About the Reviewers
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
What this book covers
What you need for this book
Who this book is for
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
1. Getting Started with Dart
What is Dart?
Why choose Dart?
Installing the Dart SDK
Dart Editor
Writing a greeting for all Dartisans
The main() function
Running and debugging code in Dartium
Compiling Dart to JavaScript
The Dart language tour
The static checker
Built-in types
Functions and parameters
Class properties
Class inheritance and abstract classes
Using static types
2. Practical Dart
Optimizing DOM tree manipulations
The documentation search app
The Future-Based API
Using async and await keywords
Creating Ajax requests in Dart
Dart packages
Writing the fuzzy search algorithm
Handling HTML elements
Combining Dart and JavaScript
Using Dart in JavaScript
Using JavaScript in Dart
Dart MythBusters
3. The Power of HTML5 with Dart
Creating the Reddit Read Later app
Fetching the JSONP data
Initializing IndexedDB
Fetching stored records
Saving records
Deleting records
Polishing the application
LocalStorage versus IndexedDB
What about WebSQL?
Music visualizer
Other noteworthy APIs and libraries
Typed lists for fast numeric computing
Box2D and play_phaser
Isolates and Web Workers
4. Developing a Mobile App with Dart
300 ms tap delay
Basics of CSS3 transformations
Hello world in 3D
Nesting 3D transformed elements
A 3D bookshelf with DeviceOrientation events
Position and distance tracker with the GeoLocation API and Google Maps API
Drawing into 2D canvas using onTouch events
5. Web Components and polymer.dart
Web Components
Shadow DOM
Custom Elements
HTML Imports
The Web Components polyfill for older browsers
Basic HTML Import
Using Shadow DOM
Using Custom Elements
Minimalistic custom element in polymer.dart
One-way data binding
Loops and conditions in templates
Two-way data binding
Polymer core and paper elements
A quick look at core-list
What's next?
6. AngularDart
Installing AngularDart
To-do list with AngularDart
Extending the to-do list
Finishing TodoListComponent
Data bindings
A book component in AngularDart
What is Angular 2.0?
Why is Angular 2.0 not written in Dart?
Performance tips for AngularDart
Avoiding nesting ng-repeat directives
Using track by for ng-repeat
Avoiding excess formatter usage
Not everything needs to be in Angular
7. Server-side Applications with Dart
The standalone Dart VM
Parsing CLI arguments with the args package
Writing a chat app with the WebSockets server
Client-side WebSockets
Listening to Unix signals and basic I/O operations
Running the server as a background process
Enumerated types
Using MySQL as a storage
Writing an HTTP server with the route package
Using Dart as a full-stack language
Using Apache as a proxy for the Dart HTTP server
Using nginx as a proxy for the Dart HTTP server
Executing Dart as CGI and Apache mod_dart
8. Testing and Profiling the Dart Code
Testing strategies for web apps
Unit testing
Asynchronous tests
Test groups
Running all tests
Operator overloading and mixins
Operator overloading
Testing AngularDart apps
Profiling with the Observatory tool
9. Writing Native Extensions for the Standalone Dart VM
The structure of native extensions
Writing a minimal native extension
Writing a native fuzzy search implementation
Optimizing our C/C++ code
Multithreading with Dart Isolates
Writing bindings for the exiv2 library
Distributing native extensions

Dart Essentials

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: May 2015
Production reference: 1190515
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-960-7


Martin Sikora
Lamoriniere Cedric
Rokesh Jankie
Hans Van den Keybus
Frederik Leonhardt
Marko Vuksanovic
Commissioning Editor
Taron Pereira
Acquisition Editor
Shaon Basu
Content Development Editor
Akashdeep Kundu
Technical Editor
Mrunal M. Chavan
Copy Editor
Stuti Srivastava
Project Coordinator
Milton Dsouza
Stephen Copestake
Safis Editing
Hemangini Bari
Sheetal Aute
Production Coordinator
Shantanu N. Zagade
Cover Work
Shantanu N. Zagade

About the Author

Martin Sikora has been programming professionally since 2006 for companies such as Miton CZ and Symbio Digital in various languages, mostly PHP. Since 2012, he's been freelancing, working on projects in Python, PHP, Dart, Objective-C, and AngularJS. He's a Zend Certified Engineer and was a member of the winning team at Google Dart Hackathon 2012 in Prague.

About the Reviewers

Lamoriniere Cedric is a software engineer and a graduate from a French engineering school, who mostly uses C++ during his day job.
His taste for innovation has led him to try out a considerable amount of various web frameworks, technologies, and languages.
Among these languages, he has taken a strong interest in the Dart language for its ease of use and efficiency. It allows developers to get things done in a timely manner.
Rokesh Jankie graduated in 1998 with a master's degree in computer science from Leiden University, the Nether...

Table of contents

  1. Dart Essentials