100% found this document useful (5 votes)
23 views59 pages

Flutter Recipes: Mobile Development Solutions For iOS and Android Fu Cheng - The Ebook in PDF and DOCX Formats Is Ready For Download Now

The document promotes various eBooks available for download at textbookfull.com, focusing on mobile app development using frameworks like Flutter and Ionic, as well as topics such as mobile forensics and Java for Android development. It provides links to specific titles authored by Fu Cheng and others, detailing their content and relevance. Additionally, it includes information on the structure and setup of Flutter applications, along with troubleshooting tips and resources for readers.

Uploaded by

heijerkrruta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (5 votes)
23 views59 pages

Flutter Recipes: Mobile Development Solutions For iOS and Android Fu Cheng - The Ebook in PDF and DOCX Formats Is Ready For Download Now

The document promotes various eBooks available for download at textbookfull.com, focusing on mobile app development using frameworks like Flutter and Ionic, as well as topics such as mobile forensics and Java for Android development. It provides links to specific titles authored by Fu Cheng and others, detailing their content and relevance. Additionally, it includes information on the structure and setup of Flutter applications, along with troubleshooting tips and resources for readers.

Uploaded by

heijerkrruta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

Explore the full ebook collection and download it now at textbookfull.

com

Flutter Recipes: Mobile Development Solutions for


iOS and Android Fu Cheng

https://textbookfull.com/product/flutter-recipes-mobile-
development-solutions-for-ios-and-android-fu-cheng/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://textbookfull.com


Click here to visit textbookfull.com and download textbook now
Your digital treasures (PDF, ePub, MOBI) await
Download instantly and pick your perfect format...

Read anywhere, anytime, on any device!

Build Mobile Apps with Ionic 2 and Firebase: Hybrid Mobile


App Development 1st Edition Fu Cheng

https://textbookfull.com/product/build-mobile-apps-with-ionic-2-and-
firebase-hybrid-mobile-app-development-1st-edition-fu-cheng/

textbookfull.com

Build Mobile Apps with Ionic 4 and Firebase: Hybrid Mobile


App Development [Lingua inglese] 2nd Edition Fu Cheng

https://textbookfull.com/product/build-mobile-apps-with-ionic-4-and-
firebase-hybrid-mobile-app-development-lingua-inglese-2nd-edition-fu-
cheng/
textbookfull.com

Developing Inclusive Mobile Apps: Building Accessible Apps


for iOS and Android 1st Edition Rob Whitaker

https://textbookfull.com/product/developing-inclusive-mobile-apps-
building-accessible-apps-for-ios-and-android-1st-edition-rob-whitaker/

textbookfull.com

Practical Mobile Forensics A hands on guide to mastering


mobile forensics for the iOS Android and the Windows Phone
platforms 3rd Edition Rohit Tamma
https://textbookfull.com/product/practical-mobile-forensics-a-hands-
on-guide-to-mastering-mobile-forensics-for-the-ios-android-and-the-
windows-phone-platforms-3rd-edition-rohit-tamma/
textbookfull.com
Learn Java for Android Development: Migrating Java SE
Programming Skills to Mobile Development 4th Edition Peter
Späth
https://textbookfull.com/product/learn-java-for-android-development-
migrating-java-se-programming-skills-to-mobile-development-4th-
edition-peter-spath/
textbookfull.com

Android Continuous Integration: Build-Deploy-Test


Automation for Android Mobile Apps Pradeep Macharla

https://textbookfull.com/product/android-continuous-integration-build-
deploy-test-automation-for-android-mobile-apps-pradeep-macharla/

textbookfull.com

Android Cookbook Problems and Solutions for Android


Developers 2nd Edition Ian F. Darwin

https://textbookfull.com/product/android-cookbook-problems-and-
solutions-for-android-developers-2nd-edition-ian-f-darwin/

textbookfull.com

iOS 11 Swift Programming Cookbook Solutions and Examples


for iOS Apps 1st Edition Vandad Nahavandipoor

https://textbookfull.com/product/ios-11-swift-programming-cookbook-
solutions-and-examples-for-ios-apps-1st-edition-vandad-nahavandipoor/

textbookfull.com

Learn Java for Android Development Friesen Jeff

https://textbookfull.com/product/learn-java-for-android-development-
friesen-jeff/

textbookfull.com
Flutter
Recipes
Mobile Development Solutions for
iOS and Android

Fu Cheng
Flutter Recipes
Mobile Development Solutions
for iOS and Android

Fu Cheng
Flutter Recipes: Mobile Development Solutions for iOS and Android
Fu Cheng
Sandringham, Auckland, New Zealand

ISBN-13 (pbk): 978-1-4842-4981-9 ISBN-13 (electronic): 978-1-4842-4982-6


https://doi.org/10.1007/978-1-4842-4982-6

Copyright © 2019 by Fu Cheng


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole
or part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical
way, and transmission or information storage and retrieval, electronic adaptation, computer
software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a
trademark symbol with every occurrence of a trademarked name, logo, or image we use the
names, logos, and images only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms,
even if they are not identified as such, is not to be taken as an expression of opinion as to
whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the
date of publication, neither the authors nor the editors nor the publisher can accept any
legal responsibility for any errors or omissions that may be made. The publisher makes no
warranty, express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Aaron Black
Development Editor: James Markham
Coordinating Editor: Jessica Vakili
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201)
348-4505, e-mail [email protected], or visit www.springeronline.com. Apress
Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business
Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected], or visit http://www.
apress.com/rights-permissions.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our
Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is
available to readers on GitHub via the book’s product page, located at www.apress.com/
978-1-4842-4981-9. For more detailed information, please visit http://www.apress.com/
source-code.
Printed on acid-free paper
Table of Contents
About the Author����������������������������������������������������������������������������� xxxi

About the Technical Reviewer������������������������������������������������������� xxxiii

Chapter 1: Get Started��������������������������������������������������������������������������1


1-1. Installing Flutter SDK on Windows���������������������������������������������������������������� 1
Problem����������������������������������������������������������������������������������������������������������� 1
Solution����������������������������������������������������������������������������������������������������������� 1
Discussion������������������������������������������������������������������������������������������������������� 1
1-2. Installing Flutter SDK on Linux���������������������������������������������������������������������� 4
Problem����������������������������������������������������������������������������������������������������������� 4
Solution����������������������������������������������������������������������������������������������������������� 4
Discussion������������������������������������������������������������������������������������������������������� 4
1-3. Installing Flutter SDK on macOS�������������������������������������������������������������������� 5
Problem����������������������������������������������������������������������������������������������������������� 5
Solution����������������������������������������������������������������������������������������������������������� 6
Discussion������������������������������������������������������������������������������������������������������� 6
1-4. Setting Up iOS Platform��������������������������������������������������������������������������������� 7
Problem����������������������������������������������������������������������������������������������������������� 7
Solution����������������������������������������������������������������������������������������������������������� 7
Discussion������������������������������������������������������������������������������������������������������� 7
1-5. Setting Up iOS Simulators����������������������������������������������������������������������������� 9
Problem����������������������������������������������������������������������������������������������������������� 9
Solution����������������������������������������������������������������������������������������������������������� 9
Discussion������������������������������������������������������������������������������������������������������� 9
iii
Table of Contents

1-6. Setting Up iOS Devices����������������������������������������������������������������������������������9


Problem�����������������������������������������������������������������������������������������������������������9
Solution�����������������������������������������������������������������������������������������������������������9
Discussion�����������������������������������������������������������������������������������������������������10
1-7. Setting Up Android Platform������������������������������������������������������������������������11
Problem���������������������������������������������������������������������������������������������������������11
Solution���������������������������������������������������������������������������������������������������������11
Discussion�����������������������������������������������������������������������������������������������������11
1-8. Setting Up Android Emulators����������������������������������������������������������������������13
Problem���������������������������������������������������������������������������������������������������������13
Solution���������������������������������������������������������������������������������������������������������13
Discussion�����������������������������������������������������������������������������������������������������13
1-9. Setting Up Android Devices�������������������������������������������������������������������������18
Problem���������������������������������������������������������������������������������������������������������18
Solution���������������������������������������������������������������������������������������������������������18
Discussion�����������������������������������������������������������������������������������������������������18
1-10. Creating Flutter Apps Using Command Line����������������������������������������������19
Problem���������������������������������������������������������������������������������������������������������19
Solution���������������������������������������������������������������������������������������������������������19
Discussion�����������������������������������������������������������������������������������������������������19
1-11. Creating Flutter Apps Using Android Studio�����������������������������������������������20
Problem���������������������������������������������������������������������������������������������������������20
Solution���������������������������������������������������������������������������������������������������������20
Discussion�����������������������������������������������������������������������������������������������������20
1-12. Creating Flutter Apps Using VS Code���������������������������������������������������������24
Problem���������������������������������������������������������������������������������������������������������24
Solution���������������������������������������������������������������������������������������������������������24
Discussion�����������������������������������������������������������������������������������������������������25

