售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Dart Cookbook
Table of Contents
Dart Cookbook
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. Working with Dart Tools
Introduction
Configuring the Dart environment
Getting ready
How to do it...
How it works...
Setting up the checked and production modes
Getting ready
How to do it...
How it works...
There's more...
See also
Rapid Dart Editor troubleshooting
Getting ready
How to do it...
How it works...
There's more...
Hosting your own private pub mirror
How to do it...
How it works...
Using Sublime Text 2 as an IDE
Getting ready
How to do it...
How it works...
See also
Compiling your app to JavaScript
How to do it...
How it works...
There's more...
Producing more readable JavaScript code
Producing a single Dart file
See also
Debugging your app in JavaScript for Chrome
How to do it…
How it works...
There's more...
Debugging your app in JavaScript for Firefox
Using the command-line tools
How to do it...
See also
Solving problems when pub get fails
Getting ready
How to do it...
How it works...
There's more...
Shrinking the size of your app
How to do it...
How it works...
There's more...
More Information Section 1
See also
Making a system call
How to do it...
How it works...
Using snapshotting
How to do it...
How it works...
There's more...
See also
Getting information from the operating system
Getting ready
How to do it...
How it works...
There's more...
2. Structuring, Testing, and Deploying an Application
Introduction
Exiting from an app
How to do it...
How it works...
Parsing command-line arguments
How to do it...
How it works...
See also
Structuring an application
Getting ready
How to do it...
How it works...
There's more...
See also
Using a library from within your app
How to do it...
How it works...
There's more...
Microtesting your code with assert
How to do it...
How it works...
There's more...
Unit testing a Polymer web app
Getting ready
How to do it...
How it works...
See also
Adding logging to your app
Getting ready
How to do it...
How it works...
There's more...
Documenting your app
Getting ready
How to do it...
How it works...
There's more...
Profiling and benchmarking your app
Getting ready
How to do it...
How it works...
See also
Publishing and deploying your app
Getting ready
How to do it...
How it works...
There's more...
Using different settings in the checked and production modes
How to do it...
How it works...
3. Working with Data Types
Introduction
Concatenating strings
How to do it...
How it works...
There's more...
Using regular expressions
How to do it...
How it works...
There's more...
Strings and Unicode
How to do it...
How it works...
There's more...
Using complex numbers
How to do it...
How it works...
There's more...
Creating an enum
How to do it...
How it works...
There's more...
Flattening a list
How to do it...
How it works...
There's more...
Generating a random number within a range
How to do it...
How it works...
Getting a random element from a list
How to do it...
How it works...
See also
Working with dates and times
How to do it...
How it works...
There's more...
Improving performance in numerical computations
How to do it...
How it works...
There's more...
Working with JavaScript
Parsing numbers
See also
Using SIMD for enhanced performance
How to do it…
How it works...
See also
4. Object Orientation
Introduction
Testing and converting types
How to do it...
How it works...
There's more...
See also
Comparing two objects
How to do it...
How it works...
There's more...
See also
Using a factory constructor
How to do it...
How it works...
There's more...
Building a singleton
How to do it...
How it works...
Using reflection
Getting ready
How to do it...
How it works...
There's more...
See also
Using mixins
How to do it...
How it works...
There's more...
Using annotations
How to do it...
How it works...
There's more...
See also
Using the call method
How to do it...
How it works...
There's more...
Using noSuchMethod
How to do it...
How it works...
There's more...
See also
Making toJSON and fromJSON methods in your class
Getting ready
How to do it...
How it works...
There's more...
Creating common classes for client and server apps
How to do it...
How it works...
There's more…
See also
5. Handling Web Applications
Introduction
Responsive design
How to do it...
How it works...
See also
Sanitizing HTML
How to do it...
How it works...
Using a browser's local storage
How to do it...
How it works...
There's more...
See also
Using application cache to work offline
How to do it...
How it works...
There's more...
Preventing an onSubmit event from reloading the page
How to do it...
How it works...
Dynamically inserting rows in an HTML table
How to do it...
How it works...
See also...
Using CORS headers
How to do it...
How it works...
There's more...
Using keyboard events
How to do it...
How it works...
There's more...
Enabling drag-and-drop
How to do it...
How it works...
See also
Enabling touch events
How to do it...
How it works...
There's more...
See also
Creating a Chrome app
How to do it...
How it works...
There's more...
See also
Structuring a game project
How to do it...
How it works...
There's more...
See also
Using WebGL in your app
How to do it...
How it works...
There's more...
See also
Authorizing OAuth2 to Google services
How to do it...
How it works...
There's more...
See also
Talking with JavaScript
How to do it...
How it works...
There's more...
See also
Using JavaScript libraries
How to do it...
How it works...
See also
6. Working with Files and Streams
Introduction
Reading and processing a file line by line
How to do it...
How it works...
See also
Writing to a file
How to do it...
How it works...
There's more...
Searching in a file
How to do it...
How it works...
See also
Concatenating files
How to do it...
How it works...
There's more...
See also
Downloading a file
Getting ready
How to do it...
How it works...
There's more...
Using pipe
Using the http package
See also
Working with blobs
Getting ready
How to do it...
How it works...
Transforming streams
How to do it...
How it works...
There's more...
See also
7. Working with Web Servers
Introduction
Creating a web server
How to do it...
How it works...
There is more...
Posting JSON-formatted data
How to do it...
How it works...
See also
Receiving data on the web server
How to do it...
How it works...
There's more...
Writing data to a file on the server
See also
Serving files with http_server
How to do it...
How it works...
There's more...
Using sockets
How to do it...
How it works...
There's more...
Using WebSockets
Getting ready
How to do it...
How it works...
There's more...
See also
Using secure sockets and servers
Getting ready
How to do it...
How it works...
See also
Using a JSON web service
Getting ready
How to do it...
How it works...
See also
8. Working with Futures, Tasks, and Isolates
Introduction
Writing a game loop
How to do it...
How it works...
There's more...
See also
Error handling with Futures
Getting ready
How to do it...
How it works...
Scheduling tasks using Futures
How to do it...
How it works...
See also
Running a recurring function
How to do it...
How it works...
There's more...
See also
Using isolates in the Dart VM
How to do it...
How it works...
There's more...
See also
Using isolates in web apps
How to do it...
How it works...
See also
Using multiple cores with isolates
How to do it...
How it works...
Using the Worker Task framework
How to do it...
How it works...
There's more…
See also
9. Working with Databases
Introduction
Storing data locally with IndexedDB
How to do it...
How it works...
See also
Using Lawndart to write offline web apps
How to do it...
How it works...
See also
Storing data in MySQL
Getting ready
How to do it...
How it works...
There's more...
Storing data in PostgreSQL
Getting ready
How to do it...
How it works...
See also
Storing data in Oracle
Getting ready
How to do it...
How it works...
There's more…
Storing data in MongoDB
Getting ready
How to do it...
How it works...
See also
Storing data in RethinkDB
Getting ready
How to do it...
How it works...
See also
10. Polymer Dart Recipes
Introduction
Data binding with polymer.dart
How to do it...
How it works...
There's more…
Binding and repeating over a list
How to do it...
How it works...
There's more...
Binding to a map
How to do it...
How it works...
See also
Using custom attributes and template conditionals
How to do it...
How it works...
See also
Binding to an input text field or a text area
How to do it...
How it works...
Binding to a checkbox
How to do it...
How it works...
See also
Binding to radio buttons
How to do it...
How it works...
Binding to a selected field
How to do it...
How it works...
Event handling
How to do it...
How it works...
Polymer elements with JavaScript interop
How to do it...
How it works...
See also
Extending DOM elements
How to do it...
How it works...
Working with custom elements
How to do it...
How it works...
There's more...
Automatic node finding
How to do it...
How it works...
Internationalizing a Polymer app
How to do it...
How it works...
There's more...
11. Working with Angular Dart
Introduction
Setting up an Angular app
How to do it...
How it works...
There's more...
Using a controller
How to do it...
How it works...
There's more...
Using a component
How to do it...
How it works...
There's more...
See also
Using formatters as filters
How to do it...
How it works...
See also
Creating a view
How to do it...
How it works...
Using a service
How to do it...
How it works...
See also
Deploying your app
How to do it...
How it works...
See also
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