1. child:
This can hold any one of the widgets in flutter(such as Text, Column, Row, Container, Center, etc).
To layout multiple widgets, let this widget's child be a widget such as Row, Column, or Stack, which have a children property, and then provide the children to that widget.
Type: Widget
Syntax:
child: Widget(
))
Example:
Center(
child: Row(
children:[
Text("abc"), Text("abc"),
] )
)
2. children:
This can hold any number of widgets in flutter(such as Text, Column, Row, Container, Center, etc).
It creates an array of widgets.
Type: List<Widget>
Syntax:
Widget(
children:[widget1,widget2,widget3,...]
)
Example:
Column(
children: [
Container(child: Icon(Icons.person)),
Text("Text_Here"),
Text("Text_Here")
])
Comments
Post a Comment