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 An introductory guide to building cross-platform mobile applications with Flutter and Dart 2

Arrow left icon
Product type Paperback
Published in Sep 2019
Publisher Packt
ISBN-13 9781788996082
Length 512 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Alessandro Biessek Alessandro Biessek
Author Profile Icon Alessandro Biessek
Alessandro Biessek
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Section 1: Introduction to Dart
2. An Introduction to Dart FREE CHAPTER 3. Intermediate Dart Programming 4. An Introduction to Flutter 5. Section 2: The Flutter User Interface - Everything is a Widget
6. Widgets: Building Layouts in Flutter 7. Handling User Input and Gestures 8. Theming and Styling 9. Routing: Navigating between Screens 10. Section 3: Developing Fully Featured Apps
11. Firebase Plugins 12. Developing Your Own Flutter Plugin 13. Accessing Device Features from the Flutter App 14. Platform Views and Map Integration 15. Section 4: Advanced Flutter - Resources to Complex Apps
16. Testing, Debugging, and Deployment 17. Improving User Experience 18. Widget Graphic Manipulations 19. Animations 20. Other Books You May Enjoy

Using AnimatedBuilder

Looking at the code that we wrote in the last section, there is nothing wrong with it: it's not too complex or big. However, looking closely, we can see a small problem with it, our button animation is mixed up with other widgets. As long as our code does not scale and get 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 RaisedButton 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 lemmas in the Flutter framework.

The AnimatedBuilder class

...
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