iv
Table of Contents

1-13. Running Flutter Apps���������������������������������������������������������������������������������26


Problem���������������������������������������������������������������������������������������������������������26
Solution���������������������������������������������������������������������������������������������������������26
Discussion�����������������������������������������������������������������������������������������������������26
1-14. Understanding Code Structure of Flutter Apps������������������������������������������27
Problem���������������������������������������������������������������������������������������������������������27
Solution���������������������������������������������������������������������������������������������������������27
Discussion�����������������������������������������������������������������������������������������������������27
1-15. Fixing Configuration Issues of Flutter SDK������������������������������������������������28
Problem���������������������������������������������������������������������������������������������������������28
Solution���������������������������������������������������������������������������������������������������������28
Discussion�����������������������������������������������������������������������������������������������������28
1-16. Summary���������������������������������������������������������������������������������������������������28

Chapter 2: Know the Tools������������������������������������������������������������������29


2-1. Using Dart Observatory�������������������������������������������������������������������������������29
Problem���������������������������������������������������������������������������������������������������������29
Solution���������������������������������������������������������������������������������������������������������29
Discussion�����������������������������������������������������������������������������������������������������29
2-2. Using Hot Reload and Hot Restart���������������������������������������������������������������31
Problem���������������������������������������������������������������������������������������������������������31
Solution���������������������������������������������������������������������������������������������������������31
Discussion�����������������������������������������������������������������������������������������������������32
2-3. Upgrading Flutter SDK���������������������������������������������������������������������������������34
Problem���������������������������������������������������������������������������������������������������������34
Solution���������������������������������������������������������������������������������������������������������34
Discussion�����������������������������������������������������������������������������������������������������35

v
Table of Contents

2-4. Debugging Flutter Apps in Android Studio���������������������������������������������������36


Problem���������������������������������������������������������������������������������������������������������36
Solution���������������������������������������������������������������������������������������������������������36
Discussion�����������������������������������������������������������������������������������������������������36
2-5. Viewing Outline of Flutter Apps in Android Studio���������������������������������������39
Problem���������������������������������������������������������������������������������������������������������39
Solution���������������������������������������������������������������������������������������������������������39
Discussion�����������������������������������������������������������������������������������������������������40
2-6. Debugging Flutter Apps in VS Code�������������������������������������������������������������41
Problem���������������������������������������������������������������������������������������������������������41
Solution���������������������������������������������������������������������������������������������������������41
Discussion�����������������������������������������������������������������������������������������������������41
2-7. Creating Flutter Projects������������������������������������������������������������������������������42
Problem���������������������������������������������������������������������������������������������������������42
Solution���������������������������������������������������������������������������������������������������������42
Discussion�����������������������������������������������������������������������������������������������������43
2-8. Running Flutter Apps�����������������������������������������������������������������������������������46
Problem���������������������������������������������������������������������������������������������������������46
Solution���������������������������������������������������������������������������������������������������������46
Discussion�����������������������������������������������������������������������������������������������������46
2-9. Building Flutter App Binaries�����������������������������������������������������������������������51
Problem���������������������������������������������������������������������������������������������������������51
Solution���������������������������������������������������������������������������������������������������������51
Discussion�����������������������������������������������������������������������������������������������������51
2-10. Installing Flutter Apps��������������������������������������������������������������������������������53
Problem���������������������������������������������������������������������������������������������������������53
Solution���������������������������������������������������������������������������������������������������������53
Discussion�����������������������������������������������������������������������������������������������������53

vi
Table of Contents

2-11. Managing Packages����������������������������������������������������������������������������������54


Problem���������������������������������������������������������������������������������������������������������54
Solution���������������������������������������������������������������������������������������������������������54
Discussion�����������������������������������������������������������������������������������������������������54
2-12. Running Flutter Tests���������������������������������������������������������������������������������56
Problem���������������������������������������������������������������������������������������������������������56
Solution���������������������������������������������������������������������������������������������������������56
Discussion�����������������������������������������������������������������������������������������������������56
2-13. Analyzing the Code������������������������������������������������������������������������������������58
Problem���������������������������������������������������������������������������������������������������������58
Solution���������������������������������������������������������������������������������������������������������59
Discussion�����������������������������������������������������������������������������������������������������59
2-14. Managing Emulators����������������������������������������������������������������������������������61
Problem���������������������������������������������������������������������������������������������������������61
Solution���������������������������������������������������������������������������������������������������������61
Discussion�����������������������������������������������������������������������������������������������������61
2-15. Taking Screenshots�����������������������������������������������������������������������������������62
Problem���������������������������������������������������������������������������������������������������������62
Solution���������������������������������������������������������������������������������������������������������62
Discussion�����������������������������������������������������������������������������������������������������62
2-16. Attaching to Running Apps������������������������������������������������������������������������63
Problem���������������������������������������������������������������������������������������������������������63
Solution���������������������������������������������������������������������������������������������������������63
Discussion�����������������������������������������������������������������������������������������������������64
2-17. Tracing Running Flutter Apps���������������������������������������������������������������������65
Problem���������������������������������������������������������������������������������������������������������65
Solution���������������������������������������������������������������������������������������������������������65
Discussion�����������������������������������������������������������������������������������������������������65

vii
Table of Contents

2-18. Configuring Flutter SDK�����������������������������������������������������������������������������66


Problem���������������������������������������������������������������������������������������������������������66
Solution���������������������������������������������������������������������������������������������������������66
Discussion�����������������������������������������������������������������������������������������������������66
2-19. Showing App Logs�������������������������������������������������������������������������������������67
Problem���������������������������������������������������������������������������������������������������������67
Solution���������������������������������������������������������������������������������������������������������67
Discussion�����������������������������������������������������������������������������������������������������68
2-20. Formatting Source Code����������������������������������������������������������������������������68
Problem���������������������������������������������������������������������������������������������������������68
Solution���������������������������������������������������������������������������������������������������������69
Discussion�����������������������������������������������������������������������������������������������������69
2-21. Listing Connected Devices������������������������������������������������������������������������70
Problem���������������������������������������������������������������������������������������������������������70
Solution���������������������������������������������������������������������������������������������������������70
Discussion�����������������������������������������������������������������������������������������������������70
2-22. Running Integration Tests��������������������������������������������������������������������������70
Problem���������������������������������������������������������������������������������������������������������70
Solution���������������������������������������������������������������������������������������������������������71
Discussion�����������������������������������������������������������������������������������������������������71
2-23. Enabling Bash Completion of Flutter SDK Commands�������������������������������72
Problem���������������������������������������������������������������������������������������������������������72
Solution���������������������������������������������������������������������������������������������������������72
Discussion�����������������������������������������������������������������������������������������������������72
2-24. Cleaning Build Files of Flutter Apps�����������������������������������������������������������74
Problem���������������������������������������������������������������������������������������������������������74
Solution���������������������������������������������������������������������������������������������������������74
Discussion�����������������������������������������������������������������������������������������������������74

viii
Table of Contents

2-25. Managing Flutter SDK Cache���������������������������������������������������������������������74


Problem���������������������������������������������������������������������������������������������������������74
Solution���������������������������������������������������������������������������������������������������������74
Discussion�����������������������������������������������������������������������������������������������������75
2-26. Summary���������������������������������������������������������������������������������������������������75

Chapter 3: Essential Dart��������������������������������������������������������������������77


3-1. Understanding Built-In Types�����������������������������������������������������������������������77
Problem���������������������������������������������������������������������������������������������������������77
Solution���������������������������������������������������������������������������������������������������������77
Discussion�����������������������������������������������������������������������������������������������������77
3-2. Using Enumerated Types�����������������������������������������������������������������������������81
Problem���������������������������������������������������������������������������������������������������������81
Solution���������������������������������������������������������������������������������������������������������81
Discussion�����������������������������������������������������������������������������������������������������82
3-3. Using Dynamic Type������������������������������������������������������������������������������������83
Problem���������������������������������������������������������������������������������������������������������83
Solution���������������������������������������������������������������������������������������������������������83
Discussion�����������������������������������������������������������������������������������������������������83
3-4. Understanding Functions�����������������������������������������������������������������������������84
Problem���������������������������������������������������������������������������������������������������������84
Solution���������������������������������������������������������������������������������������������������������84
Discussion�����������������������������������������������������������������������������������������������������84
3-5. Using Typedefs��������������������������������������������������������������������������������������������86
Problem���������������������������������������������������������������������������������������������������������86
Solution���������������������������������������������������������������������������������������������������������86
Discussion�����������������������������������������������������������������������������������������������������86

ix
Table of Contents

3-6. Using Cascade Operator������������������������������������������������������������������������������87


