Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Flutter Design Patterns and Best Practices

You're reading from   Flutter Design Patterns and Best Practices Build scalable, maintainable, and production-ready apps using effective architectural principles

Arrow left icon
Product type Paperback
Published in Sep 2024
Publisher Packt
ISBN-13 9781801072649
Length 362 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (3):
Arrow left icon
Jaime Blasco Jaime Blasco
Author Profile Icon Jaime Blasco
Jaime Blasco
Daria Orlova Daria Orlova
Author Profile Icon Daria Orlova
Daria Orlova
Esra Kadah Esra Kadah
Author Profile Icon Esra Kadah
Esra Kadah
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Part 1: Building Delightful User Interfaces
2. Chapter 1: Best Practices for Building UIs with Flutter FREE CHAPTER 3. Chapter 2: Responsive UIs for All Devices 4. Part 2: Connecting UI with Business Logic
5. Chapter 3: Vanilla State Management 6. Chapter 4: State Management Patterns and Their Implementations 7. Chapter 5: Creating Consistent Navigation 8. Part 3: Exploring Practical Design Patterns and Architecture Best Practices
9. Chapter 6: The Responsible Repository Pattern 10. Chapter 7: Implementing the Inversion of Control Principle 11. Chapter 8: Ensuring Scalability and Maintainability with Layered Architecture 12. Chapter 9: Mastering Concurrent Programming in Dart 13. Chapter 10: A Bridge to the Native Side of Development 14. Part 4: Ensuring App Quality and Stability
15. Chapter 11: Unit Tests, Widget Tests, and Mocking Dependencies 16. Chapter 12: Static Code Analysis and Debugging Tools 17. Index 18. Other Books You May Enjoy

What this book covers

Chapter 1, Best Practices for Building UIs with Flutter, discusses the difference between imperative and declarative approaches to UI building and why modern frameworks prefer the latter. We will explore the details of the Flutter widget tree system, and practical advice on how to build performant interfaces.

Chapter 2, Responsive UI for All Devices, provides an overview of the Flutter layout algorithm, dives into the best practices and available options for building responsive interfaces, and covers accessibility best practices.

Chapter 3, Vanilla State Management, opens the topic of state management in Flutter. It provides the definition of state and its different types. In this chapter, we start building the Candy Store app, which we will continue building throughout the book, and learn how to implement state management patterns in the vanilla Flutter way. You will also see an overview of the InheritedWidget class details, and practical tips on working with BuildContext in Flutter.

Chapter 4, State Management Patterns and Their Implementations, continues the topic of state management, introducing popular industry patterns such as MVVM and MVI, the rationale behind using them, and their implementation in Flutter with and without third-party libraries.

Chapter 5, Creating Consistent Navigation, provides an overview of navigation patterns in Flutter, going into details on how to implement imperative style navigation and declarative style navigation. We will see some examples of building complex navigation scenarios and when to choose which approach.

Chapter 6, The Responsible Repository Pattern, introduces the Repository pattern and its benefits for scalable app architecture. The chapter goes deep into implementation details and explores practices for building flexible data sources.

Chapter 7, Implementing the Inversion of Control Principle, explores various approaches to implementing the Inversion of Control principle, via practices such as dependency injection and the Service Locator pattern, and demonstrates their practical application with the help of different libraries.

Chapter 8, Ensuring Scalability and Maintainability with Layered Architecture, provides an overview of how to structure the code that we have built up to this point according to layered architecture principles. The chapter also highlights how we have been following the SOLID and other best software design principles all along.

Chapter 9, Mastering Concurrent Programming in Dart, introduces concepts related to concurrent programming in general and provides an overview of asynchronous APIs in Dart. The chapter goes into details of how to work efficiently with the Future APIs, as well as how to handle parallel operations with the Isolates API.

Chapter 10, A Bridge to the Native Side of Development, provides an overview of the Flutter app architecture from the perspective of the SDK and hosting platforms. The chapter goes into details of working with platform channels, a mechanism used to communicate with the host platform, as well as demonstrating the shortcomings of this API. We then explore a type-safe way to implement that communication via the pigeon code generation library.

Chapter 11, Unit Tests, Widget Tests, and Mocking Dependencies, provides an overview of the automated testing approaches in Flutter. You will learn how to write unit tests and go into the details of widget testing. The chapter showcases the mocking dependencies technique and how to implement it with the Mockito library.

Chapter 12, Static Code Analysis and Debugging Tools, discusses the topic of static analysis in Flutter and why it’s important to establish coding conventions and follow them consistently. We then see how this can be automated by setting up a robust static analysis system. The chapter also explores debugging practices and their applications, such as logging, assertions, breakpoints, and Flutter DevTools.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime