In this article, we’ll learn about the key differences between Container and Row/Column widgets. Row and Column both widgets belong to a similar category and have identical uses. These are the basic widgets that you would use in almost every flutter app. We will discuss them in brief.
Container
This is the most used widget in every flutter app. It is mostly used to style its child widgets. It takes only one child. Some flutter widgets, focus only on their core functionality and does not contain much styling options. The container widget comes to the rescue and provides you with various common painting, positioning, and sizing widgets.
Container( child: Widget //Another flutter widget )
Row/Column
These are widgets that can contain multiple child widgets. The row is the widget that can display various child widgets in a horizontal manner. The column displays child widgets in a vertical manner. By default, these widgets don’t support scrolling. It can be enabled by wrapping with other widgets. But, if there are numerous child widgets, it is preferred to use ListView.
Row(
children: [
Container(), // First Widget
Text(), // Second Widget
----,
----, // Multiple Widgets
])
Column(
children: [
Container(), // First Widget
Text(), // Second Widget
----,
----, // Multiple Widgets
])
Comparison
|
Container |
Column/Row |
|---|---|
| Takes exactly one child widget | Takes multiple (unlimited) child widgets |
| Rich alignment and styling options available | Alignment options available, but there are no styling options |
| Flexible width (e.g. child width, available width, …) | Always takes full available height (column) /width (row) |
| Perfect for custom styling and alignment | Must-use if widgets sit next to/above each other |
Example:
Dart
import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Home(), ); } } class Home extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('GeeksforGeeks'), backgroundColor: Colors.green, ), body: Column( //All elements are wrapped children: [ //in this column SizedBox( height: 15, ), SizedBox( height: 20, child: Text('Demonstration of Row'), ), Row( children: [ Card( margin: EdgeInsets.all(10), elevation: 8, child: Container( padding: EdgeInsets.all(25), child: Text( 'GeeksforGeeks', style: TextStyle(color: Colors.green), ), ), ), SizedBox( width: 2, ), Card( margin: EdgeInsets.all(10), elevation: 8, child: Container( padding: EdgeInsets.all(25), child: Text( 'GeeksforGeeks', style: TextStyle(color: Colors.green), ), ), ), ], ), SizedBox( height: 30, ), SizedBox( height: 20, child: Text('Demonstration of Column'), ), Column( children: [ Card( margin: EdgeInsets.all(10), elevation: 8, child: Container( padding: EdgeInsets.all(25), child: Text( 'GeeksforGeeks', style: TextStyle(color: Colors.green), ), ), ), SizedBox( width: 4, ), Card( margin: EdgeInsets.all(10), elevation: 8, child: Container( padding: EdgeInsets.all(25), child: Text( 'GeeksforGeeks', style: TextStyle(color: Colors.green), ), ), ), ], ) ], ), ); } } |
Output:

In the above example, we have shown how row and column widgets are used in combination with a container widget. When no styling options were available in the child widget, we wrapped it with a container to add some padding to the child widget.
Recommended Posts:
- Container class in Flutter
- Difference between Docker Image and Container
- Difference between React Native and Flutter
- Difference Between Stateless and Stateful Widget in Flutter
- Differences between Flutter and Xamarin
- How to Add Space Between Widgets in Flutter?
- Routes and Navigator in Flutter
- Row and Column Widgets in Flutter with Example
- Mail and SMS in Flutter
- Upload and Retrieve Images on MongoDB using Dart in Flutter
- MaterialApp class in Flutter
- Scaffold class in Flutter with Examples
- Multi Page Applications in Flutter
- Flutter GridView
- What is widgets in Flutter?
- Rive animations in Flutter
- ProgressIndicator in Flutter
- Flutter - Stateful vs Stateless Widgets
- Wrap Widget in Flutter
- Listview.builder in Flutter
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

