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! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Beginning Flutter

You're reading from   Beginning Flutter A hands-on guide to app development

Arrow left icon
Product type Paperback
Published in Nov 2019
Publisher Wiley
ISBN-13 9781119550822
Length 528 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Marco L. Napoli Marco L. Napoli
Author Profile Icon Marco L. Napoli
Marco L. Napoli
Arrow right icon
View More author details
Toc

5
Understanding the Widget Tree

WHAT YOU WILL LEARN IN THIS CHAPTER

  • The fundamentals of widgets
  • How to use a full widget tree
  • How to use a shallow widget tree

The widgettree is how you create your UI; you position widgets within each other to build simple and complex layouts. Since just about everything in the Flutter framework is a widget, and as you start nesting them, the code can become harder to follow. A good practice is to try to keep the widget tree as shallow as possible. To understand the full effects of a deep tree, you'll look at a fullwidgettree and then refactor it into a shallowwidgettree, making the code more manageable. You'll learn three ways to create a shallow widget tree by refactoring: with a constant, with a method, and with a widget class.

INTRODUCTION TO WIDGETS

Before analyzing the widget tree, let's look at the short list of widgets that you will use for this chapter's example apps. At this point, do not worry about understanding the...

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 £13.99/month. Cancel anytime
Visually different images