<< Previous Next >>

Flutter for Beginners (Thomas Bailey, Alessandro Biessek)(Z-Library)

Author: Thomas Bailey, Alessandro Biessek

后端

No Description

📄 File Format: PDF
💾 File Size: 7.5 MB
12
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 for Beginners Fourth Edition Copyright © 2026 Packt Publishing All rights reserved . No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. Portfolio Director : Ashwin Nair Relationship Lead : Sneha Shinde ProjectManager : Vishnu Priya R Content Engineer : Kinnari Chohan Technical Editor: Rohit Singh Copy Editor: Safis Editing Indexer: Manju Arasan Proofreader: Kinnari Chohan ProductionDesigner: Prashant Ghare Growth Lead : Sohini Ghosh First edition: September 2019 Second edition: October 2021 Third edition: October 2023 Fourth edition: February 2026 Production reference: 2080526 Published by Packt Publishing Ltd. Grosvenor House 11 St Paul's Square Birmingham B3 1RB, UK. ISBN 978-1-80580-365-2
📄 Page 3
packtpub.com To my long-suffering wife, Laura Bailey, who allows me to embark on all manner of crazy projects, and my two lovely (most of the time) children, Lottie and Bobby, who keep life exciting and fresh. Love you all so much! – Tom Bailey Contributors About the authors Thomas Bailey has an extensive background in tech, working for high-profile companies as a senior developer, solutions architect, and CTO. His education start-up used Flutter as the sole technology powering its education apps, and the 2025 National Technology Award (NTA) winning Vyne prescription service is built on Flutter. He has enjoyed watching Flutter move from beta to the fully-fledged and highly popular framework we see today. He loves to talk tech over a hot chocolate with anyone who will listen and is constantly exploring the cutting edge of tech and how it will shape our industry in the future. I want to thank the people who have supported me, especially my wife, Laura, and my colleagues across Ocado, IBM, Life Ninja, Rappi, and Optimum Medical, whose wisdom I have learned from. Alessandro Biessek was born in the beautiful city of Chapecó, in the state of Santa Catarina, southern Brazil, in 1993. He is currently working on mobile application development for Android and iOS in his hometown. He has more than 9 years of experience in development, from desktop development with Delphi to backend with PHP, Node.js, Golang, mobile development with Apache Flex, and Java/Kotlin. Most of his time is devoted to the development of Android apps. Always interested in new technologies, he has been following the Flutter framework for a long time, through its growth and adoption in recent months. About the reviewers Ahmed Fathy is a senior software engineer and developer relations engineer based in Alexandria, Egypt. With years of experience as an instructor, he is passionate about bridging the gap between complex engineering and accessible learning. Ahmed thrives on building communities and connecting with developers to foster growth in the tech ecosystem. As a technical reviewer, he leverages his deep Flutter expertise and teaching background to ensure that the content is accurate, clear, and valuable for readers. Randal Schwartz is a self-taught programmer, writer, trainer, and new media host with a passion for technology and creative pursuits. Throughout his career, Randal has honed his skills in various programming languages, including Perl, Dart, and Flutter, and has become a recognized expert in the field. Notably, he has authored several JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 4
influential books on Perl programming, including Programming Perl , Learning Perl , and Effective Perl Programming . He is currently recognized as a Google Developer Expert in the areas of Dart and Flutter (one of 10 in the United States and 150 in the world). Randal's professional journey has taken him through diverse roles, from software developer and system administrator to consultant and technical writer. He has contributed his expertise to numerous organizations, including Stonehenge Consulting Services, Inc., O'Reilly & Associates, and TWiT.tv, where he hosted the popular show FLOSS Weekly . Beyond his technical prowess, Randal is also a gifted communicator and educator. He has lectured at conferences, provided technical training, and shared his insights through magazine articles and online platforms. Randal's unique blend of technical expertise, writing talent, and engaging personality has made him a sought-after speaker, author, and consultant in the tech industry. JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 5
Table of Contents Preface Free benefits with your book Part 1: Learning the Core Concepts Chapter 1: What Is Flutter and Why Should I Use It? Technical requirements What is Flutter? Backed by Google • Dart • One code base to rule them all • Bidirectional communication between Flutter and native • High performance • Full control of the UI • Open source framework • Developer resources and tooling • Future operating systems and Flutter • Hello Flutter – a first glimpse of Flutter Installing Flutter • Development environment • Hello World! • Widgets, widgets, everywhere Flutter rendering • Flutter – rendering by itself • Composability • Immutability • Everything is a widget • An example widget • The widget tree • The element tree • Building and running Flutter Debug mode • Release mode • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 6
Profile mode • Supported platforms • The pubspec.yaml file • Running the generated project • flutter run • The lib/main.dart file • Summary Questions Further reading Chapter 2: An Introduction to Dart Technical requirements Getting started with Dart The evolution of Dart • How to run Dart • Dart VM and JavaScript compilation • Introducing the structure of the Dart language • Object orientation • Type safety • Libraries • Hands-on with Dart • DartPad • Hello World, Dart style • The main function • The print function • Variables and data types Variable declaration • Null safety • ? declaration • Late variables • Accessing nullable variables • Built-in types • Numbers • Booleans • Lists • Sets • Maps • Strings • String interpolation • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 7
Literals • final and const • dynamic and using 'as' • Dart operators • Arithmetic operators • Increment and decrement operators • Equality and relational operators • Logical operators • Control flows and looping if/else • while and do-while loops • for loops • break and continue • switch • Hands-on example, continued • Functions and methods Function parameters • Required positional parameters • Optional positional parameters • Named parameters • Records • Function as a type • Anonymous functions • Lexical scope • Summary Questions Further reading Chapter 3: Flutter versus Other Frameworks Native development Developer skillset • Project management • Defect reports • Performance • Platform features • Hot reload • User experience • App size • New platforms • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 8
Retired platforms • AI assistance • Development resources • Overview • Cross-platform frameworks React Native • Moving to Flutter from React Native • Xamarin • Moving to Flutter from Xamarin.Forms • .NET MAUI • Moving to Flutter from .NET MAUI • Cordova • Moving to Flutter from Cordova • Framework popularity • The Flutter community Events • News and discussion • Resources • Flutter strengths and weaknesses Strengths • Weaknesses • Live Flutter apps Artificial intelligence • Summary Questions Further reading Chapter 4: Dart Classes and Constructs Technical requirements Object orientation in Dart Objects and classes • Other OOP artifacts • Encapsulation • Inheritance and composition • Abstraction • Polymorphism • Functions as objects • Understanding classes in Dart Class structure • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 9
Field accessors – getters and setters • Static fields and methods • Constructors • Named constructors • Factory constructors • Records • Class inheritance • Abstract classes • Interfaces • Mixins • Files and imports • The enum type Using generics When and why to use generics • Generics and Dart literals • Nullability in generics • Asynchronous programming Dart futures • Dart isolates • Summary Questions Further reading Part 2: Building a Basic Flutter App Chapter 5: Building Your User Interface through Widgets Technical requirements Stateful/stateless widgets Stateless widgets • Code example • Stateful widgets • Code example • Let's experiment • Inherited widgets • The widget key property • Built-in widgets Material Design and iOS Cupertino widgets • Display widgets • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 10
The Text widget • The Image widget • The Icon widget • Let's experiment • User interaction widgets • Buttons • Text fields • Selection widgets • Date and time pickers • Callbacks • Let's experiment • Layouts • Container • Specialized containers • Row and Column • Stack • Scaffold • ListView and GridView • Other layouts • Dialogs • Advanced widgets (gestures, animations, and transformations) • Summary Questions Further reading Chapter 6: Handling User Input and Gestures Technical requirements Handling user gestures Pointers • Gestures • GestureDetector • Tap • Double-tap • Press and hold • Drag, pan, and scale • Gestures in material widgets • A deeper look at the stateful widget life cycle Key life cycle states • Creation of the state • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 11
Initializing the state • Build • Disposing of the state • Mounted • Input widgets and forms Getting input through the onChanged callback • Getting input through a controller • Form and FormField • Accessing FormField's state • Form • Accessing the state of Form • Validating user input • Let's experiment • Custom input and FormField Creating custom inputs • Custom input widget example • Creating an input widget • Turning the widget into a FormField widget • Summary Questions Further reading Chapter 7: Let's Get Graphical! Technical requirements Make me pretty Using colors • Text style • Container decoration • Buttons • The Scaffold widget Drawer • Snackbar • And there's much more… • Creating elegant content lists Let's experiment • Understanding image types in Flutter Out-of-the-box support • SVG • Lottie files • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 12
Slivers Lists with navigation • SliverAppBar • Summary Questions Further reading Chapter 8: Routing – Navigating between Screens Technical requirements Understanding the Navigator widget Evolution of Flutter navigation • The Navigator widget • Navigator 1.0 • Route • Putting it all together • Named routes • Retrieving results from Route • Navigator 2.0 • Pages • Navigator 2.0 in action • go_router • Other routing options • Screen transitions PageRouteBuilder • Custom transitions in practice • Summary Questions Further reading Part 3: Turning a Simple App into an Awesome App Chapter 9: Maintaining Application State Technical requirements Why do we need application state? Passing state around the widget tree • Using providers The football ground ratings provider • Using FootballGroundRatingsProvider • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 13
Listening for change notifications • Additional provider usages • MultiProvider • Multiple consumers • GetIt Initializing GetIt • Accessing GetIt singletons • Additional GetIt usages • GetIt instance shortcuts • Lazy singletons • Services • Other state options InheritedWidget • BLoC • Redux • Other options • Summary Questions Further reading Chapter 10: Flutter Plugins – Get Great Functionality for Free! Technical requirements What is a plugin? Benefits • Code reuse • Many eyes • Domain expertise • Drawbacks • Version management • Difficult to diagnose bugs • Breaking changes • Abandoned plugins • Where can I find plugins? Plugin entry • How do I add a plugin to my project? The pubspec.yaml file • flutter pub • flutter pub get • flutter pub outdated • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 14
flutter pub upgrade • Using a plugin in your code • Import statements • Adding Dart files • Using the plugin • Putting it all together • How do plugins work? MethodChannel • iOS and CocoaPods • Android and Gradle • Web • Other platforms • Common issues Plugin breaking change • Plugin not working • PR not merged • Inconsistent dependencies • MissingPluginException • Summary Questions Further reading Chapter 11: Popular Third-Party Plugins Technical requirements Exploring Firebase plugins Firebase registration • Connecting the Flutter app to Firebase • FlutterFire plugins • Firebase initialization • Authentication • Setup • The authStateChanges stream • Sign-in • Realtime Database • Setup • Data manipulation • Security • Firestore • Setup • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 15
Data manipulation • Security • Analytics and Crashlytics • Crashes • Analytics • Cloud Storage • Firebase data connect • AdMob • Cloud Functions • Machine learning with Google ML Kit • Messaging • AI logic • Understanding Google Maps and Places Exploring mobile device features Camera and QR codes • Opening web pages • Local storage • Video • Payment providers • In-app purchases • Opening files • Plugins to help with your app support Sentry • App version • Device information • Summary Questions Further reading Chapter 12: Using Widget Manipulations and Animations Technical requirements Transforming widgets with the Transform class The Transform widget • Understanding the Matrix4 class • Exploring the types of transformations • Rotate transformation • Scale transformation • Translate transformation • Composed transformations • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 16
Introducing animations The Animation class • AnimationController • TickerProvider and Ticker • CurvedAnimation • Tween • Using animations Rotate animation • Scale animation • Translate animation • Using AnimatedBuilder The AnimatedBuilder class • Revisiting our animation • Implicitly animated widgets AnimatedContainer • AnimatedFoo • Let's experiment • Summary Questions Further reading Part 4: Testing and Releasing Your App Chapter 13: Testing and Debugging Technical requirements Unit testing The Dart test package • Writing unit tests • Unit test mocking • Widget testing The WidgetTester class • The testWidgets function • Widget test example • Running a widget test • Debugging your app Debugging in the IDE • Additional debugging features • Debugger statement • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 17
print and debugPrint • assert • DevTools The widget inspector • Profile mode • Performance overlay • UI thread • The raster thread • Other threads • Summary Questions Further reading Chapter 14: Releasing Your App to the World Technical requirements Preparing your app for deployment Preparing the stores • Registering as a developer • A business model • Preparing for the web • Releasing your app on Android AndroidManifest and build.gradle • Permissions • Meta tags • Application icon and name • Application ID and versions • Signing the app • Building and uploading your appbundle • Releasing your app on iOS App Store Connect • 1. Registering the bundle ID • 2. Creating your app entry • Xcode • Application details and bundle ID • App icon • Signing the app • Building and uploading • Releasing your app on the web Firebase hosting • JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 18
WebAssembly • PWA support • Tracking app usage and crashes Crashlytics • Sentry • Google Analytics • Summary Questions Further reading Chapter 15: Free Benefits with Your Book Appendix: AI Tooling and Vibe Coding Machine learning Large language models • Code completion assistants GitHub Copilot • Tabnine • AI chat clients GitHub Copilot • CodeGPT • Vibe coding The user interactions • The code structure • Third-party dependencies • Building a plan • Your vision • Technology choices • Design choices • Third-party services • User interface • Other considerations • Cursor.ai • Cursor rules • Generating an app • Future AI trends Summary Further reading JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 19
Other Books You May Enjoy Index JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
📄 Page 20
Preface Flutter for Beginners introduces you to the world of Flutter and how you can use it to build awesome mobile applications. We'll start by looking at the reasons why Flutter was created, then we'll explore the elegance of the Dart language, and finally, we'll move on to an in-depth examination of the Flutter structures and concepts needed to make a high-level app. Together, we will study the whole Flutter life cycle, from project creation to app release. With clear code examples, you will learn how to start a small Flutter project, add some widgets, apply styles and themes, connect with remote services such as Firebase, get user input, add some animations to improve the user experience, and more. In addition, you will learn about why you should choose Flutter, how to test your app, how to monitor your app, and some common gotchas you may experience in the release process. In short, this book will prepare you for the future of mobile development with the amazing Flutter framework. JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh JOIN THIS DISCORD SERVER IF YOU WANT THE COMPLETE PDF BOOK: https://discord.gg/Bk3Qz8u5kh
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

Recommended for You

Loading recommended books...
Failed to load, please try again later
Back to List