Flutter: Container, Column and Rows

 

Flutter Container

The container in Flutter is a parent widget that can contain multiple child widgets and manage them efficiently through width, height, padding, background color, etc. It is a widget that combines common painting, positioning, and sizing of the child widgets. It is also a class to store one or more widgets and position them on the screen according to our needs. Generally, it is similar to a box for storing contents. It allows many attributes to the user for decorating its child widgets, such as using margin, which separates the container with other contents.

A container widget is same as <div> tag in html. If this widget does not contain any child widget, it will fill the whole area on the screen automatically. Otherwise, it will wrap the child widget according to the specified height & width. It is to note that this widget cannot render directly without any parent widget. We can use Scaffold widget, Center widget, Padding widget, Row widget, or Column widget as its parent widget

.data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQwAAAC8CAMAAAC672BgAAAA3lBMVEX////g8vMvhMn7+egqgshRk88AAABYltCQutzl9vU0hsrp+PZ5q9cjf8cmgcj39/fr9e/g4OBbxK2ZmZl7e3srf8tNr7ddxqxOv6mSkpJvybjB49F0dHRIvqnw8PB2dnYyiMdUubL09+bQ0NCl3tKN0sTC59/W7+pAnL/o6OixsbG/v7+I08Xc79213syN0b5ZWVlEor2ioqI4kcTX19dvo9U6lMJZwK9QtLTX7++z4dwmJiYhISEvLy9Ip7o6k8M6OjpCn76EhIRmZmbU7NpKSkpJq7jI6eej2cd7zrrV72zYAAAMTklEQVR4nO2djVriuhaGq/awD3CATfiL0SpgW1CLiDgE6owzzmYsvf8bOmslFVBnqLhLQJvveSBp2sb2JVlfim0wDK0llcrlcglSSE6eJeeQnL9MypCcPEui/f9YzUly1bw6qGSrwVWZTOYSFiC5gEVIDmVSheQuk7mG5DqTuYPkFEohOZTJBSRQ9yUkZVnN2bNqKotqvs6r+QbJ8atqSvNqbt9Qza/EqvnxrBrY/eSwcgiESpDcYmGlArUYlUoFCBk3lQpWdlGp3EByCaWQnFUqyOsW9oD9y5CcvLmai0SruXlejfHnag6fV3P5upofCENL6uxi20egtcMqi9iiJaRhSB1jANUwpKoI4/z4ctvHsRM63T1r3d4BXR4q/GNZ2/Yx7dh2IFMfx82ujfKzos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mH+xWHzz4pr1rtz65bGvns5uRZv4E4yPrDdcwqv4SY/d0I78DNBuKL6bqPkZoJ1Qwtb6sfWG+TNU/HTYbmhnfgZoF5TwrI8fWzv6m0jbkbbWJcV/uaOtVUpb65Kktar5wetdkLbWJcX/E0nDeKvSBmO1mxTMT6TCv4Px5T+fSl9WcIifmipFktZajZ08NxWKf8g3RbrUHUTrzzq/i50VND3SbiJV1da6kJya6jr2CiUV0ta6JPHAnpbW77VyOru0SbuJlJgYQMOQktb6TXcTlLbWJYlpZrS0fq/zY/1N11zaTaTEdHYahlT81FQpUvyUESmSmBxVS+v3Wnl/RtpUzvxAGsfVUxxv/Kye4qXKYbWK35nfVKt4W8/FabUKyeVp9RiSM0gw8B5Xj89xmFI9LhtGCfZfqqb6Iar5+bqaTAa3zGTE7UyQ4Lpvmcw1JNeZzFesDEohqcjkApIT2B2Sstg9A3/wJPOymlNI7ubV3C2qOXxWzWVMNdVX1ZzGVHP2rJrKopqv82q+IahX1WAAlU8VlOZJ6U+JsVbyAav5P4Cd1wSIwshIAAAAAElFTkSuQmCC                               Flutter Container        


Flutter Row and Column

In the previous sections, we have learned to create a simple Flutter application and its basic styling to the widgets. Now, we are going to learn how to arrange the widgets in rows and columns on the screen. The rows and columns are not a single widget; they are two different widgets, namely Row and Column. Here, we will integrate these two widgets together because they have similar properties that help us understand them efficiently and quickly.

Row and column are the two essential widgets in Flutter that allows developers to align children horizontally and vertically according to our needs. These widgets are very necessary when we design the application user interface in Flutter.  

Flutter Row and Column

Key Points

  1. Row and Column widgets are the most commonly used layout patterns in the Flutter application.
  2. Both may take several child widgets.
  3. A child widget can also be a row or column widget.
  4. We can stretch or constrain a particular children's widget.
  5. Flutter also allows developers to specify how child widgets can use row and column widgets' available space.

Comments

Popular posts from this blog

Flutter : Introduction

Dart: Functions

Firebase Cloud Messaging