LimitedBox (Flutter Widget of the Week)


Channel: Flutter
Uploaded by Flutter on 20190625
Categories: People & Blogs
Tags: LimitedBox, ListView, max height, containers, unbounded environments, widgets, size constraints, unbounded parent, google, developers, assign size constraints, parent and child, Flutter, Flutter Widgets, Flutter Widget of the Week, Flutter 101, Flutter developers, Flutter.dev, UI, UX, UI/UX, GDS: Yes;
Ever had a widget that misbehaved when given unlimited size to grow? The LimitedBox widget provides size constraints to widgets in cases where their dimensions are unbounded. Learn more about LimitedBox → https://goo.gle/2wXZTM8 This video is also subtitled in Chinese, Indonesian, Italian, Japanese, Korean, Portuguese, and Spani

The video discusses the LimitedBox widget in Flutter and how it handles widget sizing in unbounded environments [00:20].

Introduction to the Problem

Image for chunk 1

: While many widgets determine their size based on constraints from their parents, widgets like ListView, row, or column do not always impose size b

Image for chunk 2

ounds on their children [00:06].

Function of LimitedBox: The LimitedBox widget gives its child a default size specifically when the parent's constra

Image for chunk 3

ints are unbounded [00:20]. If the parent already constrains its size, the LimitedBox has no effect [00:28].

Example with Unbounded Constraints: For

Image for chunk 4

instance, when using a ListView where the scroll direction is unbounded, standard widgets that attempt to match the parent size may appear with a s

Image for chunk 5

ize of zero [00:51]. Wrapping those containers inside a LimitedBox imposes a default maximum height on each container [01:05], giving them natural d

Image for chunk 6

imensions in an unbounded environment [01:12].

https://www.youtube.com/watch?v=uVki2CIzBTs

LimitedBox (Flutter Widget of the Week)

Flutter · 249K vi

No image available for chunk 7

Viewer Discussion & Comments

@yasharora4623
Google : how many widgets you want ?
@christianeichmueller8637
I'm a simple man. I see a flutter video and I click like!
@victoremeka
After a day of spiralling into a flutter layout rabbit hole, this video is an absolute gem.
@Huy-ed2re
I recognize the voice behind this clip was Emily. Thank you for making these! You guys are awesome!
@mahmud-ahsan
I liked this widget. It really helps to set something in default size when parent's size is unknown.
@AbdallaElmedny
I had a hard time understanding constraints coming from CSS. But the moment you said container set their height to 0 when unconstrained. It all clicked! Thanks
@zx112344567789
I think the example is not good enough to explain the widget. If it come to "unbounded constraint" from parent, the Sizedbox, ConstraintedBox can also do the same thing for the child.
@RodyDavis
You can use this on flutter_web since height is unbounded!
@danvilela
Never heard of it. Will start using it! Thx☺️
@sopheaktraphim9146
Love these short videos. I don't even use flutter that much, but I remember like all the widget they have shown.
@prafulgupta7004
Please make video on How to write efficient code?
@tyshanthedev1985
I love everything you guys have done. Thanks.
@dkq98-l
This will surely simplify design patterns.
@joehsiao6224
Why not just set a container's height?
@rajkumarmigsingh
This is what i want thank you Flutter!😊✌🏻