Flutter App Development How to Write for iOS and Android at Once (Rap Payne) (z-library.sk, 1lib.sk, z-lib.sk)

Author: Rap Payne

历史

Create apps for iOS and Android phones and tablets using Flutter, a Google framework that produces two outputs for a single app. Let's face it, creating iOS apps using Apple tools such as Swift and Xcode is extremely complicated. Creating Android apps with Kotlin and Android Studio is just as difficult. This book breaks down complex concepts and tasks into easily digestible segments with examples, full-color pictures, and hands-on labs with starters and solutions. As you work through the accompanying lab exercises, you'll learn the Dart programming language; the entire Flutter development toolchain; the differences between stateful and stateless widgets; and a working knowledge of the architecture of apps. You’ll work with themes and styles, develop custom widgets, and even teach your app to respond to gestures like taps, swipes, and pinches. You’ll also design, create, and control the layout of your app. Create tools to handle form data entry from users. And ultimately create killer multiscreen apps with navigation, menus, and tabs. You’ll see that with Flutter, you can write an app one time that produces two outputs: one that can be submitted to the Apple App Store and another that can be uploaded to the Google Play Store. In short, one code creates the same app that runs on iPhones, iPads, Android phones and tablets, virtually all devices. And if you like, it can also create a version that runs on Macs, Windows, Linux, and in browsers! Flutter App Development explains difficult topics in plain, everyday terms that simplify the process of writing mobile apps.

📄 File Format: PDF
💾 File Size: 8.4 MB
5
Views
0
Downloads
0.00
Total Donations

📄 Text Preview (First 20 pages)

ℹ️

Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

