Check out Material Components Basics in Flutter -Part 1 (Video)

Ahmadreza Shamimi
2 min readJun 13, 2023

--

Join us as we delve into the fundamentals of Material Components in Flutter! We’ll explore how this fully adaptable system, inspired by Google’s Material Design, empowers you to craft beautiful, flexible UIs for any platform. Expect to master the basics: buttons, cards, text fields, and more. Perfect for beginners seeking to make their Flutter apps more visually stunning and user-friendly, this stream will guide you through the process of implementing Material Components, turning complexity into simplicity. Join the journey and start building elegant interfaces with Flutter!

The `OverflowBar` widget in Flutter is designed to arrange its child elements in a horizontal row. However, if the horizontal space is insufficient to accommodate all elements (i.e., an “overflow” situation), it switches to arranging them in a vertical column. The widget’s width dynamically expands based on the space required by its children and any specified spacing until there’s an overflow. At that point, the overflow column takes up the entire available width. The property `overflowAlignment` is used to align each child within the overflow column, while `overflowSpacing` determines the space between each child.

The positioning of children in the horizontal layout is governed by the `textDirection` property, much like the `Row` widget. However, when the layout overflows, the positioning within the column is determined by the `overflowDirection` property.

To give a practical example, consider a dialog layout where the action buttons are arranged using an `OverflowBar`. If there’s an overflow, the content could be enclosed in a `SingleChildScrollView`. This would ensure that all action buttons remain reachable via scrolling, regardless of the vertical space available.

Check the video 👨🏻‍💻

Source code

--

--

Ahmadreza Shamimi
Ahmadreza Shamimi

Written by Ahmadreza Shamimi

I'm Ahmadreza Shamimi with an experienced with over 10 years of experience coding with web and mobile platforms.

No responses yet