Flutter padding for all widgets?

You can use Padding, which is a very simple Widget that just takes another Widget as a child and an EdgeInsets object like the one you are already using as padding.

This approach of “composition over inheritance” in Flutter is very intentional. You can find a recent discussion of the pros and cons on Flutter’s Gitter channel.

Leave a Comment