My Account Log in

1 option

Flutter Design Patterns and Best Practices : Build Scalable, Maintainable, and Production-Ready Apps Using Effective Architectural Principles / Daria Orlova, Esra Kadah, and Jaime Blasco.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Orlova, Daria, author.
Kadah, Esra, author.
Blasco, Jaime, author.
Language:
English
Subjects (All):
Application software--Development.
Application software.
Software engineering.
Physical Description:
1 online resource (362 pages)
Edition:
First edition.
Place of Publication:
Birmingham, England : Packt Publishing, [2024]
Biography/History:
Orlova Daria: Daria Orlova is a mobile app specialist, who started with native Android in 2015 and discovered Flutter in 2019. She is the co-founder of BBapps, creating apps that care for you and the planet. Previously, at Chili Labs, the top mobile agency in the Baltics, together with the team, she delivered 50+ projects, winning awards including RedDot and W3. Daria is an active community member a Google Developer Expert (GDE) in Flutter and Dart, Flutterista, and WTM ambassador, mentor, technical writer, and public speaker who is passionate about quality tech education. She holds a B. Sc. in computer science. Kadah Esra: Esra Kadah is a senior app developer specializing in Flutter, with a passion for integrating programming, UI/UX design, and psychology. She enjoys building and contributing to thriving communities. She is a co-organizer of Flutteristas, Flutter Berlin, and CMX Istanbul, and serves as a Women Techmakers Ambassador. She has delivered over 60 talks, organized more than 150 events, and hosted 40+ streams, collaborating with Google Developer Groups, Google Developer Student Clubs, the Flutter community, Flutteristas, and Women Techmakers. Blasco Jaime: Jaime Blasco is a seasoned Flutter developer with a deep-rooted passion for crafting exceptional mobile experiences. As a Google Developer Expert (GDE) in Flutter, he possesses an in-depth understanding of the framework and its capabilities. His active involvement in the Flutter community, notably as a co-leader of the Spanish Flutter community, underscores his commitment to knowledge sharing and collaboration. He currently develops the Hypervolt app, a Flutter-based solution that seamlessly connects users to EV chargers. Jaime ensures smooth user interactions and efficient hardware communication, delivering a reliable charging experience.
Summary:
Elevate your mobile app development skills using reusable software development methodologies and code design principles, leveraging proven strategies from industry experts who have fostered thriving developer communities Key Features Cover code structure, app architecture, testing, performance optimization, error handling, and more Get hands on with code examples and exercises to apply design patterns and best practices in real-world scenarios Leverage the intricacies of the Flutter framework to build better apps for your clients Purchase of the print or Kindle book includes a free PDF eBook Book Description Flutter's rapid adoption by developers and businesses alike has led to an increased demand for skilled developers who can deliver high-quality Flutter apps. Flutter can be a great tool to develop apps for yourself, but you don't always need to consider things like scalability or business goals as a hobbyist. When you build apps for a business, however, you must use specific tools to help the business achieve its goals. This requires solutions to be fast, reliable, and delivered on time. This book will help you meet these business requirements. You'll begin by learning how to build responsive UIs that work on all devices. Next, you'll delve into state management, understanding how to select the appropriate solution and gaining hands-on experience with InheritedWidget, ChangeNotifier, and BLoC. Later, you'll move on to high-level practices such as layered architecture, dependency injection, and repository patterns. The book will also show you how to develop features of any complexity, such as multithreading and native layer implementations. You'll also learn how to ensure the quality of your solutions by prioritizing testing. By the end of this book, you'll be able to deliver well-architected Flutter projects that are stable, scalable, and maintainable. What you will learn Translate business requirements into technical solutions Understand when and where specific design patterns would be applicable Separate concerns into multiple layers with scoped responsibility Build reusable architecture that can be applied to any type of app and supported by various teams Debug and solve problems before they reach the user Prevent production bugs by prioritizing testing during the development cycle Design encapsulated features that are resilient to business requirement changes and software updates Who this book is for If you're a mobile developer who has already realized the potential of Flutter as a tool to solve business problems and are looking forward to leveling up your app-building skills, then this book is for you. Freelancers, agencies, or individuals who have already developed basic applications with Flutter and want to level up their skills to build production-ready apps at scale will find this book helpful. Basic Flutter knowledge and experience in building apps will be beneficial. Moreover, if you're transitioning from another mobile framework, this book will make the transition easier.
Contents:
Cover
Title_Page
Copyright and Credits
Contributors
Table of Contents
Preface
Part 1: Building Delightful User Interfaces
Chapter 1: Best Practices for Building UIs with Flutter
Understanding the difference between declarative and imperative UI design
Understanding the imperative paradigm
Understanding the declarative paradigm
Does Flutter use the declarative or imperative paradigm?
Everything is a widget! Or is it?
What is a widget?
Getting to know the RenderObjectWidget and its children
Unveiling the Element class
Reduce, reuse, recycle!
Pushing rebuilds down the tree
Avoiding redundant rebuilds
Avoiding redundant repaints
Optimizing scroll view performance
Summary
Chapter 2: Responsive UIs for All Devices
Technical requirements
Understanding the Flutter layout algorithm
Understanding BoxConstraints
How do constraints determine the child widget's size?
Understanding the limitations of the layout rule
Designing responsive apps with Flutter
Getting to know the user's device with MediaQuery
Creating adaptive layouts
Positioning widgets relative to each other
Building flexible layouts
Scrollable items
Other layouts
Ensuring accessibility in Flutter apps
Getting to know accessibility widgets in Flutter
Font size and color contrast
Dev tooling for accessibility
Manual review
Part 2: Connecting UI with Business Logic
Chapter 3: Vanilla State Management
What is state?
Understanding the difference between ephemeral and app state
Getting to know our Candy Store app
Managing state the vanilla Flutter way
Lifting the state up
Understanding the Observer pattern
Passing around dependencies via InheritedWidget
What is InheritedWidget?.
Understanding the .of(context) pattern
Creating the CartProvider class
Interacting with BuildContext in the right place, at the right time
What is BuildContext?
Context does not contain the widget
Context contains the widget, but not the one you expect
Context accessed too early!
Context accessed too late!
Chapter 4: State Management Patterns and Their Implementations
Diving into the world of MVX patterns
Defining criteria for the state management pattern
Embracing data binding with MVVM in Flutter
Extracting data logic into the Model
Emitting data via the Streams API
Encapsulating state in CartState
Implementing the MVVM and MVI patterns with flutter_bloc
What is a cubit?
Understanding the MVI pattern
Implementing MVI with BLoC
Embracing the UDF pattern
Implementing the Segmented State Pattern
Avoiding bugs related to state equality and mutability
Chapter 5: Creating Consistent Navigation
Getting started with navigation basics in Flutter
Understanding Navigator 1.0 and routes
Leveling up with advanced navigation techniques
Navigator 2.0 and declarative routing
Comparing Navigation 1.0 and 2.0
Part 3: Exploring Practical Design Patterns and Architecture Best Practices
Chapter 6: The Responsible Repository Pattern
Introducing the repository pattern
How the repository pattern works
Setting up our first repository
Defining responsibilities
Creating our first repository
Defining repository interfaces
Why use repository interfaces?
Implementing repository interfaces
Building a data source
Repository interfaces and data sources
Setting up remote data sources
Integrating NetworkProductRepository.
Creating a local database using Hive
Adding Hive to your project
Creating a local data source
Repository interfaces
Implementing repository data retrieval
Enhancing our product repository
Integrating the repository
Integrating the repository with our business logic
Caching strategies
Caching strategy
Implementing offline mode
Understanding data synchronization
Implementing data synchronization
Automating synchronization
Refactoring the CartModel
Chapter 7: Implementing the Inversion of Control Principle
Decoupling dependency creation from usage
Identifying the singleton pattern
Introducing the IoC principle
Implementing the DI pattern via RepositoryProvider
Injecting dependencies via a constructor
Providing dependencies via RepositoryProvider
Implementing SL pattern via get_it
Bonus tip - using injectable
Selecting the right tool for the job
Chapter 8: Ensuring Scalability and Maintainability with Layered Architecture
Exploring layered architecture
Introducing multitier architecture layers
Implementing multitier architecture in the Candy Store app
Defining layers and features
Implementing layer-first architecture
Implementing feature-first architecture
Exploring file structure organization in Flutter
Scoping dependencies to a feature life cycle
How to connect multiple data sources
Following software design principles
Deciphering the acronyms of SOLID, DRY, KISS, and YAGNI
Chapter 9: Mastering Concurrent Programming in Dart
Dart is single-threaded. Or is it?
Understanding synchronous, concurrent, and parallel operations
What is the event loop?
Understanding blocking operations in Flutter.
Working with Future APIs in Dart
What does the Future hold?
Understanding the concept of async
To chain Futures or to await, that is the question
Handling independent Futures efficiently
Embracing parallelism with isolates
Implementing fuzzy search in the Candy Store app
Understanding the concept of isolates
Chapter 10: A Bridge to the Native Side of Development
Understanding Flutter app architecture
Diving into the Flutter framework layers
How does Flutter communicate with the native layer?
Encoding data with MessageCodec
Working with platform channels
Selecting the platform channel type
Implementing the UI of the Favorites feature
Using MethodChannel for favoriting items
Understanding Kotlin
Understanding Swift
Overviewing the problems introduced by vanilla MethodChannel channels
Ensuring type-safe communication via pigeon code generation
Configuring a pigeon interface
Connecting client and host via pigeon-generated code
What else you can (and can't) do with pigeon
Part 4: Ensuring App Quality and Stability
Chapter 11: Unit Tests, Widget Tests, and Mocking Dependencies
Getting started with unit testing
Introducing a fake repository
Creating test data
Writing unit tests
Widget testing fundamentals
Implementing a golden file test
Creating the CandyShopGoldenTestWidgetsPage widget
Writing widget tests
Integration testing fundamentals
Creating a fake repository
Displaying an item in the cart test
Creating the widget test with interaction
Mocking dependencies for effective testing
Understanding mocking and mockito
Writing the unit test with mockito
Chapter 12: Static Code Analysis and Debugging Tools
Technical requirements.
Following coding conventions
Using the dart format command
Following the Effective Dart conventions
Ensuring consistency and preventing bugs with static code analysis
Customizing lint rule list in analysis_options.yaml
Exploring lint setup strategies
Using the DCM tool
Creating custom lints
Exploring debugging practices and tools
Logging - the good, the bad, and the ugly
Using assertions to catch errors in debug mode
Debugging code with breakpoints
Diving into the world of Flutter DevTools
Index
Other Books You May Enjoy.
Notes:
Includes index.
Description based on publisher supplied metadata and other sources.
Description based on print version record.
ISBN:
9781801074551
1801074550
OCLC:
1455530342

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account