Problem���������������������������������������������������������������������������������������������������������87
Solution���������������������������������������������������������������������������������������������������������87
Discussion�����������������������������������������������������������������������������������������������������87
3-7. Overriding Operators�����������������������������������������������������������������������������������88
Problem���������������������������������������������������������������������������������������������������������88
Solution���������������������������������������������������������������������������������������������������������88
Discussion�����������������������������������������������������������������������������������������������������88
3-8. Using Constructors��������������������������������������������������������������������������������������89
Problem���������������������������������������������������������������������������������������������������������89
Solution���������������������������������������������������������������������������������������������������������89
Discussion�����������������������������������������������������������������������������������������������������90
3-9. Extending a Class����������������������������������������������������������������������������������������92
Problem���������������������������������������������������������������������������������������������������������92
Solution���������������������������������������������������������������������������������������������������������92
Discussion�����������������������������������������������������������������������������������������������������92
3-10. Adding Features to a Class������������������������������������������������������������������������94
Problem���������������������������������������������������������������������������������������������������������94
Solution���������������������������������������������������������������������������������������������������������94
Discussion�����������������������������������������������������������������������������������������������������94
3-11. Using Interfaces�����������������������������������������������������������������������������������������96
Problem���������������������������������������������������������������������������������������������������������96
Solution���������������������������������������������������������������������������������������������������������96
Discussion�����������������������������������������������������������������������������������������������������96
3-12. Using Generics�������������������������������������������������������������������������������������������97
Problem���������������������������������������������������������������������������������������������������������97
Solution���������������������������������������������������������������������������������������������������������97
Discussion�����������������������������������������������������������������������������������������������������98

x
Table of Contents

3-13. Using Libraries�����������������������������������������������������������������������������������������100


Problem�������������������������������������������������������������������������������������������������������100
Solution�������������������������������������������������������������������������������������������������������100
Discussion���������������������������������������������������������������������������������������������������100
3-14. Using Exceptions�������������������������������������������������������������������������������������101
Problem�������������������������������������������������������������������������������������������������������101
Solution�������������������������������������������������������������������������������������������������������101
Discussion���������������������������������������������������������������������������������������������������101
3-15. Summary�������������������������������������������������������������������������������������������������104

Chapter 4: Widget Basics�����������������������������������������������������������������105


4-1. Understanding Widgets�����������������������������������������������������������������������������105
Problem�������������������������������������������������������������������������������������������������������105
Solution�������������������������������������������������������������������������������������������������������105
Discussion���������������������������������������������������������������������������������������������������105
4-2. Understanding BuildContext����������������������������������������������������������������������108
Problem�������������������������������������������������������������������������������������������������������108
Solution�������������������������������������������������������������������������������������������������������109
Discussion���������������������������������������������������������������������������������������������������109
4-3. Understanding Stateless Widget���������������������������������������������������������������111
Problem�������������������������������������������������������������������������������������������������������111
Solution�������������������������������������������������������������������������������������������������������111
Discussion���������������������������������������������������������������������������������������������������111
4-4. Understanding Stateful Widget������������������������������������������������������������������112
Problem�������������������������������������������������������������������������������������������������������112
Solution�������������������������������������������������������������������������������������������������������112
Discussion���������������������������������������������������������������������������������������������������112

xi
Table of Contents

4-5. Understanding Inherited Widget����������������������������������������������������������������113


Problem�������������������������������������������������������������������������������������������������������113
Solution�������������������������������������������������������������������������������������������������������113
Discussion���������������������������������������������������������������������������������������������������113
4-6. Displaying Text�������������������������������������������������������������������������������������������116
Problem�������������������������������������������������������������������������������������������������������116
Solution�������������������������������������������������������������������������������������������������������116
Discussion���������������������������������������������������������������������������������������������������116
Text��������������������������������������������������������������������������������������������������������������116
TextSpan������������������������������������������������������������������������������������������������������119
RichText�������������������������������������������������������������������������������������������������������121
4-7. Applying Styles to Text�������������������������������������������������������������������������������122
Problem�������������������������������������������������������������������������������������������������������122
Solution�������������������������������������������������������������������������������������������������������122
Discussion���������������������������������������������������������������������������������������������������122
4-8. Displaying Images�������������������������������������������������������������������������������������126
Problem�������������������������������������������������������������������������������������������������������126
Solution�������������������������������������������������������������������������������������������������������126
Discussion���������������������������������������������������������������������������������������������������126
4-9. Displaying Icons����������������������������������������������������������������������������������������128
Problem�������������������������������������������������������������������������������������������������������128
Solution�������������������������������������������������������������������������������������������������������128
Discussion���������������������������������������������������������������������������������������������������128
4-10. Using Buttons with Text���������������������������������������������������������������������������130
Problem�������������������������������������������������������������������������������������������������������130
Solution�������������������������������������������������������������������������������������������������������130
Discussion���������������������������������������������������������������������������������������������������130

xii
Table of Contents

4-11. Using Buttons with Icons�������������������������������������������������������������������������132


Problem�������������������������������������������������������������������������������������������������������132
Solution�������������������������������������������������������������������������������������������������������132
Discussion���������������������������������������������������������������������������������������������������132
4-12. Adding Placeholders��������������������������������������������������������������������������������133
Problem�������������������������������������������������������������������������������������������������������133
Solution�������������������������������������������������������������������������������������������������������133
Discussion���������������������������������������������������������������������������������������������������133
4-13. Summary�������������������������������������������������������������������������������������������������134

Chapter 5: Layout Widgets����������������������������������������������������������������135


5-1. Understanding Layout in Flutter����������������������������������������������������������������135
Problem�������������������������������������������������������������������������������������������������������135
Solution�������������������������������������������������������������������������������������������������������135
Discussion���������������������������������������������������������������������������������������������������135
RenderObject�����������������������������������������������������������������������������������������������137
BoxConstraints��������������������������������������������������������������������������������������������138
Layout Algorithm�����������������������������������������������������������������������������������������138
Layout Widgets��������������������������������������������������������������������������������������������139
5-2. Placing Widgets in the Center�������������������������������������������������������������������139
Problem�������������������������������������������������������������������������������������������������������139
Solution�������������������������������������������������������������������������������������������������������139
Discussion���������������������������������������������������������������������������������������������������139
5-3. Aligning Widgets����������������������������������������������������������������������������������������140
Problem�������������������������������������������������������������������������������������������������������140
Solution�������������������������������������������������������������������������������������������������������140
Discussion���������������������������������������������������������������������������������������������������140

xiii
Table of Contents

5-4. Imposing Constraints on Widgets��������������������������������������������������������������144


Problem�������������������������������������������������������������������������������������������������������144
Solution�������������������������������������������������������������������������������������������������������144
Discussion���������������������������������������������������������������������������������������������������144
5-5. Imposing No Constraints on Widgets���������������������������������������������������������146
Problem�������������������������������������������������������������������������������������������������������146
Solution�������������������������������������������������������������������������������������������������������147
Discussion���������������������������������������������������������������������������������������������������147
5-6. Imposing Constraints on Widgets when Ignoring Parents�������������������������148
Problem�������������������������������������������������������������������������������������������������������148
Solution�������������������������������������������������������������������������������������������������������148
Discussion���������������������������������������������������������������������������������������������������148
5-7. Limiting Size to Allow Child Widget to Overflow����������������������������������������149
Problem�������������������������������������������������������������������������������������������������������149
Solution�������������������������������������������������������������������������������������������������������149
Discussion���������������������������������������������������������������������������������������������������150
5-8. Limiting Widgets Size when Unbounded���������������������������������������������������150
Problem�������������������������������������������������������������������������������������������������������150
Solution�������������������������������������������������������������������������������������������������������150
Discussion���������������������������������������������������������������������������������������������������151
5-9. Scaling and Positioning Widgets���������������������������������������������������������������151
Problem�������������������������������������������������������������������������������������������������������151
Solution�������������������������������������������������������������������������������������������������������151
Discussion���������������������������������������������������������������������������������������������������152
5-10. Rotating Widgets�������������������������������������������������������������������������������������156
Problem�������������������������������������������������������������������������������������������������������156
Solution�������������������������������������������������������������������������������������������������������156
Discussion���������������������������������������������������������������������������������������������������156

xiv
Table of Contents

5-11. Adding Padding when Displaying Widgets����������������������������������������������156


Problem�������������������������������������������������������������������������������������������������������156
Solution�������������������������������������������������������������������������������������������������������157
Discussion���������������������������������������������������������������������������������������������������157
5-12. Sizing Widgets to Aspect Ratio����������������������������������������������������������������158
Problem�������������������������������������������������������������������������������������������������������158
Solution�������������������������������������������������������������������������������������������������������158
Discussion���������������������������������������������������������������������������������������������������158
5-13. Transforming Widgets������������������������������������������������������������������������������160
Problem�������������������������������������������������������������������������������������������������������160
Solution�������������������������������������������������������������������������������������������������������160
Discussion���������������������������������������������������������������������������������������������������160
5-14. Controlling Different Layout Aspects on a Widget�����������������������������������161
Problem�������������������������������������������������������������������������������������������������������161
Solution�������������������������������������������������������������������������������������������������������161
Discussion���������������������������������������������������������������������������������������������������162
5-15. Implementing Flex Box Layout����������������������������������������������������������������164
Problem�������������������������������������������������������������������������������������������������������164
Solution�������������������������������������������������������������������������������������������������������164
Discussion���������������������������������������������������������������������������������������������������165
Flex Box Layout Algorithm���������������������������������������������������������������������������165
Flexible��������������������������������������������������������������������������������������������������������168
5-16. Displaying Overlapping Widgets��������������������������������������������������������������169
Problem�������������������������������������������������������������������������������������������������������169
Solution�������������������������������������������������������������������������������������������������������169
Discussion���������������������������������������������������������������������������������������������������169

