Learn Google Flutter Fast: 65 Example Apps Mark Clow pdf download
Learn Google Flutter Fast: 65 Example Apps Mark Clow pdf download
Clow download
https://textbookfull.com/product/learn-google-flutter-
fast-65-example-apps-mark-clow/
https://textbookfull.com/product/angular-5-projects-learn-to-
build-single-page-web-applications-using-70-projects-1st-edition-
mark-clow/
https://textbookfull.com/product/learn-arcore-fundamentals-of-
google-arcore-learn-to-build-augmented-reality-apps-for-android-
unity-and-the-web-with-google-arcore-1-0-1st-edition-micheal-
lanham/
https://textbookfull.com/product/mastering-flutter-a-
comprehensive-guide-to-learn-flutter-development-1st-edition-
cybellium-ltd-kris-hermans/
https://textbookfull.com/product/programming-flutter-native-
cross-platform-apps-the-easy-way-1st-edition-carmine-zaccagnino/
Programming Flutter Native Cross Platform Apps the Easy
Way 1st Edition Carmine Zaccagnino
https://textbookfull.com/product/programming-flutter-native-
cross-platform-apps-the-easy-way-1st-edition-carmine-
zaccagnino-2/
https://textbookfull.com/product/deep-dive-into-power-automate-
learn-by-example-1st-edition-mishra/
https://textbookfull.com/product/build-location-apps-on-ios-with-
swift-use-apple-maps-google-maps-and-mapbox-to-code-location-
aware-mobile-apps-jeffrey-linwood/
https://textbookfull.com/product/progressive-web-apps-with-react-
create-lightning-fast-web-apps-with-native-power-using-react-and-
firebase-1st-edition-scott-domes/
Table of Contents
Table of Contents
1. Table of Contents
2. Welcome
Introduction
Acknowledgements
Purpose
Work
Disclaimer
Revisions
Source Code
Location
Example & Exercise Names
Example – ‘gesture_app’
One File
3. The Big Picture
Introduction
Before Cross-Platform Mobile Application Development
Early Cross-Platform Development Tools
Development Tools That Used Native Libraries
Development Tools That Didn’t Use Native Libraries
Modern Cross-Platform Development Tools
React Native
Google Flutter
Conclusion
4. Introduction to Dart
Introduction
Platforms
1. Within a Web Browser
2. As Interpreted Application
3. As Native Application
Dart SDK
Command-Line Tools
Libraries
5. Basic Dart
Introduction
Example Code
Entry Point
Example Code
Output
Introduction to Typing
Statically-typed languages.
Dynamically-typed languages.
Dart Typing
Static Types
Dynamic Types (aka Untyped)
There is a difference, but it is subtle.
This code wont compile. Dartpad displays the following error:
Type Inference
Example of Inference #1:
Output
Example of Inference #2:
Output
Type Matching
Example Code
Output
Type Information
Example Code
Output
Strings
Interpolation
Raw Strings
Runes
Object-Orientated Language Features
Modules
Constructors
Instance Variables
Constructor and Method Parameters
Constructor and Method Parameters - Positional Required
Constructor and Method Parameters - Positional Optional
Constructor and Method Parameters - Named
Other
Method Cascades
6. More Advanced Dart
Introduction
Operator Overloading
Example
Warning
Reflection
Mixins
Collections
Introduction
Lists
Maps
More-Specific Collection Classes
Assertions
Example Code
Output
Assertions & Modes (Flutter)
Further Reading
Errors & Exceptions
Why Have Error & Exception Handling?
Errors
Exceptions
Handling Errors
Handling Exceptions
Finally
Catch Exception
Catch Exception and Stack Trace
Catch Specific Exceptions
Throw Exception
Rethrow Exception
Create Custom Exceptions
Console Output
Example Code
Output
Asynchronicity
Introduction
Future
Invoking and Handling Asynchronous Operations
Future API
Async & Await Keywords
Reactive Programming
Further Reading
7. Introduction to Flutter
Introduction
What is Flutter?
High Productivity
High Quality
High Performance
It is Free and Open.
Fuschsia
Flutter Source Code
Flutter SDK
Dart Platform
Flutter Engine
Foundation Library
8. Installing Flutter
Introduction
Issues
Developing on a PC for iOS
Install Process
Introduction
Step 1: Software Pre-Requisites
Step 2: Download the Flutter SDK
Step 3: Setup Your Path
Step 4: Run Flutter Doctor
Step 5: Setup Your Editor
Step 6: Setup Your Emulator(s)
9. Your First App
Introduction
Default Flutter App
Generate Your First App
Android Studio
Visual Studio Code
Command-Line
Emulators
Open Android Emulator & Run Your First App
Introduction
Open Android Emulator
Run Your App on the Android Emulator
Open iOS Emulator & Run Your First App
Introduction
XCode
iOS Emulator
Open iOS Simulator/Emulator
Run Your App on the iOS Simulator
Connect Your Device & Run Your First App
Introduction
Android Device
iOS Device
iOS Device - Open Xcode Project
iOS Device – Create Signing Team
iOS Device – Set Bundle Identifier
Hot Restarting & Reloading
Introduction
Two Options
Hot Restarting & Hot Reloading
10. Dependencies & Packages
Introduction
Website
Core Packages
Non-Core Packages
Most Useful Non-Core Packages
How to Use an External Package
Declare Dependency in Project
Import Packages
Import & Use Package Code
Restart Your App
Package Version Numbers
Project Files
.packages
pubspec.lock
How to Publish Your Own Packages
Introduction
Setting Up a Dart Package
Adding Documentation
Final Review
Do a Publish Dry-Run
Publish
Further Reading
11. Default Flutter Application Project
Introduction
Folders
Application Code
Location
Introduction to Composition & Widgets
12. Introduction to Widgets
Introduction
What Are Widgets?
User Interface: Material & Cupertino
Material Design, According to Google
Most Flutter Widgets Work with Material Design
User Interface: Cupertino
Flutter Includes iOS-Styled Widgets
Building Widgets
Build Method
Build Context
Widgets Have No Mutable State
Not All Widgets Are Equal
Further Reading
13. Stateless Widgets
Introduction
Not All Widgets Need to be Smart
Minimum Code
Creation
Example
Rendering
The ‘Build’ Method
When Does The ‘Build’ Method Execute?
Lifecycle
Exercise – ‘first_stateless’
Step 1 – Create Default Flutter App
Step 2 – Replace Application Code
Step 3 – Open Emulator & Run
Summary So Far
Step 4 – Add Some Padding
Step 5 – Add Scrolling
Step 6 – Add Border
Step 7 – Final Touch
Example – ‘stateless_widget_rebuild’
Optional
Purpose
Source Code
14. Stateful Widgets
Introduction
Some Widgets Need to be Smart
Minimum Code
Two Classes
Class #1 – the class that extends StatefulWidget
Class #2 – the class that extends State
Creation
Rendering
The ‘Build’ Method
LifeCycle Methods
Class #1 – the class that extends StatefulWidget
Class #2 – the class that extends State
More Reading
Example – ‘stateful_widget_flowers’
Optional
App Purpose
App Widgets
Start App
Change the Flower
Add Blur
Source Code
15. Basic Material Widgets
Introduction
Text
Example – ‘text’
Image
Introduction
Exercise – ‘loading_image’
Icon
Introduction
Example - ‘icon’
Further Reading
Buttons
Introduction
Enabling
Example – ‘buttons’
16. Multi-Child Layout Widgets
Introduction
Multi-Child Layout Widgets
Column
Spacing Out Children Using MainAxisAlignment
Expanding Children Using Expanded Widget
Row
Spacing Out Children Using MainAxisAlignment
Expanding Children Using Expanded Widget
Flex
Example – ‘flex’
ListView
Example - ‘horizontal_list’
ListTile
Stack
Example – ‘stack_please_wait’
17. Single-Child Layout Widgets
Introduction
Padding
Example – ‘padding’
Container
Example – ‘container’
Further Reading
Card
Example – ‘cards’
Expanded
Example – ‘expanded’
Flexible
Example – ‘flexible’
Center
GestureDetector
Example – ‘gesture_app’
Positioned
Example – ‘positioned’
SafeArea
Example: Non-Safe Area
Example: Safe Area
Example: Safe Area with Minimum Padding Set
SingleChildScrollView
Constructor Arguments Include:
Exercise – ‘single_child_scroll_view’
18. App Scaffolding Widgets
Introduction
MaterialApp
Navigator
Themes
Locales
Debugging Constructor Arguments
Scaffold
AppBar
Body
BottomNavigationBar
Drawer
BottomSheet
PersistentFooterButtons
Exercise – ‘scaffold’
Step 1 – Create Default Flutter App
Step 2 – Replace Application Code
Step 3 – Open Emulator & Run
19. Other Widgets
Introduction
Checkbox
Dialog
AlertDialog
SimpleDialog
Custom Dialog Widget
DropdownButton & DropdownMenuItem
ExpansionPanelList & ExpansionPanel
ExpansionPanelList
ExpansionPanel
Example – ‘expansion_panel’
GridView
Builder
GridTile
GridTileBar
Example – ‘gridview_app’
Further Reading
PopupMenuButton
Example – ‘popup_menu_button’
Radio
SnackBar
Example – ‘snack_bar’
Spacer
Exercise – ‘spacer’
Switch
TabBar, Tabs and TabBarView Widgets
Instructions:
Exercise – ‘tabs_simple’
Step 1 – Create Default Flutter App
Step 2 – Replace Application Code
Step 3 – Open Emulator & Run
Step 4 – Move Tabs to Bottom
Step 5 – Change Tab Styles
Table
Introduction
Column Width Specifiers
20. Builders
Introduction
What is a Builder?
How Do You Use a Builder?
Nested Builders
Common Builders
AnimatedBuilder
GridView Builder
FutureBuilder
ListView Builder:
OrientationBuilder
PageRoutebuilder
StreamBuilder
StreamBuilder
Example – ‘nested_builders’
Source Code
21. Routing & Navigation
Introduction
Navigator Class
Stack of Routes
Navigation without Named Routes with Parameters
Navigating Forward
Navigating Backwards
Data
Example – ‘routes_simple’
Navigation with Named Routes - Part One
Define Routes
Navigating Forward
See the problem yet?
Example – ‘routes_named’
Navigation with Named Routes - Part Two
Attach Route Handler to MaterialApp
Define Route Handler
Navigating Forward
Example – ‘routes_named_with_parms’
PageView
Introduction
Child Widgets
Controller
Example – ‘page_view_navigation’
22. Forms
Introduction
Form
Form State
Form Validation
Form / Field Integration
Form Fields
Checkbox
DropdownButton
Radio
TextFormField, TextField
InputDecorator
Example – ‘form_details’
Dependencies
Source Code
Other Information
Input Decoration Themes
Enabling / Disabling Form Buttons
23. HTTP, APIs, REST & JSON
Introduction
Asynchronous Communication
HTTP
Introduction
Tools
Request
Response
Methods
URI
Status
Header
Body
APIs
REST
REST APIs should be stateless.
How REST Uses URLs
How REST Uses HTTP Method
Accessing Data with a REST API
Inserting Data with a REST API
Updating Data with a REST API
Deleting Data with a REST API
JSON
JSON For Passing an Object Containing Data.
JSON For Passing an Array
JSON For Passing an Array of Objects
24. Flutter with HTTP, APIs, REST & JSON
Introduction
Flutter & JSON
Introduction
Serializing & Deserializing JSON.
Generating Code for Serializing & Deserializing
Manually Writing Code for Serialization & Deserialization
Flutter & HTTP
Flutter HTTP Package
Dummy API
Error Handling
Example ‘http_employees’
Source Code
Other Information
Alice
HAL / HATEOS
25. State
Introduction
State & Events
Storing State
Kinds of State
How to Determine Where to Store State
Responding to Events
Introduction
Events Can Affect State
State & Events – Problems
State & Events – Different Approaches
Mixing Approaches
How I Decide Where to Put State
State & Events – Commonly-Used Approaches
Stateful Widget Approach
InheritedWidget Approach
Scoped Model Approach
BLoC w/Streams Approach
26. State & Stateful Widget Approach
Introduction
Approach
Exercise – ‘state_and_stateful_widget’
Introduction
Step 1 – Create Default Flutter App
Step 2 – Replace Application Code
Step 3 – Open Emulator & Run
Summary
Step 4– Add Car Selection
Further Reading
27. State & InheritedWidget Approach
Introduction
Approach
Exercise – ‘state_and_inherited_widget_add’
Step 1 – Create Default Flutter App
Step 2 – Replace Application Code
Step 3 – Open Emulator & Run
Summary
Exercise – ‘state_and_inherited_widget’
Step 1 – Create Default Flutter App
Step 2 – Replace Application Code
Step 3 – Open Emulator & Run
Summary
Conclusion
Further Reading
28. State & ScopedModel Approach
Introduction
Approach
Package
Package Readme
Multiple Models
Exercise – ‘state_and_scoped_model’
Step 1 – Create Default Flutter App
Step 2 – Replace Application Code
Step 3 – Open Emulator & Run
Summary
Conclusion
29. State & BLoCs w/Streams Approach
Introduction
BLoC Pattern
Reactive Programming
RxDart
StreamBuilder
Exercise – ‘state_and_block_with_streams’
Step 1 – Create Default Flutter App
Step 2 – Add the RxDart Dependency
Step 3 – Replace Application Code
Step 4 – Open Emulator & Run
Summary
Conclusion
Further Reading
30. Local Persistence
Introduction
Your Options
SQLite Database
Introduction
Step 1 – Add Dependencies to Project
Step 2 – Define the Data Model
Step 3 – Open the Database
Retrieve Rows from Database
Executing SQL
Insert into Database
Update Row in Database
Delete Row in Database
Example – ‘sqlite_vocabulary’
Further Reading
Local Files
Introduction
Platform
Path Provider Package
Application Documents Directory
Directories
Files
Directory & File Methods
Reading & Writing Data to a File
Example ‘persistence_files’
Shared Preferences
Introduction
Methods
Further Reading
Example ‘persistence_shared_preferences’
31. Mixins
Introduction
Mixins & Code Generators
Example – ‘mixins’
Source Code
32. Debugging & Performance Profiling
Introduction
Debugging
Profiling
Programmatical Options
Add Debugger Statements
Add Print & DebugPrint Statements
Add Assertions
Service Extensions
Introduction
Performance Overlay
Show Paint Baselines (debugPaintSizeEnabled)
Show Material Grid
Turn Service Extensions On/Off from Android Studio
Turn Service Extensions On/Off from Visual Studio Code
Turn Service Extensions On/Off from Command Line
Turn Service Extensions On/Off Programmatically
Dart Observatory
Introduction
Part of the Dart SDK
Starting the Observatory
Timeline
Profile Mode
Further Reading
Android Studio
Visual Studio Code
Command-Line
Further Reading
33. Change Detection, Keys & Rendering
Introduction
Change Detection
Widgets
Elements
Element Trees
Widgets, Elements, Render Objects
Change Detection & Updates
Detecting Structural Changes
Matching Elements to Widgets
If there is a Match
If there is no Match
Optimizations
Render Tree
Render Objects
Keys
Introduction
Elements May or May Not Store a Reference to State
Elements for Stateless Widgets Have No Reference to any State
Elements for Stateful Widgets Have A Reference to the State
The ‘Losing State’ Problem
Global Keys
Further Reading
34. Other Performance Considerations
Introduction
Http Communication
Single Threaded
Use Constants When Possible
35. Publishing Your App
Introduction
Platform
Example
Release Mode
Further Reading
Android Studio
Visual Studio Code
Command-Line
Android-Specific Files
Dependency Management
iOS-Specific Files
Dependency Management
Application Package Files
APK Files
Mac IPA Files
How Does Deployment Work?
Further Reading
36. Flutter Resources
Introduction
Official Resources
Other Resources
Welcome
Introduction
The purpose of this chapter is to introduce the purpose of
this book and acknowledge those who have made this
book possible. This chapter also contains a disclaimer.
Work
I have to be honest; I also wrote this book for some self-
promotion. After this book is published, I intend to
continue working on apps for my wife’s business and find
some part-time Flutter work. If you are interested, shoot
me an email at [email protected] or communicate
with me via my LinkedIn page here:
https://www.linkedin.com/in/mark-clow-9a61362/.
Disclaimer
Let’s get this over with as quickly as possible. Some of
this information in this book may be incorrect (I am a
human being that makes mistakes) and that this
publication is somewhat opinionated. I am trying my best
to be as technically accurate as possible, but I am still
learning a lot and have much to learn about Flutter and
Dart. I have opinions but please don’t take them too
seriously. I do not intend to harm anything or anyone, I
am not smart enough for that.
Revisions
This book has taken a long time to write and I will
continue to improve it whenever I have time, adding
more content when possible. So, if you get an earlier
version of the book it may be slightly less complete than
later on. If this is the case, email me a proof of purchase
at [email protected] and I will send you a PDF
version, which will be watermarked with your name
(sorry but its prevent copying). I welcome (constructive)
criticism and input so if you have any, please email me at
[email protected].
Example – ‘gesture_app’
The source code for this example is located in
‘gesture_app’.
One File
Another thing to bear in mind is that the exercises have
all been written to use a single file. This was so that there
could be one single continuous listing in the book. In
reality, you would obviously split your project up into
many smaller files.
The Big Picture
Introduction
The purpose of this chapter is to give the reader a quick
introduction to the world of Mobile Application
development, and to introduce him or her the problem of
cross-platform development, and how it was approached
by different companies.
A mobile app or mobile application is a computer
program or software application designed to run on a
mobile device such as a phone/tablet or watch. Writing
mobile apps sounds easy but is complicated by the
number of platforms that are available. Your app could
run on an iPhone, it could run on an iPad, it could run on
an Android Phone etc. Also remember that these
platforms could change quickly as new devices appear on
the market.
XXI.
THAT SWEET BOON—TRIAL BY JURY.
On the day that Dorn Hackett's trial commenced, the little court-
house of Sag Harbor was by no means large enough to contain half
the people who came from all the country around to attend it. From
the neighborhood in which the murder had been committed, they
seemed to have come in a body. Old acquaintances, neighbors,
friends of the prisoner—who had known him since he was a child;
who had heard as fresh the news that his father, William Hackett,
had been swept overboard from a whaler's yard-arm and lost in a
gale, and who had seen the drowned man's little orphan boy grow
up to young manhood among them—were present by dozens; yet
among them all one could hardly hear a few faint expressions of
sympathy for him, or hope for the demonstration of his innocence.
There is nothing for which ignorant people, particularly rustics, are
so ready as the acceptance of the guilt of a person accused legally
of a crime; nothing they resent so deeply as what they believe to be
an attempt to deceive them by a false assumption of innocence. The
discovery of the marked handkerchief in his possession, had been, to
their narrow minds, conclusive evidence of Dorn's guilt and each
man of them felt it an insult to what he deemed his intelligence, that
Dorn had, just before that discovery, betrayed him into a temporary
fear that they might not have the right man after all.
Deacon Harkins, who, by the way, had tried to have Dorn, as a child,
indentured to him by the county overseer of the poor, as soon as he
heard of the drowning of the lad's father—a slavery from which the
boy was saved by the kindness of a good old man, long since dead—
was prominent in the crowd about the court-house, quoting texts
and vaunting the foresight with which he had "always looked
forward to seeing that young man come to a bad end." Aunt
Thatcher, was of course, present, and—as might have been expected
—vindictively exultant. Mary Wallace, having been summoned as a
witness by the prosecution, was compelled to attend, and made her
way through the throng to the county clerk's office, beneath the
court-room, where she was given a seat to wait until she should be
called. Happily there was still humanity enough among the rough
people who were eagerly awaiting the conviction of her lover, to
prompt some little sympathetic feeling for her; and, as she went by,
they at least refrained from saying, in her hearing, that they hoped
Dorn Hackett would be hanged. Aunt Thatcher was incapable of
such delicacy and reserve. She had been saying that daily, and
almost hourly, since she had heard of his arrest, and she continued
to say it now, loudly too, until the disgusted county clerk ordered her
to keep quiet or get out of his office, to which she had forced her
way with Mary.
There was little difficulty in getting a jury, for in those days fewer
newspapers were read than now are; fewer people sought to escape
jury duty by deliberately "forming and expressing opinions relative to
the guilt or innocence of the accused" in advance of the trial; and,
above all, lawyers had not yet developed, as they since have, the
science of delay at that point of the proceedings. Twelve "good men
and true" were selected—perhaps a sample dozen as juries go. One
of them heard with great difficulty; two kept yawning and dropping
asleep from time to time; a fourth belied his looks, if he was not at
least semi-idiotic; three were manifestly weak, simple-minded
persons, devoid of moral force and easy to be influenced by a
stronger will, and the remaining five were evidently men who
doubtless meant to do right, but were obstinate to the verge of pig-
headedness, and showed, by the countenances with which they
regarded the prisoner, that they were already inimical to him. And
before this "jury of his peers" Dorn Hackett stood, to be tried for his
life.
It would be time and space lost to recite the thrilling opening speech
of the prosecuting attorney; to tell how vividly he depicted the
horrors of the crime that had been perpetrated; how artfully he
seemed, by word and gesture, to connect the prisoner with the
crime at every stage of its progress; how scornfully he dwelt upon
"the absurd story by which the murderer had sought to explain away
the damning proofs against him, and which his counsel might have
the audacity to ask this intelligent jury to believe," etc. It was more
like a closing than an opening speech, and when it was ended, five
of the jury looked as if they were satisfied that the proper thing to
do would be to take the prisoner right out and hang him to one of
the big elms beside the court-house.
Mr. Dunn's heart sank within him. What had he to make headway
with against that speech, before those five men and with that fatal
marked handkerchief ever fluttering before his eyes?
The hearing of the witnesses for the State continued slowly all the
first day. All that had been sworn to before the committing
magistrate, was repeated now, and there was really very little more,
but that little was adroitly handled, and the temper of the jury was
to make the most of it. Peter Van Deust produced a great effect
when he gave his testimony as to the identification of the
handkerchief belonging to his murdered brother, which was, in the
language of the prosecutor, cunningly woven into questions
"voluntarily, confidently, and impudently exhibited by the prisoner to
sustain his preposterous story." Poor Mary Wallace had to go on the
stand and testify that Dorn had been with her, walking and
conversing, in the edge of the woods, less than half a mile from the
Van Deust homestead, on the night of the murder, and that he left
her about nine o'clock. Witnesses were brought from New Haven to
testify to Dorn's arrival in that city, the morning after the murder,
with his clothes bloody, head cut, and one ankle sprained; and to his
admissions that he had received those injuries while running through
the woods on Long Island the night before.
"Not," exclaimed the prosecuting-attorney, "as he would have it
believed, long before the murder, but when he was fleeing red-
handed, conscious that the brand of Cain was on his brow!"
The prisoner's counsel protested against this sort of interpolation of
comments, as irregular and unfair, and the court sustained him in
that view, but the majority of the jury looked as if they would have
thanked the prosecutor for expressing their sentiments so forcibly.
Then other witnesses were called to prove, as experts, that a man
would have time after the hour at which it was believed the murder
was committed,—say, at midnight—to run to the Napeague Inlet,
take a sail-boat and reach New Haven early the next morning. One,
indeed, testified that he had tried and accomplished the feat.
And that was all the State had to offer. Still, the popular feeling was
that it was sufficient.
"It would hardly amount to much before a city jury," said the
prosecuting-attorney, in confidential chat with some other lawyers at
the close of the day's proceedings, "but I guess it will be enough
down here."
The jury, at the adjournment of the court for the day, gravely heard
the injunction of the judge, that they "should refrain from talking to
anybody about the case," and then went out and discussed the
evidence with their friends and neighbors.
"The handkerchief must hang him; that's clear," said everybody.
"How could he have had it if he hadn't killed the old man?"
Dorn was remanded back to the jail, where Mary had a little
interview with him, during which she wept almost constantly, and he
spent all his time in trying to console her with loving words and
foolish hopes, so that neither of them said or did anything
particularly reasonable or worthy of the telling here. And then Mary
went back to the room that had been assigned her in the tavern,
and cried so all night, that in the morning her eyes were red and
swollen almost sufficiently to justify in some measure the gratified
assurance of Aunt Thatcher, that she "looked like a fright."
As for Lem Pawlett, it must be admitted that he acted in what
seemed to his friends a most reprehensible and unaccountable
manner. Following even too strictly the injunctions of Mr. Pelatiah
Holden about saying nothing to anybody, he would not even give
them the satisfaction of knowing positively that he had found his
man, and that the much needed evidence would be forthcoming in
due time. He did go so far, under Ruth's most severe pressure, as to
assure her that it would "be all right," but beyond that the little
maiden found that for once her power was set at naught. He felt
resting upon him a responsibility that temporarily out-weighted his
love, and the gravity of his stubborn silence awed the girl, and made
her look upon him with a new respect. But how he suffered! Bearing
alone and in silence his weighty secret, made him feel that virtually
Dorn's salvation depended upon him, and should anything happen
by which that evidence would not be forthcoming, and Dorn be
hanged in consequence of its failure, he would be neither more nor
less than the executioner of his friend. The next most unhappy man
in the town that night, after the prisoner himself, was Lem Pawlett.
When, from sheer exhaustion, he fell asleep, nearly at daylight, he
had a horrid dream that he was tied hand and foot, and powerless
to speak, while his witness was fleeing swiftly away from him on
horseback, and that Dorn was standing before him, under the
gallows-tree, with a noose about his neck and a horrible look of
haunting reproach in his eyes. From that dream he awoke with a
howl of fright, and, fearing to go to sleep again, sprang up, dressed
himself and hurried out into the deserted main street of the still
slumbering town.
He took his way toward the wharf. "Sometimes," he said to himself,
"the packet from New York gets in early; hardly so early as this, but
then she might have had an extraordinary good breeze last night."
His road led him by the jail. He shuddered as he passed the grim,
gray building, for never before had it seemed to him so big, so
strong, so terrible. Not one living thing did he meet in his lonely
walk, and when he reached the wharf the most profound silence
surrounded him. The tide was rising, but without the sound of its
accustomed swash on the piles. Its influx was indicated only by a
slight ripple around the obstacles it met. As far out as he could see
the surface of the bay was as smooth as a mirror. Going down some
slimy green steps to a boat-landing, he dipped one hand into the
water, and held it above his head. There was not even a breath of
air moving. With sullen resignation he seated himself upon a pile of
lumber and waited.
The dawn appeared, then suddenly the sun rose up behind the
town, casting upon the glassy surface of the water before him long
shadows of the tall warehouses, and of the people who now began
to busy themselves in the vicinity. Not the smallest ripple broke the
outlines of those shadows. He looked anxiously up at the sky. Ah!
with what joy he would have seen, in the direction of New York, a
myriad of those ragged fleecy clouds which sailors call "mare's tails,"
and believe to be sure harbingers of wind. But there was not one to
give him hope. The sky looked like a monster dome of unflecked,
burnished brass. It was high tide, and a dead calm.
With a groan he turned away and retraced his steps to the tavern.
An unwonted excitement began to be perceptible in the streets, the
continuation of that of the preceding day. Already people were
flocking in from the country, determined to be nearest the court-
room doors when they were thrown open. The tavern bar-room was
crowded, even before the sleepy bar-keeper had his eyes well
rubbed open, and a sort of general picnic scene was presented by
the people breakfasting on cold lunches in the shade of the elms.
XXII.
IN THE NAME OF JUSTICE.
When the court was opened that morning, at the usual hour, and the
expectant multitude rushed, scrambled, and tumbled in, to fight first
for front places and then for any place at all; the lawyers—who had
entered by the judge's private stairway—were already seated inside
the railing, chatting and laughing with cheerful indifference; the
prisoner, looking worn and haggard, was seated in his place, and the
two drowsy jurymen were already commencing to yawn.
The defence began the presentation of its evidence immediately.
Mary Wallace was recalled to the stand to testify that when her lover
was leaving her on the evening of the night of the murder he told
her that he was going back to New Haven in Mr. Hollis's sloop. But
the prosecuting attorney objected, and the court ruled that the
prisoner's statements at that time were not admissible. Mr. Hollis, of
New Haven, bore witness that Dorn had come over from New Haven
with him that evening, had said that he might not return that night,
and did not return to the beach at the appointed hour to accompany
him back. Altogether, Mr. Hollis's evidence was rather injurious than
otherwise, and the prosecuting attorney looked pleased as he made
a note of it. Lem Pawlett was called to testify that the tracks left by
the murderer in the soft earth of Mr. Van Deust's garden were those
of a man wearing high-heeled, fashionable boots or shoes, and
having much smaller feet than Dorn Hackett; but as he had taken no
measurements of them, and only judged from memory, and didn't
know the size of Dorn's feet, and was, as he readily admitted, a
friend of the prisoner, the prosecuting attorney in cross-examination
made it to be inferred from his manner, that there was no doubt in
his mind that the witness was deliberately perjuring himself in the
hope of helping the case of the accused. And at least five of the jury
responsively looked as if that was the way they felt about it.
Then witnesses were put forward as sea-faring experts to prove that
on the night of the murder there was almost a dead calm on the
water, such as would have made it impossible for a sail-boat to go
from Napeague Inlet to New Haven in the time that it was claimed
by the prosecution Dorn had gone. But when the prosecuting-
attorney got to bullying and confusing them in cross-examination, he
made them say that they could not really swear whether the calm
was that night, or the night before, or the night after, or two or
three nights distant either way; and one of them even admitted that
perhaps it might have blown a gale on that particular night, for all
he was now prepared to make oath to about it. Simple-minded
people, who do not know how much more lawyers bark than bite,
when going through the ordeal of cross-examination are apt to feel
much as the toad proverbially does when he finds himself under the
harrow.
Things were going swimmingly for the prosecution. The defence was
forced to fall back upon its last and always weakest intrenchment—
proof of previous good character and reputation. A few persons were
found to swear that they had known Dorn Hackett from his boyhood,
and had always considered him honest, industrious, truthful and
kind-hearted, and they were confident that such was his general
reputation. Uncle Thatcher was one of those witnesses, at his own
request, and the prosecuting attorney, who had, in some mysterious
way, learned much more than he should have been permitted to
know about the witnesses for the defence, asked him sneeringly:
"Did not this excellent young man, about three years ago, perpetrate
an unprovoked and brutal assault on your son?"
"No, sir," replied, the old man sternly. "He thrashed him, as he
deserved, for a contemptible action."
But all those witnesses to good character had to admit that they had
known nothing of Dorn for three years past, during which time he
had been away from the village—whaling, it was said, but for all
they knew to the contrary he might have been living the most
vicious and ill-regulated life in some big city. Then a stronger witness
in that direction took the stand, Mr. Merriwether, of New Haven,
owner of the schooner of which Dorn was master, and he could, and
did, swear positively that he knew Dorn had been on a three years'
whaling voyage, had since been steadily in his employ, and was in all
respects moral, sober, and an entirely trustworthy young man of
irreproachable character. The prosecuting attorney seeing that this
witness was one who could not be easily bluffed or confused,
contented himself with asking:
"You are his employer, are you not?"
"Yes, sir."
"And interested in getting him back to work for you, as you deem
him a good sailor?"
"Yes, sir. But—"
"Never mind. That will do, sir. I am through with this witness." And
the prosecutor sat down, looking with a scornful smile toward the
jury, as if he would have said to them confidentially: "You see this
man cares nothing whether the prisoner is guilty, or not, of all the
crimes forbidden by the Decalogue, if he only serves him well."
In those days, a person accused was not permitted to go upon the
stand in his own behalf and give his testimony, under the sanctity of
an oath, as is now allowed him by the law. Then, he might be
granted the privilege of making his statement, but it would be
merely a statement, and the prosecution was very careful always,
when a prisoner thus spoke for himself, to impress upon the jury
that his unsworn affirmation of innocence was of no value whatever,
when weighed in the balance against other men's affidavits. Stress
would be laid upon the time and knowledge the accused had had to
enable his preparation of his own version of the affair, and undue
prominence and importance given to the fact that he could not be
cross-examined. In this way an artful prosecutor could generally
neutralize all good effect the accused might otherwise produce, if
not, indeed, make the poor wretch's asseverations of innocence
absolutely harmful to him, by stirring up the suspicion, antagonism,
and secret consciousness of infallibility in the minds of the jury, who
resent attempts to deceive them.
Dorn was duly warned of this, yet he persisted in demanding to be
allowed to tell his own story, and the court granted him permission
to do so. He told it simply, clearly, and truthfully, as he had told it
before to Lem, to Mary, to his lawyer, and to the magistrate who
committed him, but he made no new converts to his innocence now
—unless it might have been the clear-sighted and experienced old
judge on the bench, who believed that he heard the ring of truth in
the young man's voice, and saw honesty in his frank, manly face.
But at the conclusion of the statement, as Dorn left the stand and
returned to his seat by his counsel, the prosecuting attorney silently
held aloft before the jury the marked and identified handkerchief,
and that action was more conclusive in its effect upon their minds
than all that the prisoner had said. Looking upon their faces, the
lawyer for the defence murmured to himself, "We are lost!"
As the day wore on Lem Pawlett was in agony, for his witness did
not appear. It made him dizzy and sick to see one witness after
another leaving the stand in such rapid succession, for he did not
know how soon the supply of them would run out, and the weak
defence be compelled to close before the one upon whom all
depended should make his appearance. "Why had he not come? The
boat was due many hours ago, and had not yet arrived! Becalmed,
doubtless, on this one day of all the days in the year. Perhaps he
might not be aboard. He might be sick. What if he should be a
cunning villain, the real criminal, for all his smooth exterior, who had
purposely given that handkerchief to Dorn to cast the guilt
apparently on him? He smiled when it was mentioned. And now he
might be flying far away." These thoughts almost maddened Lem.
Bitterly he reproached himself that he had not staid in New York and
kept his witness under his eye until the last moment, and brought
him along by force, if necessary. Again and again he was tempted to
make his way to Mr. Dunn, and urge him to fight the day through by
all means; but each time he remembered what Mr. Holden had said
the prisoner's counsel must be, and refrained. Parched with thirst,
and blazing with fever, yet with a cold perspiration breaking out all
over him, poor Lem could hardly understand half that was going on.
But when Dorn's lawyer arose and said, "May it please the court, the
defence rests," the words came to his ears like a clap of thunder. It
seemed to him that that was the last moment of grace, and he
staggered to his feet, trying to say something; to cry a halt; to
appeal to the judge for time; to do, he did not know what. But his
tongue clave to the roof of his mouth, and a deputy sheriff, seeing
him standing there, waving his arms and looking as if he was about
to speak, shouted at him with such an awful voice, "Silence in the
court," that he sank down, stunned and speechless in his place, as
helpless as he had been in that awful dream of the night before.
The prosecuting attorney began summing up to the jury. If he was
forcible in the opening, he was terrible now. Of course he assumed
that a clear case had been made out, as prosecutors always do; that
"there was no moral doubt of the guilt of the accused, any more
than if the jury had actually beheld him battering in the skull of his
aged victim, wiping the dripping blood from his hands upon the
raiment of the corpse, and clutching the gold, for lust of which he
had done this hideous deed." [Five of the jury looked as if they quite
agreed with him; three others glanced timidly and furtively at the
faces of the five, as if to read there what they too should think about
it; the sleepy men were very wide awake now, having had a good
nap while the evidence as to character was being introduced; and
the deaf man had both hands up to his ears to enable him to hear
better, for if there is anything that country people do love, it is a
good strong speech.]
In the midst of one of his most vigorous declamatory efforts the eye
of the prosecutor caught sight of the judge, who was sitting with
upraised gavel and a look as if he was only waiting for the end of a
sentence to arrest his progress. The speaker stopped, and the judge,
laying down his gavel, held up a note and said:
"I am in receipt of a communication which is, if written in good faith
—that is, by the person whose name is signed to it—of so very
important a character, and has such a decided bearing upon the
interests of justice in this case, that I feel it would be in the highest
degree unwise to ignore it. I will therefore ask the prosecuting
attorney to have the kindness to at least postpone for a short time
the continuation of his address to the jury. The court will now take a
recess for half an hour."
The densely packed and excited audience hardly waited the
conclusion of the sheriff's formal repetition of the formal order of the
court, to break out into a loud murmur of exclamations, conjecture,
and discussion as to what the important communication might be.
The judge, upon rising from his seat, made a sign to the prosecuting
attorney and the counsel for the defence to accompany him to his
room, and the trio went out by the private door, which they closed
behind them.
"What is it, Lem? What do you suppose they are going to do now?"
Ruth asked anxiously of the young man, who sat in a semi-inanimate
condition at her side, and who actually had not heard a word of
what the judge had said. He started from his dream, into which
reality had again plunged him, and replied miserably:
"I don't know. Hang him, I suppose."
"Don't talk nonsense, Lem. What's the matter with you? Wake up.
Didn't you hear what the judge said about his receiving an important
communication that had a decided bearing, and all that?"
"Did he?"
"Yes, 'a decided bearing upon the interests of justice in this case.'
Those were his very words; and he held up a letter."
"Then it's all right now, Ruth! All right at last! He has come! He has
come!"
"Who has come?"
"The man who will save Dorn Hackett."
XXIII.
TURNING OF THE TIDE.
XXIV.
THE HAND OF PROVIDENCE.
"What is your name?" demanded the judge of the young man thus
brought before him.
The fellow hesitated an instant, and a lie trembled on his lips; but
then looking around and seeing many who could identify him, he
knew that falsehood would be useless, and sullenly replied:
"Silas Thatcher."
"Where do you live?"
"On Hester Street, near the Bowery, in New York."
"What is your business?"
"Haint got none."
"What have you to say in reply to the statement which you have just
heard made by this gentleman, to the effect that you sold this seal
to him?"
"Nothin'," answered Silas after a little hesitation.
"Nothing? But do you not understand, young man, that this may be
a very serious matter? I do not ask you that you may criminate
yourself in any way, but with the hope that if you have any
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com