You can create a seperate class that creates the buttons and specify the padding once. Then you can call that class again and again to create as many buttons as you want in the Column.
class MakeButton extends StatelessWidget{
final String _buttonCaption;
MakeButton(this._buttonCaption);
@override
Widget build (BuildContext context){
return Padding(
padding: EdgeInsets.all(10),
child: FlatButton(
onPressed: () {},
child: Text(
_buttonCaption
),
),
);
}
}
Now you don't need to specify the padding for the Column and the Row will not have any padding.
class Test extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text("Row DATA 1"),
Text("Row DATA 2"),
Text("Row DATA 3"),
],
),
MakeButton("Flat Button 1"),
MakeButton("Flat Button 2"),
MakeButton("Flat Button 3"),
],
);
}
}
It should look something like this -