📄 Page 1
(This page has no text content)
📄 Page 2
Flutter App Development How to Write for iOS and Android at Once Rap Payne
📄 Page 3
Flutter App Development: How to Write for iOS and Android at Once ISBN-13 (pbk): 979-8-8688-0484-7 ISBN-13 (electronic): 979-8-8688-0485-4 https://doi.org/10.1007/979-8-8688-0485-4 Copyright © 2024 by Rap Payne 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: Miriam Haidara Development Editor: James Markham Coordinating Editor: Jessica Vakili 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 orders-ny@springer-sbm.com, 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 booktranslations@springernature.com; for reprint, paperback, or audio rights, please e-mail bookpermissions@springernature.com. 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 https://www.apress.com/ gp/services/source-code. If disposing of this product, please recycle the paper Rap Payne Dallas, TX, USA
📄 Page 4
This book is dedicated to the men and women of the Flutter Community. I’ve never seen a group more devoted to the success of others. You’re an inspiration and example to me. Particular thanks to these members of the community who’ve helped me with Flutter issues. This Texan owes y’all! Andrew “Red” Brogdon (Columbus, Ohio), Brian Egan (Montana), Frederik Schweiger (Düsseldorf, Germany), Jeroen “Jay” Meijer (Rotterdam, Netherlands), Jochum van der Ploeg (Zwolle, Netherlands), Martin Rybak (New York), Martin Jeret (Estonia), Nash Ramdial (Trinidad), Nilay Yenner (San Francisco), Norbert Kozsir (Karlsruhe, Germany), Pooja Bhaumik (Bengaluru, India), Randal Schwartz (Portland, Oregon), Raouf Rahiche (Casablanca by way of Algeria), Remi Rousselet (Paris), Rohan Tanaja (Berlin), and Scott Stoll (Cleveland, Ohio). But especially Simon Lightfoot (London), who we all call “The Flutter Whisperer.” He taught me much of what I know about Flutter.
📄 Page 5
v Worldwide Praise for Flutter App Development: How to Write for iOS and Android at Once “Rap has written a great starting guide full of information for those who are new to developing multi-platform apps with Flutter.” —Frederik Schweiger (Düsseldorf, Germany), organizer of the International Flutter Hackathon and creator of the Flutter School “A great read! This covers everything a beginner might want to know, and more. It explains not only what Flutter is but why it exists works the way it does. It also provides great tips for common pitfalls along the way. Definitely recommended.” —Jeroen “Jay” Meijer (Rotterdam, Netherlands), leader of Flutter Community GitHub
📄 Page 6
vi “Rap’s book is a great book to get started with Flutter. It cov- ers every important topic to write your very first app but also contains valuable information for more seasoned developers.” —Norbert Kozsir (Karlsruhe, Germany), Flutter Community editor “As a non-native English speaker, I’m totally impressed by the simplicity of this book and how much I can read and understand without getting bored.” —Raouf Rahiche (Algeria), Flutter speaker, developer, and instructor “As an early adopter and one of the original members of the Flutter Community, Rap is one of the world’s foremost authorities on Flutter. Where documentation is written for Engineers, by Engineers, Rap is a human who (thankfully!) writes in an enjoyable style that can easily be understood by other humans.” —Scott Stoll (Cleveland, Ohio), contributor to the Flutter codebase and cofounder of the Flutter Study Group WORLDWIDE PRAISE FOR FLUTTER APP DEVELOPMENT: HOW TO WRITE FOR IOS AND ANDROID AT ONCE
📄 Page 7
vii About the Author ������������������������������������������������������������������������������xvii About the Technical Reviewer �����������������������������������������������������������xix Who Is This Book For? �����������������������������������������������������������������������xxi Foreword ����������������������������������������������������������������������������������������xxvii Preface ��������������������������������������������������������������������������������������������xxix Chapter 1: Hello Flutter �������������������������������������������������������������������������1 What Is Flutter? �����������������������������������������������������������������������������������������������������2 Why Flutter? ����������������������������������������������������������������������������������������������������������3 The Other Options �������������������������������������������������������������������������������������������������4 Native Solutions ����������������������������������������������������������������������������������������������������5 Conclusion ������������������������������������������������������������������������������������������������������������6 Chapter 2: Developing in Flutter �����������������������������������������������������������7 The Flutter Toolchain ���������������������������������������������������������������������������������������������8 The Flutter SDK������������������������������������������������������������������������������������������������8 IDEs �����������������������������������������������������������������������������������������������������������������8 IDE DevTools ��������������������������������������������������������������������������������������������������10 Emulators ������������������������������������������������������������������������������������������������������11 Keeping the Tools Up to Date �������������������������������������������������������������������������13 The Flutter Development Process �����������������������������������������������������������������������16 Scaffolding the App and Files ������������������������������������������������������������������������17 Anatomy of a Flutter Project ��������������������������������������������������������������������������17 Table of Contents
📄 Page 8
viii Running Your App ������������������������������������������������������������������������������������������19 Running It As a Web App ��������������������������������������������������������������������������������20 Running It on a Tethered Device ��������������������������������������������������������������������21 Conclusion ����������������������������������������������������������������������������������������������������������23 Chapter 3: Everything Is Widgets �������������������������������������������������������25 UI As Code �����������������������������������������������������������������������������������������������������������28 Built-In Flutter Widgets ���������������������������������������������������������������������������������������29 Value Widgets ������������������������������������������������������������������������������������������������30 Layout Widgets ����������������������������������������������������������������������������������������������31 Navigation Widgets ����������������������������������������������������������������������������������������31 Other Widgets ������������������������������������������������������������������������������������������������32 How to Create Your Own Stateless Widgets ��������������������������������������������������������32 Widgets Have Keys ���������������������������������������������������������������������������������������������36 Passing a Value into Your Widget ������������������������������������������������������������������������37 Stateless and Stateful Widgets ���������������������������������������������������������������������������39 So Which One Should I Create? ���������������������������������������������������������������������39 Conclusion ����������������������������������������������������������������������������������������������������������40 Chapter 4: Value Widgets��������������������������������������������������������������������41 The Text Widget ���������������������������������������������������������������������������������������������������41 The Icon Widget ��������������������������������������������������������������������������������������������������42 The Image Widget �����������������������������������������������������������������������������������������������44 Embedded Images �����������������������������������������������������������������������������������������45 Network Images ��������������������������������������������������������������������������������������������46 Sizing an Image ���������������������������������������������������������������������������������������������46 SnackBar Widget �������������������������������������������������������������������������������������������������49 TAbLE OF CONTENTS
📄 Page 9
ix Input Widgets ������������������������������������������������������������������������������������������������������51 Text Fields������������������������������������������������������������������������������������������������������52 Checkboxes ���������������������������������������������������������������������������������������������������56 Radio Buttons ������������������������������������������������������������������������������������������������57 Sliders �����������������������������������������������������������������������������������������������������������59 Dropdowns ����������������������������������������������������������������������������������������������������60 Putting the Form Widgets Together ���������������������������������������������������������������62 One Big Form Example ����������������������������������������������������������������������������������68 Conclusion ����������������������������������������������������������������������������������������������������������68 Chapter 5: Responding to Gestures ����������������������������������������������������69 Meet the Button Family ���������������������������������������������������������������������������������������70 ElevatedButton ����������������������������������������������������������������������������������������������72 TextButton and IconButton ����������������������������������������������������������������������������72 FloatingActionButton (FAB) ����������������������������������������������������������������������������72 SegmentedButton ������������������������������������������������������������������������������������������73 CupertinoButton���������������������������������������������������������������������������������������������74 Dismissible ����������������������������������������������������������������������������������������������������������74 Custom Gestures for Your Custom Widgets ���������������������������������������������������������75 Step 1: Decide on Your Gestures and Behaviors ��������������������������������������������76 Step 2: Create Your Custom Widget ���������������������������������������������������������������76 Step 3: Add a GestureDetector widget �����������������������������������������������������������77 Step 4: Associate Your Gesture with Its Behavior ������������������������������������������78 Example 1: Reacting to a Long Press ������������������������������������������������������������78 Example 2: Pinching to Add a New Item ��������������������������������������������������������80 Example 3: Swiping Left or Right ������������������������������������������������������������������81 Conclusion ����������������������������������������������������������������������������������������������������������83 TAbLE OF CONTENTS
📄 Page 10
x Chapter 6: Navigation and Routing �����������������������������������������������������85 Stack Navigation �������������������������������������������������������������������������������������������������86 Navigating Forward and Back �����������������������������������������������������������������������87 Using Anonymous Routes ������������������������������������������������������������������������������88 Get Result After a Scene Is Closed ����������������������������������������������������������������89 Drawer Navigation ����������������������������������������������������������������������������������������������90 The Drawer Widget ����������������������������������������������������������������������������������������91 Filling the Drawer ������������������������������������������������������������������������������������������93 Tab Navigation ����������������������������������������������������������������������������������������������������95 DefaultTabController ��������������������������������������������������������������������������������������96 TabBarView ����������������������������������������������������������������������������������������������������97 TabBar and Tabs ��������������������������������������������������������������������������������������������97 TabBar at the Bottom �������������������������������������������������������������������������������������98 The Dialog Widget �����������������������������������������������������������������������������������������������99 showDialog() and AlertDialog ����������������������������������������������������������������������100 Responses with a Dialog �����������������������������������������������������������������������������101 Navigation Methods Can Be Combined �������������������������������������������������������������102 Chapter 7: Managing State ���������������������������������������������������������������105 What Is State? ���������������������������������������������������������������������������������������������������105 The Shape of a StatefulWidget �������������������������������������������������������������������������107 The Most Important Rule About State! ��������������������������������������������������������������108 Passing State Down ������������������������������������������������������������������������������������������109 Lifting State Back Up ����������������������������������������������������������������������������������������110 An Example of State Management ��������������������������������������������������������������������112 When Should We Use State? �����������������������������������������������������������������������������116 Conclusion ��������������������������������������������������������������������������������������������������������118 TAbLE OF CONTENTS
📄 Page 11
xi Chapter 8: State Management Libraries �������������������������������������������119 The InheritedWidget ������������������������������������������������������������������������������������������119 The BLoC Pattern ����������������������������������������������������������������������������������������������120 Some Libraries ��������������������������������������������������������������������������������������������������121 ScopedModel �����������������������������������������������������������������������������������������������121 Redux and Hooks �����������������������������������������������������������������������������������������122 Provider �������������������������������������������������������������������������������������������������������122 Whoa! That’s a Lot of Packages! �����������������������������������������������������������������122 Raw State ����������������������������������������������������������������������������������������������������������123 Riverpod ������������������������������������������������������������������������������������������������������������124 1� Install flutter_riverpod �����������������������������������������������������������������������������125 2� Wrap Your App with a ProviderScope ������������������������������������������������������125 3� Write a Provider ���������������������������������������������������������������������������������������126 4� Inherit from ConsumerStateWidget ���������������������������������������������������������126 5� Read Data with ref�watch( ) ���������������������������������������������������������������������127 6� Write Data with ref�read( ) ������������������������������������������������������������������������128 Conclusion ��������������������������������������������������������������������������������������������������������128 Chapter 9: Making RESTful API Calls with HTTP �������������������������������129 What Is an API Call? ������������������������������������������������������������������������������������������130 The Flavors of API Requests ������������������������������������������������������������������������������131 Making an HTTP GET or DELETE Request ���������������������������������������������������������132 Making an HTTP PUT, POST, or PATCH Request �������������������������������������������������134 HTTP Responses to Widgets������������������������������������������������������������������������������135 Brute Force – The Easy Way ������������������������������������������������������������������������135 FutureBuilder – The Clean Way �������������������������������������������������������������������136 StreamBuilder ����������������������������������������������������������������������������������������������138 TAbLE OF CONTENTS
📄 Page 12
xii Strongly Typed Classes �������������������������������������������������������������������������������������140 Create a Business Class ������������������������������������������������������������������������������140 Write a �fromJSON() Method ������������������������������������������������������������������������141 Use �fromJSON() to Hydrate the Object �������������������������������������������������������141 One Big Example �����������������������������������������������������������������������������������������������142 Overview of the App ������������������������������������������������������������������������������������143 Create the Flutter App����������������������������������������������������������������������������������145 Making a Strongly Typed Business Class ����������������������������������������������������146 list_people�dart ��������������������������������������������������������������������������������������������147 A GET Request in Flutter ������������������������������������������������������������������������������150 A DELETE Request in Flutter ������������������������������������������������������������������������150 upsert_person�dart ��������������������������������������������������������������������������������������151 A POST and PUT Request in Flutter �������������������������������������������������������������152 Conclusion ��������������������������������������������������������������������������������������������������������153 Chapter 10: Styling with Themes������������������������������������������������������155 Thinking in Flutter Styles ����������������������������������������������������������������������������������155 Individual Styles ������������������������������������������������������������������������������������������������156 Styling Text ��������������������������������������������������������������������������������������������������156 Mass-Changing Values ��������������������������������������������������������������������������������������158 Themes �������������������������������������������������������������������������������������������������������������159 1� ColorScheme �������������������������������������������������������������������������������������������160 2� TextTheme �����������������������������������������������������������������������������������������������164 3� Widget-Specific Themes ��������������������������������������������������������������������������166 4� Put Them Together in a Theme ����������������������������������������������������������������167 5� Override the Styles on Individual Widgets �����������������������������������������������168 TAbLE OF CONTENTS
📄 Page 13
xiii Final Styling Thoughts ���������������������������������������������������������������������������������������169 A Word About Colors ������������������������������������������������������������������������������������169 Custom Fonts�����������������������������������������������������������������������������������������������171 Conclusion ��������������������������������������������������������������������������������������������������������174 Chapter 11: Laying Out Your Widgets �����������������������������������������������177 Our Approach ����������������������������������������������������������������������������������������������������177 1� Layout the Entire Screen (a�k�a� Scene) ��������������������������������������������������178 2� Position Widgets Above and Below Each Other or Side by Side ��������������178 3� Handle Situations When We Run Out of Space and Overflow the Scene ������������������������������������������������������������������������������������������������180 4� Handle Extra Space in the Scene ������������������������������������������������������������180 5� Make Finer Adjustments in Positioning ���������������������������������������������������181 Laying Out the Whole Scene �����������������������������������������������������������������������������181 MaterialApp Widget �������������������������������������������������������������������������������������182 The Scaffold Widget�������������������������������������������������������������������������������������183 The AppBar Widget ��������������������������������������������������������������������������������������185 SafeArea Widget ������������������������������������������������������������������������������������������186 Flutter’s Layout Algorithm ���������������������������������������������������������������������������������187 The Dreaded “Unbounded Height” Error ������������������������������������������������������187 The Algorithm Itself �������������������������������������������������������������������������������������������191 Conclusion ��������������������������������������������������������������������������������������������������������194 Chapter 12: Layout – Positioning Widgets ����������������������������������������195 Putting Widgets Next to or Below Others ����������������������������������������������������������195 Responsive Design ��������������������������������������������������������������������������������������������197 Responsive Design in Flutter �����������������������������������������������������������������������197 Flex and MediaQuery �����������������������������������������������������������������������������������198 Conclusion ��������������������������������������������������������������������������������������������������������199 TAbLE OF CONTENTS
📄 Page 14
xiv Chapter 13: Layout – Fixing Overflows ���������������������������������������������201 Overflow Warning Bars �������������������������������������������������������������������������������������201 Our Options to Correct Overflows����������������������������������������������������������������������202 A Sample Problem to Solve �������������������������������������������������������������������������������203 1� Allow the Children to Wrap ����������������������������������������������������������������������������205 2� Squeeze the Children Until They Fit ��������������������������������������������������������������206 3� Allow the User to Scroll ���������������������������������������������������������������������������������208 SingleChildScrollView Widget ����������������������������������������������������������������������209 The ListView Widget ������������������������������������������������������������������������������������211 GridView Widget ������������������������������������������������������������������������������������������214 Conclusion ��������������������������������������������������������������������������������������������������������218 Chapter 14: Layout – Filling Extra Space ������������������������������������������219 What if There’s Extra Space Left Over? �������������������������������������������������������������220 mainAxisAlignment �������������������������������������������������������������������������������������������220 crossAxisAlignment �������������������������������������������������������������������������������������222 IntrinsicWidth ����������������������������������������������������������������������������������������������223 Expanded Widget ����������������������������������������������������������������������������������������������224 Open Space with Expandeds �����������������������������������������������������������������������227 Conclusion ��������������������������������������������������������������������������������������������������������228 Chapter 15: Layout – Fine-Tuning Positioning ����������������������������������229 Container Widget and the Box Model ����������������������������������������������������������������230 EdgeInsets for Padding and Margin ������������������������������������������������������������������231 Alignment and Positioning Within a Container ��������������������������������������������������232 Container Sizes Are Not Obvious �����������������������������������������������������������������������234 Container Decorations ���������������������������������������������������������������������������������������236 Border ����������������������������������������������������������������������������������������������������������239 TAbLE OF CONTENTS
📄 Page 15
xv BorderRadius �����������������������������������������������������������������������������������������������240 BoxShape ����������������������������������������������������������������������������������������������������242 Conclusion ��������������������������������������������������������������������������������������������������������244 Chapter 16: Layout – Special Presentation Widgets �������������������������245 Slivers ���������������������������������������������������������������������������������������������������������������245 Stack Widget �����������������������������������������������������������������������������������������������������246 Positioned Widget ����������������������������������������������������������������������������������������248 Card Widget �������������������������������������������������������������������������������������������������250 The Table Widget �����������������������������������������������������������������������������������������������251 Conclusion ��������������������������������������������������������������������������������������������������������254 Appendix A: Dart Language Overview ����������������������������������������������255 Appendix B: Futures, Async, and Await ��������������������������������������������271 Appendix C: Including Packages in Your Flutter App������������������������277 Appendix D: How to Work with Files�������������������������������������������������287 Appendix E: How to Debug Your Layout ��������������������������������������������297 Index �������������������������������������������������������������������������������������������������301 TAbLE OF CONTENTS
📄 Page 16
xvii About the Author Rap Payne started Agile Gadgets LLC, a mobile app development company, in 2003. Through it, Rap is a consultant, trainer, and entrepreneur who has written apps, mentored developers, and taught software development classes for government agencies like the NSA, FBI, US Air Force, Navy, Army, NASA, and Britain’s GCHQ and for Fortune 500 companies like Boeing, Walmart, Coca-Cola, Wells Fargo, CVS, Chase, HP, Lockheed Martin, Exxon- Mobil, Lowe’s, Nike, USAA, and Raytheon, to name a few. Rap and Becky have been married for over 30 years. In addition to their five home-educated children, Rap is a spiritual father to many younger men whom he has mentored over the years. Rap is a middle-of-the-pack marathoner, triathlete, and power lifter. As a professional mentor and trainer, Rap has mastered teaching highly complex ideas in easy-to-understand ways. And as a real-world developer, he understands the need to teach these topics using practical and realistic examples and exercises.
📄 Page 17
xix Massimo Nardone has more than 22 years of experience in security, web/mobile development, cloud, and IT architecture. His true IT passions are security and Android. He has been programming and teaching how to program with Android, Perl, PHP, Java, VB, Python, C/C++, and MySQL for more than 20 years. He holds a Master of Science in Computing Science from the University of Salerno, Italy. He has worked as a project manager, software engineer, research engineer, chief security architect, information security manager, PCI/ SCADA auditor, and senior lead IT security/cloud/SCADA architect for many years. His technical skills include security, Android, cloud, Java, MySQL, Drupal, Cobol, Perl, web/mobile development, MongoDB, D3, Joomla, Couchbase, C/C++, WebGL, Python, Pro Rails, django CMS, Jekyll, Scratch, and so on. He works as Chief Information Security Officer (CISO) for Cargotec Oyj. He worked as a visiting lecturer and supervisor for exercises at the Networking Laboratory of the Helsinki University of Technology (Aalto University). He holds four international patents (PKI, SIP, SAML, and proxy areas).     About the Technical Reviewer
📄 Page 18
xxi Who Is This Book For? If you’re a developer with experience in some object-oriented language like Java, C#, C++, or Objective-C and you want to create Android apps, iOS apps, or web apps with Flutter, this book is for you. It is especially important for you if you want to create an app that runs on multiple platforms and if you are new to Flutter. If you’ve got some experience already with Flutter, you’ll undoubtedly learn something, but we’re not expecting that you have any prerequisite knowledge or experience with Flutter. All of our chapters are written with the assumption that everything in Flutter is completely new to you. If you know anything about iOS development, Android development, or web development, that will certainly help with understanding the topics because there are lots of analogies in them for Flutter. The more you know about those things, the better, especially JavaScript and React. But if you know none of them, don’t fret. They’re by no means necessary. Knowledge of the Dart language also will help. There are some unique but very cool Dart features that we consider best practices. We could have “simplified” the code by not using these best practices, but in the long run, that’s not doing you any favors. Instead, we go ahead and use them, but we do explain those things in Appendix A, “Dart Language Overview.” In there, we give you a cheat sheet with just enough detail to write code, followed by a more in-depth explanation of the features that will be unexpected by developers of other languages. Pay special attention to the section called “Unexpected Things About Dart.”
📄 Page 19
xxii What Is Covered? This book teaches you how to create fully functioning and feature-rich apps that run on iOS, Android, desktops, and the Web. 1. Hello Flutter – Welcome to Flutter! We’re giving you a feel for why you’re here. What problems does Flutter solve? Why the boss would choose Flutter vs. some other solution. 2. Developing in Flutter – Flutter’s set of tools aren’t always straightforward. We explain what each tool does and how to use it. This chapter guides you through the process of write-debug-test-run. We get an understanding of the tooling including installation and maintenance. 3. Everything Is Widgets – Widgets are super important to Flutter since they’re the building blocks of every Flutter app. We show why and provide the motivation and how-to to create widgets. Topics include composition, UI as code, widget types, keys, and stateless vs. stateful widgets. 4. Value Widgets – A deep dive into widgets that hold a value, especially user-input fields. Topics include Text, Image, and Icon widgets and how to create forms in Flutter. 5. Responding to Gestures – How to make your program do things in response to user actions like taps, swiping, pinching, and the like. We’ll show you the button family and the GestureDetector widget. WHO IS THIS bOOk FOR?
📄 Page 20
xxiii 6. Navigation and Routing – Navigation is making the app hide one widget and show another in response to user actions. This makes them feel like they’re moving from one scene to another. We’ll cover stack navigation, tab navigation, and drawer navigation. 7. Managing State – How to get data from one widget to another and how to change that data. We cover how to create StatefulWidgets and design them in the best way. 8. State Management Libraries – An overview of several libraries and a how-to for a super-simple library called Raw State and the most popular one – Riverpod. 9. Making RESTful API Calls with HTTP – How to read from and write to an HTTP API server. This is where we show how to make GET, POST, PUT, DELETE, and PATCH requests. 10. Styling with Themes – This is where we answer all the questions needed to get a real-world app looking good and staying consistent throughout with styles and themes. 11. Laying Out Your Widgets – The beginning of the final section, this chapter introduces the idea of layouts and steps to control layouts and exposes the Flutter layout algorithm. 12. Layout – Positioning Widgets – How to control how widgets are placed side by side and/or above and below. WHO IS THIS bOOk FOR?
The above is a preview of the first 20 pages. Register to read the complete e-book.

💝 Support Author

0.00
Total Amount (¥)
0
Donation Count

Login to support the author

Login Now
Back to List