售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
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
Retrieving data
Deleting data
Observing the Dart VM internals
Unit testing
Running unit tests
Writing unit tests for the data monitor
Grouping tests together
Examining the test results
Summary
8. Live Data and a Web Service
Freeing the data
Reworking the data collector
Adding a new data table
Filtering the data
Converting the feature to JSON
Improving the data maintenance
Storing the single feature
Running the data application
Creating the web service
Using the package rpc
Initiating the API server
Exposing methods
Error handling of incorrect requests
Serving the latest information
Supplying the data
Discovering the API
Running the web service
Recapping the system so far
Consuming application
Packaging the grid
Initiating the real-time updates
Performing the update
Fetching the JSON
Configuring the grid view control
Formatting the time
Working with date and time
Building the table
Showing the page
Summary
9. A Real-Time Visualization
Iteration overview
Application overview
Drawing the map image
Plotting on the map
Animating the display
Fetching the data
Updating the map indicators
Mouse over popups
Zooming into the display
Notifying the user of an update
Plotting the user's location
Sorting the feature list
Documenting Dart code with dartdoc
Summary
10. Reports and an API
Recapping the earthquake system
Advancing the REST API
Passing parameters to the API
Posting on the API
Connecting to an API client
Varying the data
Returning to the map
Reporting on the data
The ReportSite project
Report classes
Creating a printable report
Charting the data
Exporting to CSV
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