|
| 1 | +--- |
| 2 | +slug: building-layout |
| 3 | +title: Building Layout |
| 4 | +tags: [] |
| 5 | +description: Learn how to build layout in your FlutterFlow app. |
| 6 | +sidebar_position: 1 |
| 7 | +--- |
| 8 | +# Building Layout |
| 9 | + |
| 10 | +In FlutterFlow, you build a page layout using Widgets. **Widgets**, such as [Text](#), [Buttons](#), [Images](#), and [Icons](#), are visible on the screen. Others, like [Containers](#), [Rows](#), [Columns](#), and [Stacks](#), are not directly visible but help arrange and position the visible elements on the page. |
| 11 | + |
| 12 | +These widgets are categorized into four main types: [Layout Elements](#), [Base Elements](#), |
| 13 | +[Page Elements](#), and [Form Elements](#). To build a page, you combine different widgets from these categories to get the desired look and feel of your app. |
| 14 | + |
| 15 | +## Understanding layout concept |
| 16 | + |
| 17 | +One of the most common layout patterns is to arrange widgets either **vertically** or **horizontally**. To display widgets in a vertical layout, use the **Column** widget. For a horizontal layout, use the **Row** widget. If you need to place one widget on top of another, use the **Stack** widget. |
| 18 | + |
| 19 | +:::info |
| 20 | +**Composing widgets** is a fundamental aspect of creating layouts in FlutterFlow. It involves combining different widgets to form a cohesive and functional user interface. Understanding how to effectively compose widgets allows you to design complex layouts and create intuitive, user-friendly apps. Learn more about composing widgets [**here**](#). |
| 21 | + |
| 22 | +::: |
| 23 | + |
| 24 | +## Putting layout concept into practice |
| 25 | + |
| 26 | +Let's walk through an exercise to build the following layout: |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +The steps to build the given layout are as follows: |
| 31 | + |
| 32 | +1. [Sketch the layout](#1-sketch-the-layout) |
| 33 | +2. [Add Image section](#2-add-image-section) |
| 34 | +3. [Add info section](#3-add-info-section) |
| 35 | +4. [Add reviews section](#4-add-reviews-section) |
| 36 | + |
| 37 | +### 1. Sketch the layout |
| 38 | + |
| 39 | +When you are just starting out with building apps, this step is very crucial. Before you actually start adding widgets to the page, sketch a picture of how the main layout will be broken into smaller parts. |
| 40 | + |
| 41 | +Breaking down the given layout into sections looks like this: |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +Next, identify the widgets that can replace those sections, such as Column, Row, and Stack. Once you have a clear idea of which widgets to use, you can begin adding them. |
| 46 | + |
| 47 | +In the figure above, the main section is replaced with the Column widget and is divided into smaller sections. The next step is to look carefully at these smaller sections and, if required, divide them into further small sections and replace them with the appropriate widget. You can repeat this process until you achieve the desired level of granularity. |
| 48 | + |
| 49 | +Splitting the smaller section further looks like this: |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +:::info |
| 55 | + |
| 56 | +A page can only have one parent widget. i.e., you can't have two containers (at the same level) inside the HomePage. For that, you can wrap the two containers inside the Column widget, which makes the Column widget a single parent. |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +::: |
| 61 | + |
| 62 | +### 2. Add Image section |
| 63 | + |
| 64 | +The top section includes the Image and IconButton widgets. To place the IconButton on top of the Image, wrap them inside a Stack widget. Here's how you do it: |
| 65 | + |
| 66 | +<div style={{ |
| 67 | + position: 'relative', |
| 68 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 69 | + height: 0, |
| 70 | + width: '100%'}}> |
| 71 | + <iframe |
| 72 | + src="https://demo.arcade.software/a4smfd758Oe1RLVUp24V?embed&show_copy_link=true" |
| 73 | + title="" |
| 74 | + style={{ |
| 75 | + position: 'absolute', |
| 76 | + top: 0, |
| 77 | + left: 0, |
| 78 | + width: '100%', |
| 79 | + height: '100%', |
| 80 | + colorScheme: 'light' |
| 81 | + }} |
| 82 | + frameborder="0" |
| 83 | + loading="lazy" |
| 84 | + webkitAllowFullScreen |
| 85 | + mozAllowFullScreen |
| 86 | + allowFullScreen |
| 87 | + allow="clipboard-write"> |
| 88 | + </iframe> |
| 89 | +</div> |
| 90 | +<p></p> |
| 91 | + |
| 92 | +### 3. Add info section |
| 93 | + |
| 94 | +The info section consists of a few Text widgets inside the Column. |
| 95 | + |
| 96 | +<div style={{ |
| 97 | + position: 'relative', |
| 98 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 99 | + height: 0, |
| 100 | + width: '100%'}}> |
| 101 | + <iframe |
| 102 | + src="https://demo.arcade.software/G3Z0YSwwQbJgaeZ1qEGL?embed&show_copy_link=true" |
| 103 | + title="" |
| 104 | + style={{ |
| 105 | + position: 'absolute', |
| 106 | + top: 0, |
| 107 | + left: 0, |
| 108 | + width: '100%', |
| 109 | + height: '100%', |
| 110 | + colorScheme: 'light' |
| 111 | + }} |
| 112 | + frameborder="0" |
| 113 | + loading="lazy" |
| 114 | + webkitAllowFullScreen |
| 115 | + mozAllowFullScreen |
| 116 | + allowFullScreen |
| 117 | + allow="clipboard-write"> |
| 118 | + </iframe> |
| 119 | +</div> |
| 120 | +<p></p> |
| 121 | + |
| 122 | +### 4. Add reviews section |
| 123 | + |
| 124 | +The review section consists of multiple different widgets. First, add a Column to separate the reviewer's information (image and name) from the actual review text. Next, display the reviewer's information inside a Row widget using the CircleImage and Text widgets. Here’s exactly how you do it: |
| 125 | + |
| 126 | +<div style={{ |
| 127 | + position: 'relative', |
| 128 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 129 | + height: 0, |
| 130 | + width: '100%'}}> |
| 131 | + <iframe |
| 132 | + src="https://demo.arcade.software/q50gJ2Unh0gJ0CGigzDM?embed&show_copy_link=true" |
| 133 | + title="" |
| 134 | + style={{ |
| 135 | + position: 'absolute', |
| 136 | + top: 0, |
| 137 | + left: 0, |
| 138 | + width: '100%', |
| 139 | + height: '100%', |
| 140 | + colorScheme: 'light' |
| 141 | + }} |
| 142 | + frameborder="0" |
| 143 | + loading="lazy" |
| 144 | + webkitAllowFullScreen |
| 145 | + mozAllowFullScreen |
| 146 | + allowFullScreen |
| 147 | + allow="clipboard-write"> |
| 148 | + </iframe> |
| 149 | +</div> |
| 150 | +<p></p> |
| 151 | + |
| 152 | +## Common layout widget |
| 153 | + |
| 154 | +Apart from Row, Column, and Stack widgets, there are some other widgets that are widely used for building the page layout. Here are some of them: |
| 155 | + |
| 156 | +- [Container](#) |
| 157 | +- [Card](#) |
| 158 | +- [ListView](#) |
| 159 | +- [GridView](#) |
| 160 | +- [TabBar](#) |
| 161 | +- [PageView](#) |
| 162 | +- [Form](#) |
| 163 | + |
| 164 | +## Video guides |
| 165 | + |
| 166 | +To learn more about the layout, watch our videos: |
| 167 | + |
| 168 | +<div style={{ |
| 169 | + position: 'relative', |
| 170 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 171 | + height: 0, |
| 172 | + width: '100%'}}> |
| 173 | + <iframe |
| 174 | + src="https://www.youtube.com/embed/vQ4dAa8swzU" |
| 175 | + title="" |
| 176 | + style={{ |
| 177 | + position: 'absolute', |
| 178 | + top: 0, |
| 179 | + left: 0, |
| 180 | + width: '100%', |
| 181 | + height: '100%', |
| 182 | + colorScheme: 'light' |
| 183 | + }} |
| 184 | + frameborder="0" |
| 185 | + loading="lazy" |
| 186 | + webkitAllowFullScreen |
| 187 | + mozAllowFullScreen |
| 188 | + allowFullScreen |
| 189 | + allow="clipboard-write"> |
| 190 | + </iframe> |
| 191 | +</div> |
| 192 | +<p></p> |
| 193 | + |
| 194 | +<div style={{ |
| 195 | + position: 'relative', |
| 196 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 197 | + height: 0, |
| 198 | + width: '100%'}}> |
| 199 | + <iframe |
| 200 | + src="https://www.youtube.com/embed/glit6YCj0B0" |
| 201 | + title="" |
| 202 | + style={{ |
| 203 | + position: 'absolute', |
| 204 | + top: 0, |
| 205 | + left: 0, |
| 206 | + width: '100%', |
| 207 | + height: '100%', |
| 208 | + colorScheme: 'light' |
| 209 | + }} |
| 210 | + frameborder="0" |
| 211 | + loading="lazy" |
| 212 | + webkitAllowFullScreen |
| 213 | + mozAllowFullScreen |
| 214 | + allowFullScreen |
| 215 | + allow="clipboard-write"> |
| 216 | + </iframe> |
| 217 | +</div> |
| 218 | +<p></p> |
| 219 | + |
| 220 | +<div style={{ |
| 221 | + position: 'relative', |
| 222 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 223 | + height: 0, |
| 224 | + width: '100%'}}> |
| 225 | + <iframe |
| 226 | + src="https://www.youtube.com/embed/8O4mQKxPn9c" |
| 227 | + title="" |
| 228 | + style={{ |
| 229 | + position: 'absolute', |
| 230 | + top: 0, |
| 231 | + left: 0, |
| 232 | + width: '100%', |
| 233 | + height: '100%', |
| 234 | + colorScheme: 'light' |
| 235 | + }} |
| 236 | + frameborder="0" |
| 237 | + loading="lazy" |
| 238 | + webkitAllowFullScreen |
| 239 | + mozAllowFullScreen |
| 240 | + allowFullScreen |
| 241 | + allow="clipboard-write"> |
| 242 | + </iframe> |
| 243 | +</div> |
| 244 | +<p></p> |
0 commit comments