contentPadding property

  1. @override
EdgeInsets contentPadding
override

The padding for the input decoration's container.

The decoration's container is the area which is filled if filled is true and bordered per the border. It's the area adjacent to icon and above the widgets that contain helperText, errorText, and counterText.

By default the contentPadding reflects isDense and the type of the border.

If isCollapsed is true then contentPadding is EdgeInsets.zero.

Material 3 default content padding

If isOutline property of border is false and if filled is true then contentPadding is EdgeInsets.fromLTRB(12, 4, 12, 4) when isDense is true and EdgeInsets.fromLTRB(12, 8, 12, 8) when isDense is false.

If isOutline property of border is false and if filled is false then contentPadding is EdgeInsets.fromLTRB(0, 4, 0, 4) when isDense is true and EdgeInsets.fromLTRB(0, 8, 0, 8) when isDense is false.

If isOutline property of border is true then contentPadding is EdgeInsets.fromLTRB(12, 16, 12, 8) when isDense is true and EdgeInsets.fromLTRB(12, 20, 12, 12) when isDense is false.

Material 2 default content padding

If isOutline property of border is false and if filled is true then contentPadding is EdgeInsets.fromLTRB(12, 8, 12, 8) when isDense is true and EdgeInsets.fromLTRB(12, 12, 12, 12) when isDense is false.

If isOutline property of border is false and if filled is false then contentPadding is EdgeInsets.fromLTRB(0, 8, 0, 8) when isDense is true and EdgeInsets.fromLTRB(0, 12, 0, 12) when isDense is false.

If isOutline property of border is true then contentPadding is EdgeInsets.fromLTRB(12, 20, 12, 12) when isDense is true and EdgeInsets.fromLTRB(12, 24, 12, 16) when isDense is false.

Implementation

@override
EdgeInsets get contentPadding =>
    fieldPadding ?? const EdgeInsets.symmetric(horizontal: 4, vertical: 4);