xv
Table of Contents

5-17. Displaying Widgets in Multiple Runs�������������������������������������������������������171


Problem�������������������������������������������������������������������������������������������������������171
Solution�������������������������������������������������������������������������������������������������������171
Problem�������������������������������������������������������������������������������������������������������171
5-18. Creating Custom Single Child Layout������������������������������������������������������173
Problem�������������������������������������������������������������������������������������������������������173
Solution�������������������������������������������������������������������������������������������������������173
Discussion���������������������������������������������������������������������������������������������������173
5-19. Creating Custom Multiple Children Layout����������������������������������������������176
Problem�������������������������������������������������������������������������������������������������������176
Solution�������������������������������������������������������������������������������������������������������176
Discussion���������������������������������������������������������������������������������������������������176
5-20. Summary�������������������������������������������������������������������������������������������������180

Chapter 6: Form Widgets������������������������������������������������������������������181


6-1. Collecting Text Inputs��������������������������������������������������������������������������������181
Problem�������������������������������������������������������������������������������������������������������181
Solution�������������������������������������������������������������������������������������������������������181
Discussion���������������������������������������������������������������������������������������������������181
Using TextEditingController��������������������������������������������������������������������������182
Using Listeners of TextEditingController������������������������������������������������������184
Using Callbacks�������������������������������������������������������������������������������������������186
6-2. Customizing Keyboard for Text Input���������������������������������������������������������188
Problem�������������������������������������������������������������������������������������������������������188
Solution�������������������������������������������������������������������������������������������������������189
Discussion���������������������������������������������������������������������������������������������������189
6-3. Add Decorations to Text Input in Material Design��������������������������������������191
Problem�������������������������������������������������������������������������������������������������������191
Solution�������������������������������������������������������������������������������������������������������192

xvi
Table of Contents

Discussion���������������������������������������������������������������������������������������������������192
Borders��������������������������������������������������������������������������������������������������������192
Prefix and Suffix������������������������������������������������������������������������������������������194
Text��������������������������������������������������������������������������������������������������������������195
6-4. Setting Text Limits�������������������������������������������������������������������������������������196
Problem�������������������������������������������������������������������������������������������������������196
Solution�������������������������������������������������������������������������������������������������������196
Discussion���������������������������������������������������������������������������������������������������197
6-5. Selecting Text��������������������������������������������������������������������������������������������198
Problem�������������������������������������������������������������������������������������������������������198
Solution�������������������������������������������������������������������������������������������������������198
Discussion���������������������������������������������������������������������������������������������������198
6-6. Formatting Text������������������������������������������������������������������������������������������202
Problem�������������������������������������������������������������������������������������������������������202
Solution�������������������������������������������������������������������������������������������������������202
Discussion���������������������������������������������������������������������������������������������������202
6-7. Selecting a Single Value����������������������������������������������������������������������������203
Problem�������������������������������������������������������������������������������������������������������203
Solution�������������������������������������������������������������������������������������������������������204
Discussion���������������������������������������������������������������������������������������������������204
6-8. Selecting a Single Value from Dropdown��������������������������������������������������206
Problem�������������������������������������������������������������������������������������������������������206
Solution�������������������������������������������������������������������������������������������������������206
Discussion���������������������������������������������������������������������������������������������������207
6-9. Selecting Multiple Values��������������������������������������������������������������������������209
Problem�������������������������������������������������������������������������������������������������������209
Solution�������������������������������������������������������������������������������������������������������209
Discussion���������������������������������������������������������������������������������������������������209

xvii
Table of Contents

6-10. Toggling On/Off State�������������������������������������������������������������������������������211


Problem�������������������������������������������������������������������������������������������������������211
Solution�������������������������������������������������������������������������������������������������������211
Discussion���������������������������������������������������������������������������������������������������211
6-11. Selecting from a Range of Values������������������������������������������������������������214
Problem�������������������������������������������������������������������������������������������������������214
Solution�������������������������������������������������������������������������������������������������������214
Discussion���������������������������������������������������������������������������������������������������215
6-12. Using Chips����������������������������������������������������������������������������������������������217
Problem�������������������������������������������������������������������������������������������������������217
Solution�������������������������������������������������������������������������������������������������������217
Discussion���������������������������������������������������������������������������������������������������217
6-13. Selecting Date and Time��������������������������������������������������������������������������221
Problem�������������������������������������������������������������������������������������������������������221
Solution�������������������������������������������������������������������������������������������������������221
Discussion���������������������������������������������������������������������������������������������������221
6-14. Wrapping Form Fields������������������������������������������������������������������������������225
Problem�������������������������������������������������������������������������������������������������������225
Solution�������������������������������������������������������������������������������������������������������225
Discussion���������������������������������������������������������������������������������������������������225
6-15. Creating Forms����������������������������������������������������������������������������������������230
Problem�������������������������������������������������������������������������������������������������������230
Solution�������������������������������������������������������������������������������������������������������230
Discussion���������������������������������������������������������������������������������������������������230
6-16. Summary�������������������������������������������������������������������������������������������������234

xviii
Table of Contents

Chapter 7: Common Widgets������������������������������������������������������������235


7-1. Displaying a List of Items��������������������������������������������������������������������������235
Problem�������������������������������������������������������������������������������������������������������235
Solution�������������������������������������������������������������������������������������������������������235
Discussion���������������������������������������������������������������������������������������������������235
ListView with Static Children�����������������������������������������������������������������������236
ListView with Item Builders�������������������������������������������������������������������������237
ListTile���������������������������������������������������������������������������������������������������������238
7-2. Displaying Items in a Grid��������������������������������������������������������������������������244
Problem�������������������������������������������������������������������������������������������������������244
Solution�������������������������������������������������������������������������������������������������������244
Discussion���������������������������������������������������������������������������������������������������244
7-3. Displaying Tabular Data�����������������������������������������������������������������������������250
Problem�������������������������������������������������������������������������������������������������������250
Solution�������������������������������������������������������������������������������������������������������250
Discussion���������������������������������������������������������������������������������������������������250
7-4. Scaffolding Material Design Pages������������������������������������������������������������255
Problem�������������������������������������������������������������������������������������������������������255
Solution�������������������������������������������������������������������������������������������������������255
Discussion���������������������������������������������������������������������������������������������������255
App Bar��������������������������������������������������������������������������������������������������������256
Floating Action Button���������������������������������������������������������������������������������258
Drawer���������������������������������������������������������������������������������������������������������258
Bottom App Bar�������������������������������������������������������������������������������������������260
Bottom Navigation Bar��������������������������������������������������������������������������������260
Bottom Sheet�����������������������������������������������������������������������������������������������263
Scaffold State����������������������������������������������������������������������������������������������264
SnackBar�����������������������������������������������������������������������������������������������������264

xix
Table of Contents

7-5. Scaffolding iOS Pages�������������������������������������������������������������������������������265


Problem�������������������������������������������������������������������������������������������������������265
Solution�������������������������������������������������������������������������������������������������������265
Discussion���������������������������������������������������������������������������������������������������265
7-6. Creating Tab Layout in Material Design�����������������������������������������������������266
Problem�������������������������������������������������������������������������������������������������������266
Solution�������������������������������������������������������������������������������������������������������266
Discussion���������������������������������������������������������������������������������������������������267
7-7. Implementing Tab Layout in iOS����������������������������������������������������������������270
Problem�������������������������������������������������������������������������������������������������������270
Solution�������������������������������������������������������������������������������������������������������270
Discussion���������������������������������������������������������������������������������������������������270
7-8. Summary���������������������������������������������������������������������������������������������������271

Chapter 8: Page Navigation��������������������������������������������������������������273


8-1. Implementing Basic Page Navigation��������������������������������������������������������273
Problem�������������������������������������������������������������������������������������������������������273
Solution�������������������������������������������������������������������������������������������������������273
Discussion���������������������������������������������������������������������������������������������������273
8-2. Using Named Routes���������������������������������������������������������������������������������276
Problem�������������������������������������������������������������������������������������������������������276
Solution�������������������������������������������������������������������������������������������������������276
Discussion���������������������������������������������������������������������������������������������������276
8-3. Passing Data Between Routes�������������������������������������������������������������������278
Problem�������������������������������������������������������������������������������������������������������278
Solution�������������������������������������������������������������������������������������������������������278
Discussion���������������������������������������������������������������������������������������������������278

