Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between child: and children: property in Flutter?

What is the difference between child: and children: property in Flutter?

I started studying flutter for 2 weeks from Flutter official documentation and I don't find it as easy as studying Android.

like image 412
ThitSarNL Avatar asked Jan 05 '19 16:01

ThitSarNL


1 Answers

child takes a single widget

child: Text('foo')

children takes a list of widgets

children: <Widget>[Text('foo'), Text('bar')]
like image 102
Günter Zöchbauer Avatar answered Nov 14 '22 18:11

Günter Zöchbauer