Flutter 中 TextField 的默认填充是什么?

What is the default padding for TextField in Flutter?

尊敬的 Flutter 开发人员,

我想知道 contentPadding 属性 inside InputDecoration() for TextField or TextFormField in Flutter.

的默认值

根据此处的 Flutter 文档:Flutter > material > InputDecoration > contentPadding

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

If [isCollapsed] is true then contentPadding is [EdgeInsets.zero].

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.

注意: isOutline 属性 的值对于 OutlineInputBorder()true 并且对于 false UnderlineInputBorder()