xx
Table of Contents

8-4. Implementing Dynamic Route Matching���������������������������������������������������284


Problem�������������������������������������������������������������������������������������������������������284
Solution�������������������������������������������������������������������������������������������������������284
Discussion���������������������������������������������������������������������������������������������������284
8-5. Handling Unknown Routes������������������������������������������������������������������������285
Problem�������������������������������������������������������������������������������������������������������285
Solution�������������������������������������������������������������������������������������������������������285
Discussion���������������������������������������������������������������������������������������������������286
8-6. Displaying Material Design Dialogs�����������������������������������������������������������286
Problem�������������������������������������������������������������������������������������������������������286
Solution�������������������������������������������������������������������������������������������������������287
Discussion���������������������������������������������������������������������������������������������������287
8-7. Displaying iOS Dialogs�������������������������������������������������������������������������������290
Problem�������������������������������������������������������������������������������������������������������290
Solution�������������������������������������������������������������������������������������������������������291
Discussion���������������������������������������������������������������������������������������������������291
8-8. Displaying iOS Action Sheets���������������������������������������������������������������������293
Problem�������������������������������������������������������������������������������������������������������293
Solution�������������������������������������������������������������������������������������������������������293
Discussion���������������������������������������������������������������������������������������������������293
8-9. Showing Material Design Menus���������������������������������������������������������������296
Problem�������������������������������������������������������������������������������������������������������296
Solution�������������������������������������������������������������������������������������������������������296
Discussion���������������������������������������������������������������������������������������������������296
8-10. Managing Complicated Page Flows Using Nested Navigators����������������301
Problem�������������������������������������������������������������������������������������������������������301
Solution�������������������������������������������������������������������������������������������������������301
Discussion���������������������������������������������������������������������������������������������������301

xxi
Table of Contents

8-11. Observing Navigator State Changes��������������������������������������������������������305


Problem�������������������������������������������������������������������������������������������������������305
Solution�������������������������������������������������������������������������������������������������������305
Discussion���������������������������������������������������������������������������������������������������305
8-12. Stopping Routes from Popping����������������������������������������������������������������310
Problem�������������������������������������������������������������������������������������������������������310
Solution�������������������������������������������������������������������������������������������������������310
Discussion���������������������������������������������������������������������������������������������������310
8-13. Summary�������������������������������������������������������������������������������������������������312

Chapter 9: Service Interaction����������������������������������������������������������313


9-1. Working with Futures��������������������������������������������������������������������������������313
Problem�������������������������������������������������������������������������������������������������������313
Solution�������������������������������������������������������������������������������������������������������313
Discussion���������������������������������������������������������������������������������������������������313
9-2. Using async and await to Work with Futures��������������������������������������������317
Problem�������������������������������������������������������������������������������������������������������317
Solution�������������������������������������������������������������������������������������������������������317
Discussion���������������������������������������������������������������������������������������������������317
9-3. Creating Futures����������������������������������������������������������������������������������������318
Problem�������������������������������������������������������������������������������������������������������318
Solution�������������������������������������������������������������������������������������������������������319
Discussion���������������������������������������������������������������������������������������������������319
9-4. Working with Streams�������������������������������������������������������������������������������320
Problem�������������������������������������������������������������������������������������������������������320
Solution�������������������������������������������������������������������������������������������������������320
Discussion���������������������������������������������������������������������������������������������������320

xxii
Table of Contents

9-5. Creating Streams���������������������������������������������������������������������������������������328


Problem�������������������������������������������������������������������������������������������������������328
Solution�������������������������������������������������������������������������������������������������������328
Discussion���������������������������������������������������������������������������������������������������328
9-6. Building Widgets Based on Streams and Futures��������������������������������������330
Problem�������������������������������������������������������������������������������������������������������330
Solution�������������������������������������������������������������������������������������������������������330
Discussion���������������������������������������������������������������������������������������������������330
9-7. Handle Simple JSON Data�������������������������������������������������������������������������335
Problem�������������������������������������������������������������������������������������������������������335
Solution�������������������������������������������������������������������������������������������������������335
Discussion���������������������������������������������������������������������������������������������������335
9-8. Handle Complex JSON Data����������������������������������������������������������������������337
Problem�������������������������������������������������������������������������������������������������������337
Solution�������������������������������������������������������������������������������������������������������338
Discussion���������������������������������������������������������������������������������������������������338
9-9. Handling XML Data������������������������������������������������������������������������������������344
Problem�������������������������������������������������������������������������������������������������������344
Solution�������������������������������������������������������������������������������������������������������344
Discussion���������������������������������������������������������������������������������������������������344
9-10. Handling HTML Data��������������������������������������������������������������������������������349
Problem�������������������������������������������������������������������������������������������������������349
Solution�������������������������������������������������������������������������������������������������������349
Discussion���������������������������������������������������������������������������������������������������349
9-11. Sending HTTP Requests��������������������������������������������������������������������������350
Problem�������������������������������������������������������������������������������������������������������350
Solution�������������������������������������������������������������������������������������������������������351
Discussion���������������������������������������������������������������������������������������������������351

xxiii
Table of Contents

9-12. Connecting to WebSocket������������������������������������������������������������������������353


Problem�������������������������������������������������������������������������������������������������������353
Solution�������������������������������������������������������������������������������������������������������354
Discussion���������������������������������������������������������������������������������������������������354
9-13. Connecting to Socket������������������������������������������������������������������������������355
Problem�������������������������������������������������������������������������������������������������������355
Solution�������������������������������������������������������������������������������������������������������355
Discussion���������������������������������������������������������������������������������������������������355
9-14. Interacting JSON-Based REST Services��������������������������������������������������356
Problem�������������������������������������������������������������������������������������������������������356
Solution�������������������������������������������������������������������������������������������������������356
Discussion���������������������������������������������������������������������������������������������������357
9-15. Interacting with gRPC Services���������������������������������������������������������������360
Problem�������������������������������������������������������������������������������������������������������360
Solution�������������������������������������������������������������������������������������������������������361
Discussion���������������������������������������������������������������������������������������������������361
9-16. Summary�������������������������������������������������������������������������������������������������363

Chapter 10: State Management��������������������������������������������������������365


10-1. Managing State Using Stateful Widgets��������������������������������������������������365
Problem�������������������������������������������������������������������������������������������������������365
Solution�������������������������������������������������������������������������������������������������������365
Discussion���������������������������������������������������������������������������������������������������365
10-2. Managing State Using Inherited Widgets������������������������������������������������371
Problem�������������������������������������������������������������������������������������������������������371
Solution�������������������������������������������������������������������������������������������������������371
Discussion���������������������������������������������������������������������������������������������������371

xxiv
Table of Contents

10-3. Managing State Using Inherited Model���������������������������������������������������378


Problem�������������������������������������������������������������������������������������������������������378
Solution�������������������������������������������������������������������������������������������������������378
Discussion���������������������������������������������������������������������������������������������������379
10-4. Managing State Using Inherited Notifier�������������������������������������������������382
Problem�������������������������������������������������������������������������������������������������������382
Solution�������������������������������������������������������������������������������������������������������382
Discussion���������������������������������������������������������������������������������������������������382
10-5. Managing State Using Scoped Model������������������������������������������������������384
Problem�������������������������������������������������������������������������������������������������������384
Solution�������������������������������������������������������������������������������������������������������384
Discussion���������������������������������������������������������������������������������������������������385
10-6. Managing State Using Bloc���������������������������������������������������������������������389
Problem�������������������������������������������������������������������������������������������������������389
Solution�������������������������������������������������������������������������������������������������������389
Discussion���������������������������������������������������������������������������������������������������389
10-7. Managing State Using Redux������������������������������������������������������������������397
Problem�������������������������������������������������������������������������������������������������������397
Solution�������������������������������������������������������������������������������������������������������397
Discussion���������������������������������������������������������������������������������������������������397
10-8. Managing State Using Mobx��������������������������������������������������������������������405
Problem�������������������������������������������������������������������������������������������������������405
Solution�������������������������������������������������������������������������������������������������������406
Discussion���������������������������������������������������������������������������������������������������406
10-9. Summary�������������������������������������������������������������������������������������������������412

xxv
Table of Contents

Chapter 11: Animations��������������������������������������������������������������������413


11-1. Creating Simple Animations��������������������������������������������������������������������413
Problem�������������������������������������������������������������������������������������������������������413
Solution�������������������������������������������������������������������������������������������������������413
Discussion���������������������������������������������������������������������������������������������������413
11-2. Creating Animations Using Linear Interpolation��������������������������������������418
Problem�������������������������������������������������������������������������������������������������������418
Solution�������������������������������������������������������������������������������������������������������418
Discussion���������������������������������������������������������������������������������������������������418
11-3. Creating Curved Animations��������������������������������������������������������������������421
Problem�������������������������������������������������������������������������������������������������������421
Solution�������������������������������������������������������������������������������������������������������421
Discussion���������������������������������������������������������������������������������������������������421
11-4. Chaining Tweens��������������������������������������������������������������������������������������425
Problem�������������������������������������������������������������������������������������������������������425
Solution�������������������������������������������������������������������������������������������������������425
Discussion���������������������������������������������������������������������������������������������������425
11-5. Creating Sequences of Tweens���������������������������������������������������������������426
Problem�������������������������������������������������������������������������������������������������������426
Solution�������������������������������������������������������������������������������������������������������426
Discussion���������������������������������������������������������������������������������������������������426
11-6. Running Simultaneous Animations����������������������������������������������������������427
Problem�������������������������������������������������������������������������������������������������������427
Solution�������������������������������������������������������������������������������������������������������427
Discussion���������������������������������������������������������������������������������������������������427

xxvi
Table of Contents

11-7. Creating Staggered Animations���������������������������������������������������������������428


Problem�������������������������������������������������������������������������������������������������������428
Solution�������������������������������������������������������������������������������������������������������428
Discussion���������������������������������������������������������������������������������������������������429
11-8. Creating Hero Animations������������������������������������������������������������������������430
Problem�������������������������������������������������������������������������������������������������������430
Solution�������������������������������������������������������������������������������������������������������430
Discussion���������������������������������������������������������������������������������������������������431
11-9. Using Common Transitions����������������������������������������������������������������������434
Problem�������������������������������������������������������������������������������������������������������434
Solution�������������������������������������������������������������������������������������������������������434
Discussion���������������������������������������������������������������������������������������������������434
11-10. Creating Physics Simulations����������������������������������������������������������������436
Problem�������������������������������������������������������������������������������������������������������436
Solution�������������������������������������������������������������������������������������������������������436
Discussion���������������������������������������������������������������������������������������������������437
11-11. Summary�����������������������������������������������������������������������������������������������440

Chapter 12: Platform Integration������������������������������������������������������441


12-1. Reading and Writing Files������������������������������������������������������������������������441
Problem�������������������������������������������������������������������������������������������������������441
Solution�������������������������������������������������������������������������������������������������������441
Discussion���������������������������������������������������������������������������������������������������441
12-2. Storing Key-Value Pairs���������������������������������������������������������������������������444
Problem�������������������������������������������������������������������������������������������������������444
Solution�������������������������������������������������������������������������������������������������������444
Discussion���������������������������������������������������������������������������������������������������444

xxvii
Table of Contents

12-3. Writing Platform-Specific Code���������������������������������������������������������������446


Problem�������������������������������������������������������������������������������������������������������446
Solution�������������������������������������������������������������������������������������������������������446
Discussion���������������������������������������������������������������������������������������������������446
12-4. Creating Plugins��������������������������������������������������������������������������������������452
Problem�������������������������������������������������������������������������������������������������������452
Solution�������������������������������������������������������������������������������������������������������452
Discussion���������������������������������������������������������������������������������������������������452
12-5. Displaying Web Pages�����������������������������������������������������������������������������456
Problem�������������������������������������������������������������������������������������������������������456
Solution�������������������������������������������������������������������������������������������������������456
Discussion���������������������������������������������������������������������������������������������������456
12-6. Playing Videos�����������������������������������������������������������������������������������������460
Problem�������������������������������������������������������������������������������������������������������460
Solution�������������������������������������������������������������������������������������������������������460
Discussion���������������������������������������������������������������������������������������������������461
12-7. Using Cameras����������������������������������������������������������������������������������������465
Problem�������������������������������������������������������������������������������������������������������465
Solution�������������������������������������������������������������������������������������������������������466
Discussion���������������������������������������������������������������������������������������������������466
12-8. Using System Share Sheet����������������������������������������������������������������������470
Problem�������������������������������������������������������������������������������������������������������470
Solution�������������������������������������������������������������������������������������������������������470
Discussion���������������������������������������������������������������������������������������������������470
12-9. Summary�������������������������������������������������������������������������������������������������471

xxviii
Another Random Scribd Document
with Unrelated Content
This Department is conducted in the interest of stamp and coin
collectors, and the Editor will be pleased to answer any question on
these subjects so far as possible. Correspondents should address Editor
Stamp Department.

During the past year watchmakers, jewellers, carriage-builders, livery-stable-


keepers, piano manufacturers, and other industries have been complaining
that the bicycle has seriously interfered with their business; but until of late
stamp-dealers have had no reason to complain. At present there is some
grumbling in the trade, and a disposition to blame the bicycle for it. The real
reasons seem to be twofold: first, the large number of new dealers, and
secondly, the innumerable auctions. The first cause will probably soon cease,
as the difficulty in getting good stamps to sell will probably soon weed out
the superfluous dealers; the second will probably have to run its course.
Collectors find that in many cases they bid against each other, in the
excitement of the auction-room, until the stamps cost them more than they
could buy them from dealers for by a little patience, and awaiting their
opportunity.
New Zealand offered a prize of $1000 for the best designs for the
contemplated issue of a new set of twenty-two stamps. No one artist was
successful, therefore a selection was made of the best designs, and the prize
divided.
For many years the scarcest European stamp was the 81 paras, Moldavia,
first issue. So scarce was the stamp that a clever swindler made a few which
he sold at a high price. Later on genuine copies were discovered, and the
leading philatelists discarded the counterfeits, and competed with each other
for the few copies which were undoubtedly genuine. Recent research in the
archives of the principality showed that the entire issue was as follows: 27
paras, 3691; 54 paras, 4772; 81 paras, 709; 103 paras, 2584.
Plate numbers are still booming. Collectors are now trying to make up sets of
the earlier issues, and prices naturally advance. The demand for Plate No.
Albums still continues.
The U.S. government still refuses to sell the Periodical stamps of the current
issues, and yet at least two collectors have complete unused sets, from 1c.
to $100, of the stamps in blocks of three, bearing imprint and plate No. Sets
are still coming to the United States from all quarters of the globe. The
government would secure a large revenue by allowing philatelists to buy
these stamps.
The freemasonry existing between stamp-collectors is evidenced by the
reports of a number of leading philatelists who have been going around the
globe during the past few years. They met a warm welcome in every land,
civilized, semi-civilized, barbarous, and even savage. Having parts of their
collections with them operated as an "open sesame" in every country.
Despite the wide-spread knowledge of stamps curious cases of ignorance still
occur. A few days ago the veteran J. W. Scott received in his mail a copy of
the very scarce "Danville" envelope, with a request to exchange it for a few
common stamps. The holder was much surprised to receive with the stamps
a check for a large sum.

F. Nicoll.—The prices quoted in this column are always those at which


the stamps can be bought of dealers. What dealers pay I do not know.
L. Perkins.—There are several dies of the 1861 3c. envelope stamp. Only
a few collectors care for these slight varieties of envelopes.
F. A. Childs.—No value except as bullion.
M. R. Wise.—The 5c. and 10c. Colombian envelopes can be bought of
dealers for 15c. and 25c. respectively; if used, for about half these
amounts.
C. S.—The coin can be bought of dealers at 75c.
Mrs. W. T. Woods.—We neither sell nor buy stamps or coins.
E. C. Wood, 156 School Lane, Germantown, Pa.—No premium on the
coins to sell, but dealers charge a premium on all the coins sold by
them, whether rare or common. Compound perforations are those
stamps perforated on different scales on two or more sides; for instance,
many of the Swedish Official stamps are perforated top and bottom
13½, sides 14.
J. N. Carter.—Your coin is Spanish, and is worth bullion only. Many
millions of them were used throughout this country up to 1834, and in
the South up to 1861.
B. W. Leavitt.—Your three stamps are U.S. Revenues. All common.
H. M. Robinson.—No premium on the 1857 U.S.
R. I. P.—They are all war tokens issued in 1862 and 1863. Very
interesting and worth collecting, but they have no monetary value.
W. W. S.—The quarter, 1892, can be bought of dealers for 50c.
H. S. Johnson.—Your stamps are catalogued, Bavaria, 1 kr., yellow, 5c.;
Greece, 1 lept., brown, 5c.; New South Wales, 8d., yellow, surcharged
O.S. in red, $4.50; Hawaii, 5c., blue, 30c.; Bavaria, 5 pf., red, is a
revenue stamp.
T. L. Watkins.—There are about five hundred different "Private
Proprietary" stamps issued by the U.S. for revenue purposes. Some of
them are very common, others very rare. They are printed on four
varieties of paper, viz.: Old, silk, pink, and water-marked. Some of the
stamps were issued both perforated and unperforated.

P
hilatus.
ADVERTISEMENTS.

The Woman's

Bicycle ...

In strength, lightness, grace, and elegance of finish and equipment Model 41


Columbia is unapproached by any other make.
COLUMBIA
saddles are recommended by riders and physicians as proper in shape and
adjustment, and every detail of equipment contributes to comfort and
pleasure.

$100 to all alike.


The Columbia Catalogue, handsomest art work of the year, is free from
Columbia agent, or is mailed for two 2-cent stamps.

