售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Mastering Dart
Table of Contents
Mastering Dart
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. Beyond Dart's Basics
Modularity and a namespace
Modularity in software development
Modularity in Dart
Libraries
Functions and closures in different scopes
Naming functions with a variable
Passing a function as an argument to another function
Returning a function as a result of another function
Storing a function in data structures
Closures
Classes and mixins
Types
Classes
Inheritance
Interface
Mixins
Well-designed classes
To be private or not
Variables versus the accessor methods
Inheritance versus composition
Methods and operators
Checking the values of the parameters before using them
Well-designed methods
Summary
2. Advanced Techniques and Reflection
Generics
Raw types
Using generics
Generic types
Generic functions
Errors versus exceptions
Errors
Exceptions
Annotations
Built-in annotations
Deprecated
Override
Proxy
Custom annotations
Reflection
Introspection in action
Reflection in action
Summary
3. Object Creation
Creating an object
A generative constructor
A constructor with optional parameters
A named constructor
A redirecting constructor
A private constructor
A factory constructor
The factory method design pattern
The singleton design pattern
A constant constructor
Initializing variables
Syntactic sugar
Method call
Cascade method invocation
Summary
4. Asynchronous Programming
Call-stack architectures versus event-driven architectures
Call-stack architectures
Event-driven architectures
The Dart VM execution model
Synchronous versus Asynchronous code
Future
Future and Timer
Future and Microtask
Sync the Future class
Future with a value
Future with an error
Delaying the Future class
Zones
Simple zone example
Zone nesting
Zone values
Zone specifications
Interaction between zones
Tracking the zone execution
Isolates
Summary
5. The Stream Framework
Why you should use streams
Single-subscription streams versus broadcast streams
A single-subscription stream
A broadcast stream
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
A Dart collection framework
Ordering of elements
The Comparable interface
The Comparator type
Collections and generics
The collection class hierarchy
The Iterable interface
Properties of the Iterable collection
Checking the items of a collection on a condition
The iterate over collection
The search over collection
Creating a new collection
Reducing a collection
Converting a collection
Generating a collection
The Lazy Iterable
The Iterable interface
BidirectionalIterator
The collection classes
List
LinkedList
Set
HashSet
LinkedHashSet
SplayTreeSet
Queue
Map
HashMap
LinkedHashMap
SplayTreeMap
Unmodifiable collections
The unmodifiable list
The unmodifiable map
Choosing the right collection
Summary
7. Dart and JavaScript Interoperation
Interoperation at a glance
The dart:js library
JsObject
JsFunction
JsArray
Type conversion
Direct type conversion
Proxy type conversion
Collection conversion
JsObject and instantiation
JsFunction and the this keyword
Dart with jQuery
How to create a shortcut to jQuery
Why does JProxy need a method call?
How does JProxy invoke jQuery?
An example project
How to get the jQuery version
How to perform actions in jQuery
How to use effects in jQuery
What is the impact on performance?
Summary
8. Internalization and Localization
The key principles
Executable code versus User Interface
Numbers and dates
Messages
Measuring units and currencies
Text input and layout
Formatting date and time
The Intl library
Changing a locale
Formatting numbers
Formatting dates
Internalizing messages
Adding parentheses
Adding gender
Adding select
Creating complex message translations
Bidirectional formatting
Internationalizing your web application
Extracting messages
Using Google Translator Toolkit
Using translated messages
Summary
9. Client-to-server Communication
Communication at a glance
The Internet protocol stack
Hypertext Transfer Protocol
Web server
Standalone HTTP communication via the dart:io library
Standalone HTTP communication via the http package
Web browser HTTP communication via the dart:html library
Web browser HTTP communication via the http package
AJAX polling request
AJAX long polling request
Server-Sent Events
WebSocket
Summary
10. Advanced Storage
Cookies
Web Storage
The Session storage
The Local storage
Web SQL
IndexedDB
Summary
11. Supporting Other HTML5 Features
The notification APIs
When to notify
Preventing repeated notifications
The native drag-and-drop APIs
Draggable content
The drag-and-drop events
Dragging data
Dragging the feedback image
Dragging effects
The drop target
Finishing a drop
Finishing a drag
The geolocation APIs
Determining the current location
Geolocation on maps
Tracking the present location
Canvas
Example – the canvas editor
Beginning with HTML
Moving to the main function
The CanvasWidget component
The ToolSelector widget
The ColorSelector widget
The Tool class
The Pen tool
The Line tool
The Rectangle tool
The Oval tool
How to clear the context
How to preview the context
Summary
12. Security Aspects
Web security
Transport Layer Security and Secure Socket Layer at a glance
The TLS certificate
Securing a server
Securing a client
Attributes of cookies
HTTP Strict Transport Security
Content Security Policy
Cross Origin Resource Sharing versus JSON with padding
CAPTCHA
Security best practices
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