Debug School

rakesh kumar
rakesh kumar

Posted on

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

Refer here
Refer here

child takes a single widget

child: Text('foo')
Enter fullscreen mode Exit fullscreen mode

children takes a list of widgets

children: <Widget>[Text('foo'), Text('bar')]
Enter fullscreen mode Exit fullscreen mode
children: <Widget>[  
            Container(  
              margin: EdgeInsets.all(25),  
              child: FlatButton(  
                child: Text('SignUp', style: TextStyle(fontSize: 20.0),),  
                onPressed: () {},  
              ),  
            ),  
            Container(  
              margin: EdgeInsets.all(25),  
              child: FlatButton(  
                child: Text('LogIn', style: TextStyle(fontSize: 20.0),),  
                color: Colors.blueAccent,  
                textColor: Colors.white,  
                onPressed: () {},  
              ),  
            ),  
          ]  
Enter fullscreen mode Exit fullscreen mode

Top comments (0)