POPE Mfg. Co.

Hartford, Conn.
There are monarchs, there are
monarchs,
Men of every clime and hue,
From the Czar of all the Russias
To the Prince of Timbuctoo:
Monarchs good and monarchs
famous,
Monarchs short and monarchs
tall;
But the best is our Monarch—
It's the Monarch of them all.
Monarch
King of Bicycles—A Marvel of Strength, Speed and Reliability.

4 models, $80 and $100, fully guaranteed. For children and adults who want
a lower price wheel the Defiance is made in 8 models, $40 to $75.
Send for Monarch book.

MONARCH CYCLE MFG. CO.,

Lake, Halsted and Fulton Sts., CHICAGO.

83 Reade Street, New York.


JOSEPH GILLOTT'S
STEEL PENS
Nos. 303, 404, 170, 604 E.F., 601 E.F.
And other styles to suit all hands.

THE MOST PERFECT OF PENS.


Postage Stamps, &c.
$117.50 WORTH OF STAMPS FREE
to agents selling stamps from my 50% approval sheets. Send at once for
circular and price-list giving full information.

C. W. Grevning, Morristown, N. J.

STAMPS! 100 all dif. Barbados, etc. Only 10c. Ag'ts w't'd at 50% com. List
free. L. DOVER & CO., 1469 Hodiamont, St. Louis, Mo.

The Good Will School Fund.


A few words to Founders, members, and all who have contributed to the
Round Table Industrial School Fund:
Some time since, as you recollect, you voted to try to raise $3000 with which
to erect a brick structure at Good Will Farm to be known as the Round Table
Industrial School. Although in Maine, Good Will Farm takes poor and
homeless boys from every part of the country, so far as it has
accommodation, gives them a Christian home, an education, and a start in
the world.
Since you undertook the raising of this Fund, Good Will Farm has prospered
wonderfully. A part of this prosperity has been due, it is but just to say, to
the wider knowledge of its work and merits afforded by the Table and its
large membership. Generous men have built new cottages as homes for
more boys, and money has been given for the support of girls, so that the
place is soon to be not alone Good Will Farm for boys, but Good Will Farm for
girls as well. One citizen of New York has bought a tract of land across the
Kennebec River from the farm, and in the grove on this land is to be held the
summer school and annual July gathering.
In memory of a deceased brother some kind ladies have built a school-house
—not an industrial, but a literary school, equipped with every convenience.
The cost has been nearly if not quite $25,000, not including a proposed
museum of natural history in one of its largest rooms.
With such gratifying prosperity Good Will has grown quite beyond the
expectation held at the time we began our task. An industrial school large
enough to meet its present and immediate future demands would cost at
least $10,000—a sum far beyond the Table's ability to raise, and one that it
never thought to undertake.
There are many things to be considered in connection with our work to date;
1, The times, which have been far from good; 2, The fact that young
persons, not grown-ups, undertook the task; 3, And most important of all,
our effort to earn, not to beg, the money we contributed—to be generous
with what was ours, not with other people's money.
Of our Fund at date, amounting to $1682.35, all cash in hand, we have no
reason to be ashamed. It is a handsome sum, and one that many an
institution besides Good Will would be glad to receive at our hands.
If, now, we change our plans we ought to bear in mind that we are not the
only persons who, finding that circumstances change, alter their minds and
their acts to fit them. Especially ought we to be gratified, since the change
that makes us alter our minds and acts is one of wonderful prosperity for the
splendid charity which we started out to help.
After looking over the whole ground, and consultation with the supervisor
and one of the leading trustees, we beg to make to the Founders this
suggestion:
That the money now in hand be turned over to the trustees of Good Will
Farm, to be invested by them according to their best judgment, the same to
be known as the "Round Table Fund," and the income of it to be used to help
educate at Good Will any boy or girl, or boys and girls, as the supervisor or
trustee, or both, decide to be most worthy of such help.
Included in the amount of the Fund as given is money to pay for twelve
Memorial Stones, which were to form part of the base-line of the school
building. We suggest that the donors of this money be given the privilege of
withdrawing it if they so desire; but if they do not wish to withdraw it, that
the papers making the formal transfer contain "codicils" or "minutes"
mentioning the names of the persons or Chapter, the same to forever form a
part of the "Round Table Fund" foundation.
The method of deciding Round Table questions is by vote of the Founders—
postal-card votes. In this case we think it the part of generous wisdom to
allow all contributors, as well as all Founders, to vote. And so the request is
made that all of you give us opinions. Shall we make the disposition of the
matter here suggested? Remember, dear Knights and Ladies, that we are to
rejoice that we have a gift so handsome in amount to bestow, rather than to
sigh for the thousands of dollars we haven't in hand to give. The Good Will
trustees will gladly accept the Fund in the form proposed. Shall we give it to
them?

Camping Out in South Africa.


We were six in the little party which started to go to the mountain to
camp out. We trudged along with our bundles up the steep road and
through woods until we came to our hut. This hut was made of poles
interlaced with brush-wood. When we got there the first thing we
discovered was that some cattle had been there and eaten the green
leaves off, but that was soon put right. We had a lot of food with us, and
when we ran short a native boy we had engaged brought up some
more. All our crockery was of tin, as all other kinds would break, and
these always stood just outside the door.
One night three of us decided to go to town. The other three would not
come, so they staid and looked after the things while we were away. We
started at eight and got back at ten. When we went down we were all
dressed in our mountain suits, which were composed of football jerseys
and strong trousers, and these were pretty full of mud. Our visit to town
was shortened by the mist coming down, and we had to hurry up for
fear of it catching us at a very rocky place we had to climb; but we got
up just as it reached the top. Meanwhile the three in the cave were
having some fun. We were just gone when they heard something in the
tin mugs. One took up the gun and shot as the thing jumped away, but
only succeeded in wounding it, as we discovered next morning by the
blood-stains on the bough of the tree. We staid ten days in the hut, and
enjoyed the time thoroughly. The last day it drizzled, so we gave up the
plan we had of going down in the night, and went at mid-day.
I am a stamp collector, and would like to exchange stamps with any one
who would do so.

R. MacWilliam,
Jun.
Gill College,
Somerset East, Cape Colony, South Africa.

Guessing-contest Answers.
The family referred to in the "Guessing Contest" of two weeks ago is the
"Berry," and the numbered lines describe them:
1, Elder; 2, Goose; 3, Checker; 4, Knot; 5, Hack; 6, Box, 7, June; 8, Hop; 9,
Candle; 10, Poke; 11, Prince; (12, Wax, 13, Snow;) 14, Straw; (15, Coffee,
16, Wine;) (17, Bane, 18, Bramble;) (19, Dog, 20, Bear;) (21, Pigeon, 22,
Partridge, 23, Crow;) 24, Bog; 25, Cloud; 26, Dew; 27, Mul, 28, Blue; 29,
Black; 30, Bil; 31, Bay; (32, Bar, 33, Choke;) 34, Dangle; 35, Wintergreen;
36, Cran (crane); 37, Huckle; (38, Holly, 39, Mistletoe;) (40, Soap, 41,
Thimble;) 42, Rasp; 43, Yew.

Questions and Answers.


James Nichols asks if we have a story contest open now, and he sends a tale
for a prize. We reply, not now, and return his story. Louise Hall, secretary of
the Broken Bow Chapter, 216 Thirteenth Street, Oakland, Cal., says members
of her society want to hear from persons who can describe famous places
and homes of famous men. Kathleen Kent, 1162 Harrison Street, is the
member in charge, and she desires pictures of famous men. The Chapter
members promise to answer all letters on the subject. Herbert C. Davis, Box
87, Carthage, O., plays chess, and wants to play some games by mail.

Roberta Esther Conley was much interested with that touching letter from
Broussa, describing the hardships of Armenians, and she hopes everybody
who can will help Miss Barton and others in relief work. The Red Cross
Society is an international one, organized some years ago in Geneva,
Switzerland. Miss Clara Barton is president of the American branch only. It
has special privileges, as that it is, in time of war, to be permitted to go into
both armies to do relief work, and that all generals shall recognize its officers
and permit them to pass. It does relief work in times other than war, as
during floods, famine, hurricanes, etc. "Why does it not go to Cuba?" We do
not know.

"J. A. M." writes: 1. How can a boy seventeen years of age obtain a position
as cabin-boy or something else on board a sailing vessel to California or
thereabouts? 2. What are the duties involved in such a position? 3. How
much could he earn that way, and how would it be paid to him? He does not
intend to be a sailor, but wishes to regain his health and strength and earn
some money to help pay his expenses at a preparatory school, for college,
about a year and a half from now. 1. Apply at office on board the ships.
There is no general rule. Cases of this kind are not numerous. A friend of the
Table, aged 19, applied recently and was promptly taken, mainly because he
was big and strong. He was offered $8 per month and board, and was
required to ship for a year's cruise. One going for his health would not be
likely to get much salary. 2. The duties of cabin-boy are those of a general
boy of all work. 3. The pay, even for a well boy, is very small, say from $4 to
$6 per month, with board.

