Search icon CANCEL
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 for Beginners

You're reading from   Flutter for Beginners Cross-platform mobile development from Hello, World! to app release with Flutter 3.10+ and Dart 3.x

Arrow left icon
Product type Paperback
Published in Oct 2023
Publisher Packt
ISBN-13 9781837630387
Length 406 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Alessandro Biessek Alessandro Biessek
Author Profile Icon Alessandro Biessek
Alessandro Biessek
Thomas Bailey Thomas Bailey
Author Profile Icon Thomas Bailey
Thomas Bailey
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Part 1:Learning the Core Concepts
2. Chapter 1: What Is Flutter and Why Should I Use It? FREE CHAPTER 3. Chapter 2: An Introduction to Dart 4. Chapter 3: Flutter versus Other Frameworks 5. Chapter 4: Dart Classes and Constructs 6. Part 2:Building a Basic Flutter App
7. Chapter 5: Building Your User Interface through Widgets 8. Chapter 6: Handling User Input and Gestures 9. Chapter 7: Let’s Get Graphical! 10. Chapter 8: Routing – Navigating between Screens 11. Part 3:Turning a Simple App into an Awesome App
12. Chapter 9: Flutter Plugins – Get Great Functionality for Free! 13. Chapter 10: Popular Third-Party Plugins 14. Chapter 11: Using Widget Manipulations and Animations 15. Part 4:Testing and Releasing Your App
16. Chapter 12: Testing and Debugging 17. Chapter 13: Releasing Your App to the World 18. Index 19. Other Books You May Enjoy

Using AnimatedBuilder

Looking at the code that we wrote in the previous section, we can see a small problem with it – our button animation is mixed up with other widgets. So long as our code does not scale and become more complex, this is fine, but we know this is not the case most of the time, so we might have a real problem.

The AnimatedBuilder class can help us with the task of separating responsibilities. Our widget, whether it is ElevatedButton or anything else, does not need to know it is rendered in animation, and breaking down the build method to widgets that each have a single responsibility can be seen as one of the fundamental concepts in the Flutter framework. Let’s look at the AnimatedBuilder class and then revisit our animation with our new knowledge.

The AnimatedBuilder class

The AnimatedBuilder widget exists so that we can build complex widgets that wish to include animation as part of a larger build function. Just as with any other widget, it...

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 $19.99/month. Cancel anytime