diff --git a/docs/ff-concepts/layout/responsive-layout.md b/docs/ff-concepts/layout/responsive-layout.md index 5783287f..d9f99ee0 100644 --- a/docs/ff-concepts/layout/responsive-layout.md +++ b/docs/ff-concepts/layout/responsive-layout.md @@ -85,7 +85,7 @@ For `Row 2`, set its Expansion property to *Flexible* (the middle icon) and assi  -I encourage you to test with different web dimensions and sizes to see how well this adapts. +We encourage you to test with different web dimensions and sizes to see how well this adapts. Depending on your design needs, there are various approaches to managing space. Let's consider a different scenario: What if we want the searchBar to always occupy 40% of the screen width, with `Row 2` taking up the remaining space after placing the `searchBar` and `search IconButton`? diff --git a/docs/ff-concepts/layout/responsive-widgets/flex-widget.md b/docs/ff-concepts/layout/responsive-widgets/flex-widget.md new file mode 100644 index 00000000..f94af21e --- /dev/null +++ b/docs/ff-concepts/layout/responsive-widgets/flex-widget.md @@ -0,0 +1,90 @@ +--- +slug: /concepts/layouts/flex +title: Flex +description: Learn how to add the Flex widget in your FlutterFlow app. +tags: [Flex, Widget, Concepts] +sidebar_position: 2 +keywords: [FlutterFlow, Wrap, Concepts] +--- + +# Flex + +The **Flex** widget can be used as an alternative to **Row** and **Column**. It allows you to dynamically set the layout axis (horizontal or vertical) based on specific conditions or logic. This is especially useful for creative responsive layouts - where child elements should be horizontal when the screen is wide, and vertical when the screen is narrow. + + + + + +## Adding Flex Widget + +To use the Flex widget, add it from the **Layout Elements** section of the **Widget Palette**, then add child widgets inside it. From the properties panel, set a condition for the **Is Horizontal** property. When this condition evaluates to `True`, the items will be laid out horizontally. + +Consider an ecommerce app where recent orders are displayed vertically on mobile devices and switch to a horizontal layout on larger screens to make better use of the available space. + +