J. L. P. and H. E. A.: All readers may send original puzzles for "Kinks." They
may also send short stories when competitions are open. Short stories, other
than in competition for prizes, are not desired. But the Table wants morsels,
descriptive of interesting but not too well known places. Perhaps this latter
phrase needs explaining. A morsel about Mt. Auburn, describing the tombs of
Sumner, Burlingame, and Longfellow, would be interesting, while one
describing Niagara Falls would be too hackneyed to warrant space being
given it. Round Table Chapters are societies of young persons, sometimes of
schools, often of churches or neighborhoods, organized to study natural
history, to make collections, or perhaps merely to have a good time.

This Department is conducted in the interest of Girls and Young Women,


and the Editor will be pleased to answer any question on the subject so
far as possible. Correspondents should address Editor.

Among the qualities most to be desired in a young girl's character is a high


sense of honor. I wish I could impress on every reader the need of being
always above everything petty or small, so that one would not for a single
moment ever be tempted to do a mean or underhand thing, to speak
unkindly of a friend, or to repeat a conversation which was confidential.
It may happen to you, for instance, to be visiting in the home of a relative or
friend, where there may be a little friction at the table, or where some
anxiety arises about the course of a member of the family. No matter what
you see or hear, in such circumstances you are bound, if you are an
honorable person, to be silent about it, neither making comments nor looking
as if you could tell something if you chose, nor in any way alluding to what is
unpleasant, at any future time. A guest in a home cannot be too careful to
guard the good name of those under its roof, for it is an honor to be a guest,
in the first place, and honor is demanded in return.
Again, a nice sense of honor in matters connected with money is very
important. Polly is treasurer of a society, and has the care of the funds. She
must never for an instant, or in an emergency, lend these funds to other
people, or borrow them for her own use. I knew a girl—Polly was her name,
by-the-way—who was induced, being treasurer of a certain guild, to lend her
brother, for one day, the money she had in her care. The brother was older
than Polly, and a very persuasive person. He said: "Why should you hesitate?
I'll bring it back to you to-night, and it will oblige me very much if I can take
that fifty dollars and pay a bill I owe before noon to-day." Foolish Polly
permitted her scruples to be overruled. The money was not brought back,
and but for her father's kindness in making it good she would have been
disgraced as a dishonest treasurer. She told me long afterwards that the
lesson had been burned in on her mind never to take liberties with money
which she held in trust.
A nice sense of honor will keep a girl from making a confidante of her maid
or of any person in an inferior situation. One's mother is a girl's natural
adviser and her safest intimate friend. A nice sense of honor will hinder all
prying into other people's affairs, and will lead one to turn a deaf ear to the
gossip of the idle and malicious.
Sometimes one becomes accidentally aware of a state of things which she
knows her friend must prefer to keep to herself. The honorable girl will never
hesitate here; she will be as thoughtful for her friend's interests as if they
were her own.
This little talk may be too old for some of my younger readers, so I will
conclude it by telling them a little story. Once upon a time in a small New
England village there was a district school. The boys and girls went to this
from the country homes for miles, some of them not minding a very long
walk over snowy roads in winter, and under the trees in summer. The master
was very grave and stern, and if he laughed behind his grizzled beard, the
children looking up to him from their benches seldom saw it. A big ruler
always lay on his desk, and they were very much afraid of that; so that when
one morning at recess, in a game of ball, Charley B—— had the misfortune
to break a window in the school-house, it required no little courage in the
eight-year-old boy to march straight into the room, up to the desk, and
confess that he had been careless and had done the mischief. Mr. True was
very kind, and said, consolingly, that the window could be mended. So
Charley rushed off with a light heart.
Later in the day a girl, I am ashamed to say, stole up to the desk and told
her tale. "Mr. True," said this disagreeable little being, "I can tell you who
broke the window! I saw—"
"Hush, Nancy!" said the master, in an awful voice. "I know who did it. An
honorable person did it. Which you are not. You may remain after school and
write out ten pages of history as a punishment for tale-telling."

Lottie W.—Strawberries served for breakfast need not be hulled. Eat


them, instead, one by one, dipping each into powdered sugar.

Ivory Soap is white and pure; it is a clean soap and it washes clean.
The Procter & Gamble Co., Cin'ti.

A quarter spent in HIRES Rootbeer does you dollars' worth of good.

Made only by The Charles E. Hires Co., Philadelphia.


A 25c. package makes 5 gallons. Sold everywhere.
HOOPING-COUGH
CROUP.
Roche's Herbal Embrocation.
The celebrated and effectual English Cure without internal medicine.
Proprietors, W. Edward & Son, London, England.

E. Fougera & Co., 30 North William St., N.Y.


FOR KING OR COUNTRY
A Story of the American Revolution. By James Barnes. Illustrated. Post
8vo, Cloth, Ornamental, $1.50.

The story is one of adventure and abounds in vivid description. The author
has evidently made a careful study of the New York of a century ago, and of
the history of the secret patriot societies which were formed in the city under
the British rule, and the story in many of its descriptions has marked
historical value.—Boston Advertiser.
Gives a series of striking pictures of social and military life in and about the
city of New York during the period of British occupation.... Filled with exciting
incidents, and will have a strong fascination for young readers.—Boston
Transcript.
A very stirring story of the early years of the American Revolution.—Brooklyn
Times.
Abounding in adventure, and those chapters in which the young soldiers play
the part of spies are particularly enthralling.—Buffalo Courier.
Full of movement and full of surprises.... Will instruct as well as interest the
average boy who reads it.—Boston Journal.

SOME OF
KIRK MUNROE'S POPULAR BOOKS
SNOW-SHOES AND SLEDGES
A Sequel to "The Fur-Seal's Tooth."
Brimful of adventures admirably recorded. The young folks will take delight in
it.... We confess to having read every word of the journal with as much
interest as we once read "Robinson Crusoe" or the "Swiss Family
Robinson."—Christian Intelligencer, N. Y.
A book that will hold the interest of its readers from beginning to end.—N. Y.
Evening-Post.

THE FUR-SEAL'S TOOTH


There is plenty of moving incident in the tale, and the atmosphere, redolent
of seals and the life of that stormy clime, will delight all boys.—Spectator,
London.

CANOEMATES
An entertaining story for boys, and will usefully enlarge their knowledge of
our great Atlantic peninsula.—N. Y. Evening Post.

RAFTMATES
The story has a strong, wholesome tone, and will hold the interest of boy
readers from first to last page.—Churchman, N. Y.

CAMPMATES
Capitally written and admirably illustrated.... An excellent record of the early
development of certain Western cities and of certain Indian tribes now fast
disappearing.—Critic, N. Y.
DORYMATES
A wholesomely exciting tale of adventure which any bright boy might
consider a valuable addition to his library.—Christian Intelligencer, N. Y.
Each one volume. Illustrated. Post 8vo, Cloth, $1.25.
The "Mates" Series, Four Volumes in a Box, $5.00.

HARPER & BROTHERS, Publishers, New York.

NOT STRANGE.
"I git good measure," said Mrs. Jones, "but, I declare, the milk Henry brought me
yesterday mornin' was more'n half water."
The art of painting pictures so near to life as to deceive the naked eye is very
old. Pliny relates that Zeuxis once painted some grapes so naturally that
birds used to come and peck at them, and that Parrhasius once painted a
curtain so artfully that Zeuxis desired it drawn aside that he could see the
picture it hid. Discovering his error, he confessed himself outdone, as he had
only imposed on birds, whereas Parrhasius had deceived the human intellect.
Another time Zeuxis painted a boy with some grapes, and when the birds
again flew at the grapes he was very angry, saying that he was certainly at
fault with the picture. He reasoned that had it been perfect the birds would
have been frightened away by the boy.
Caius Valerius Flaccus says that Zeuxis's death was occasioned by an
immoderate fit of laughter on looking at the comic picture he had drawn of
an old woman.

"The reason why the British want to swallow up half of Venezuela," asserted
Pat, "is because of the gold there is down there."
"Sure," replied Mike, "they're always after gold, the English. If they were
landed on an uninhabited island, they would not be there an hour before
they'd have their hands in the pockets of the naked savages!"

Baron Rothschild was once caught in a predicament that many people


experience daily, and that is getting into a conveyance of some kind, and
then not having the money to pay the fare.
The driver of the omnibus into which Rothschild entered demanded his fare,
and the Baron, feeling in his pockets, discovered that he had no change. The
driver was very angry. "What did you get in for, if you had no money?"
"I am Baron Rothschild," explained the great capitalist, "and there is my
card."
The driver scornfully tossed the card away. "Never heard of you before," said
he, "and don't want to hear of you again. What I want is your fare."
The banker was in great haste. "Look here. I've an order for a million," he
said; "give me the change." And he proffered a coupon for that amount.
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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like