Book description
Master the art of designing web client and server with Google’s bold and productive language – Dart
About This Book
Create robust applications with unit tests, documentation, and diagnostic logging
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
Use mixins, reflections, annotations, and other metadata programming techniques to create powerful app
Who This Book Is For
If you are familiar with web development and are looking to learn, or even just evaluate, Dart as a multipurpose language, this learning path is for you. No familiarity with the Dart language is assumed. For beginners, it will serve as a guide to rapidly accelerate from a novice level to the master level; for intermediate to advanced developers it will quickly fill in the gaps on Dart and can explore a range of application types and powerful packages that are demonstrated in a practical manner.
What You Will Learn
Handle form data and encryption
Set up your Dart environment to achieve the highest productivity
Run and debug the Dart server and web applications and compile them in JavaScript
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
Detect and use HTML5 features that will help you deliver rich, cross-platform content
Demonstrate the power of Polymer web components for binding data and structuring your web pages
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.
The first module 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.
The second module will show you how to add internalization support to your web applications and how i18n and i10n access can be embedded into your code to design applications that can be localized easily. You will be shown how to organize client-to-server communication and how different HTML5 features can be used in Dart. Finally, this module will show you how you can store data locally, break the storage limit, and prevent security issues in your web application.
The third module is a pragmatic guide that will increase your expertise in writing all kinds of applications, including web apps, scripts, and server-side apps. It provides rich insights on how to extend your Dart programming skills.
Altogether, this course provides you the power to create powerful applications with Dart, without worrying about your knowledge leading to you having to make compromises to the end product!
This Learning Path has been curated from three Packt products:
Dart By Example By Davy Mitchell
Mastering Dart By Sergey Akopkokhyants
Dart Cookbook By Ivo Balbaert
Style and approach
This is an enticing learning path that starts from the very basics to gradually pick up pace as the story unfolds. Each topic is explained with the help of recipes that solves a real-world problem involving hands-on work thus giving you a deep insight into the world of DART.
Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.
Table of contents
-
Dart: Scalable Application Development
- Table of Contents
- Dart: Scalable Application Development
- Dart: Scalable Application Development
- Credits
- Preface
-
1. Module 1
-
1. Starting the Text Editor
- Defining Dart
- History of Web scripting
- The origins of Dart
- Downloading the tools
-
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
- Summary
-
2. Advancing the Editor
- The next steps for the text editor
- Building the dialog package
- The command-line app for source code statistics
- Building web interfaces with Dart
- Compiling to JavaScript
- Summary
-
3. Slideshow Presentations
- Building a presentation application
- Accessing private fields
- Mixin' it up
- Changing the colors
- Adding a date
- Timing the presentation
- An overview of slides
- Handout notes
- Summary
- 4. Language, Motion, and Sound
- 5. A Blog Server
- 6. Blog Server Advanced
- 7. Live Data Collection
- 8. Live Data and a Web Service
- 9. A Real-Time Visualization
- 10. Reports and an API
-
1. Starting the Text Editor
-
2. Module 2
- 1. Beyond Dart's Basics
- 2. Advanced Techniques and Reflection
- 3. Object Creation
- 4. Asynchronous Programming
-
5. The Stream Framework
- Why you should use streams
- Single-subscription streams versus broadcast streams
-
An overview of the stream framework API
- The Stream class
- The validation methods of the Stream class
- The search methods of the Stream class
- The subset methods of the Stream class
- Creating a stream
- A new stream from the Future class
- A new stream from the Iterable class
- A new stream with periodically generated events
- A new stream from the transformation pipe
- A new stream from StreamController
- What does the StreamSubscription class do?
- Minimizing access to the Stream class members using StreamView
- The Sink and EventSink interfaces
- Importance of the StreamConsumer interface
- What does the StreamSink class do?
- Transforming streams with the StreamTransformer class
- Traverse streams with StreamIterator
- Summary
- 6. The Collection Framework
- 7. Dart and JavaScript Interoperation
- 8. Internalization and Localization
- 9. Client-to-server Communication
- 10. Advanced Storage
- 11. Supporting Other HTML5 Features
- 12. Security Aspects
-
3. Module 3
-
1. Working with Dart Tools
- Introduction
- Configuring the Dart environment
- Setting up the checked and production modes
- Rapid Dart Editor troubleshooting
- Hosting your own private pub mirror
- Using Sublime Text 2 as an IDE
- Compiling your app to JavaScript
- Debugging your app in JavaScript for Chrome
- Using the command-line tools
- Solving problems when pub get fails
- Shrinking the size of your app
- Making a system call
- Using snapshotting
- Getting information from the operating system
-
2. Structuring, Testing, and Deploying an Application
- Introduction
- Exiting from an app
- Parsing command-line arguments
- Structuring an application
- Using a library from within your app
- Microtesting your code with assert
- Unit testing a Polymer web app
- Adding logging to your app
- Documenting your app
- Profiling and benchmarking your app
- Publishing and deploying your app
- Using different settings in the checked and production modes
-
3. Working with Data Types
- Introduction
- Concatenating strings
- Using regular expressions
- Strings and Unicode
- Using complex numbers
- Creating an enum
- Flattening a list
- Generating a random number within a range
- Getting a random element from a list
- Working with dates and times
- Improving performance in numerical computations
- Using SIMD for enhanced performance
-
4. Object Orientation
- Introduction
- Testing and converting types
- Comparing two objects
- Using a factory constructor
- Building a singleton
- Using reflection
- Using mixins
- Using annotations
- Using the call method
- Using noSuchMethod
- Making toJSON and fromJSON methods in your class
- Creating common classes for client and server apps
-
5. Handling Web Applications
- Introduction
- Responsive design
- Sanitizing HTML
- Using a browser's local storage
- Using application cache to work offline
- Preventing an onSubmit event from reloading the page
- Dynamically inserting rows in an HTML table
- Using CORS headers
- Using keyboard events
- Enabling drag-and-drop
- Enabling touch events
- Creating a Chrome app
- Structuring a game project
- Using WebGL in your app
- Authorizing OAuth2 to Google services
- Talking with JavaScript
- Using JavaScript libraries
- 6. Working with Files and Streams
- 7. Working with Web Servers
- 8. Working with Futures, Tasks, and Isolates
- 9. Working with Databases
-
10. Polymer Dart Recipes
- Introduction
- Data binding with polymer.dart
- Binding and repeating over a list
- Binding to a map
- Using custom attributes and template conditionals
- Binding to an input text field or a text area
- Binding to a checkbox
- Binding to radio buttons
- Binding to a selected field
- Event handling
- Polymer elements with JavaScript interop
- Extending DOM elements
- Working with custom elements
- Automatic node finding
- Internationalizing a Polymer app
- 11. Working with Angular Dart
-
1. Working with Dart Tools
- A. Bibliography
- Index
Product information
- Title: Dart: Scalable Application Development
- Author(s):
- Release date: June 2017
- Publisher(s): Packt Publishing
- ISBN: 9781787288027
You might also like
book
Dart in Action
Dart in Action introduces Google's Dart language and provides techniques and examples showing how to use …
book
Dart: Up and Running
Get moving with Dart, the development platform that helps you build high-performance HTML5 apps for the …
book
Web Programming with Dart
Web Programming with Dart is for programmers who want to master the new Dart programming language …
book
Practical Flutter: Improve your Mobile Development with Google’s Latest Open-Source SDK
Explore what Flutter has to offer, where it came from, and where it’s going. Mobile development …