Flutter Padding for All Widgets

Last Updated On Sunday 10th Apr 2022

flutter padding

  • Use Padding, which is a very simple Widget that just takes another Widget as a child
  • It EdgeInsets object like the one you are already using as padding.
	Padding(
  padding: const EdgeInsets.all(8.0),
  child: Text("text"),
);
	
  • EdgeInset means nothing. It’s just a class to hold a value.
  • Which adds space between the parent and it’s child.

flutter row padding

	padding: const EdgeInsets.symmetric(
  horizontal: 40,
  vertical: 20,
),