Dart By Example
eBook - ePub

Dart By Example

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

Dart By Example

Book details
Book preview
Table of contents
Citations

About This Book

Design and develop modern web applications with Google's bold and productive language through engaging example projects

About This Book

  • Full of engaging and varied example projects to equip you to build your own web applications
  • Learn the Dart language and key libraries
  • Productively create fast and reliable web applications

Who This Book Is For

If you are a front- or back-end web developer who is looking to build complex full-featured web applications without the quagmire of disconnected JavaScript frameworks, this book is a practical walkthrough of substantial applications that will have you and your team coding Dart in a productive manner.

This book will give you a compiled, optional typed, scalable environment to rapidly develop applications. As Dart was designed to be familiar, any developer with even a small amount of knowledge of JavaScript or another programming language will be at home with the language immediately and will be coding quickly.

What You Will Learn

  • Master the core Dart language, type system, and key development tools
  • Connect to existing web services, process JSON, and create your own framework for the data display
  • Run and debug the Dart server and web applications and compile them in JavaScript
  • Handle form data and encryption
  • Build and deploy server applications on the major OSes and implement the REST API
  • Work with PostgreSQL—an industry standard relational database system
  • Create robust applications with unit tests, documentation, and diagnostic logging
  • Develop command-line applications, and explore the key data structures and libraries

In Detail

Designed to create next generation apps, Google's Dart offers a much more robust framework and also supersedes JavaScript in several aspects. Familiar yet innovative, compact yet scalable, it blows away the accumulated JavaScript legacy limitations. Dart was designed for great tool-ability and developer productivity, allowing you to create better application faster than before. Google chose it for their billion dollar advertising business and you have its power for your projects too.

This book will introduce you the Dart language starting from its conception to its current form, and where it headed is through engaging substantial practical projects. You will be taken through building typical applications and exploring the exciting new technologies of HTML5.

With example code projects such as a live data monitoring and viewing system, a blogging system, a slides presentation application, and more, then this book will walk you through step by step through building data-driven web applications with ease and speed.

Style and approach

A varied collection of compelling practical Dart projects that are developed progressively with full explanations of concepts and implementation. Each project introduces features of the language and environment, demonstrating how Dart can be used in rich structured web applications.

Frequently asked questions

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.
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.
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.
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.
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.
Yes, you can access Dart By Example by Davy Mitchell in PDF and/or ePUB format, as well as other popular books in Computer Science & Application Development. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781785282478
Edition
1

Dart By Example


Table of Contents

Dart By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Starting the Text Editor
Defining Dart
History of Web scripting
The origins of Dart
Downloading the tools
Introducing the WebStorm IDE
Alternative development environments
Help starting a project
Elsewhere in the SDK
Building your first application
Exploring the Web project structure
Unwrapping packages
A look at Pubspec
Putting Dart into the web page
Importing packages
Variable declarations
Writing the event handler
Loading the saved text
Saving the text
Running in the browser
Editing and reloading
Extending the interface
Using the CSS editor
Debugging a Dart application
Working in harmony with JavaScript
Commenting in the code
Summary
2. Advancing the Editor
The next steps for the text editor
Starting point
Dart classes
Structuring the project
Building the dialog package
The package project structure
Adding a local package reference
Understanding the package scope
Defining the base dialog box
The alert dialog box
The About dialog box
Using the confirmation dialog box
Counting words using a list
The Word Frequency feature
Understanding the typing of Dart code
The file download feature
The clock feature
Executing Dart code
Multi-processing the VM
The class designer
Building a more complicated dialog
Constructing the class
Understanding the flow of events
Launching the application
The command-line app for source code statistics
The command-line project structure
Processing the source code
File handling with the dart:io package
Debugging the command-line program
Integrating the statistics
HTML5 and the canvas
Drawing the pie chart
Building web interfaces with Dart
Compiling to JavaScript
Minification of JavaScript output
Summary
3. Slideshow Presentations
Building a presentation application
Laying out the application
Defining the presentation format
Parsing the presentation
A sample presentation
Presenter project structures
Launching the application
Building bullet point slides
Accessing private fields
Using true getters and setters
Mixin' it up
Defining the core classes
Transforming data into HTML
Editing the presentation
Displaying the current slide
Navigating the presentation
Handling the button key presses
Using the Function type
Staying within the bounds
Using the slider control
Responding to keyboard events
Showing the key help
Listening twice to event streams
Changing the colors
Adding a date
Timing the presentation
Introducing the Stopwatch class
Implementing the presentation timer
An overview of slides
Handout notes
Comparing optional positional and named parameters
Summary
4. Language, Motion, and Sound
Going fullscreen
Request fullscreen
Updating the interface for fullscreen
Updating keyboard controls for fullscreen
Adding mouse controls
Adding metadata
Creating a custom annotation
Translating the user interface text
Exploring the intl package
Locating strings to translate
Extracting the strings
Running commands with Dart pub
Obtaining translations
Integrating the translations text
Changing the language of the user interface
Adding a language combo box
Working with dates
Formatting for the locale
Animating slides
Using a timer
Playing sound in the browser
Producing sound effects
Creating sound files
Loading sounds
Playing back sounds
Summary
5. A Blog Server
The Hello World server example
A blog server
Introducing the HTTP protocol
Starting up the server
Storing the blog posts format
Reading text files
Reading a folder of files
Request handling
Serving text
Robots.txt
Rendering a single blog post
Rendering the index page
Serving images
Locating the file
Serving a single image file
Serving a 404 error
Introducing Dart's server frameworks
Redstone
Rikulo
Shelf
Deployment
Dependencies
Deploying on Unix
Using the screen command
Launching a screen
Deploying on Windows
Using the NSSM tool
Using a Microsoft solution
Load testing
Building a simple load tool
Summary
6. Blog Server Advanced
Logging
Writing text files
Extracting request information
A blog editor
Password protection
Encryption
Handling more complex forms
Processing the form
Saving data to a disk
Serving a default graphic
Refreshing the blog
Caching
Watching the filesystem
XML feed generation
Serving the RSS
The JSON feed generation
Serving the JSON
Consuming the JSON feed
Static generation
Freezing the website
Introducing the await and async keywords
Joining file paths
Creating an output folder
Generating the front page
Writing the static version
Load testing revisited
Updating the load tester
Summary
7. Live Data Collection
Kicking off the earthquake monitoring system
Introducing the data source
Exploring the GeoJSON format
Fetching and recording the data
Logging
A simple example of logging
Data monitor logging
Saving to the database
Installing a database system
Using PostgreSQL from Dart
Introducing the pgAdmin GUI
Creating the database and login
Defining the table
Inserting data
Running the program
Maintaining a database
Managing command line arguments
Retrievin...

Table of contents

  1. Dart By Example