Row Padding Flutter Code Example


Example 1: flutter how to space buttons evenly in a row

//Use mainAxisAligment: MainAxisAlignment.spaceEvenly, //After initializing the row  new Container(           alignment: FractionalOffset.center,           child: new Row(             mainAxisAlignment: MainAxisAlignment.spaceEvenly,             children: <Widget>[               new FlatButton(                 child: new Text('Don\'t have an account?', style: new TextStyle(color: Color(0xFF2E3233))),               ),               new FlatButton(                 child: new Text('Register.', style: new TextStyle(color: Color(0xFF84A2AF), fontWeight: FontWeight.bold),),                 onPressed: moveToRegister,               )             ],           ),         ),

Example 2: column each child padding

Wrap(   spacing: 20, // to apply margin in the main axis of the wrap   runSpacing: 20, // to apply margin in the cross axis of the wrap   children: <Widget>[      Text('child 1'),      Text('child 2')   ] )

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools