[英]What is the default padding for TextField in Flutter?
Dear Flutter Developers,亲爱的 Flutter 开发者,
I want to know the default value used in contentPadding
property inside InputDecoration()
for TextField
or TextFormField
in Flutter.我想知道 Flutter 中
TextField
或TextFormField
的InputDecoration()
内contentPadding
属性中使用的默认值。
According to the Flutter documentation here: Flutter > material > InputDecoration > contentPadding根据此处的 Flutter 文档: Flutter > material > InputDecoration > contentPadding
By default the
contentPadding
reflects [isDense] and the type of the [border].默认情况下,
contentPadding
反映 [isDense] 和 [border] 的类型。If [isCollapsed] is true then
contentPadding
is [EdgeInsets.zero].如果 [isCollapsed] 为真,则
contentPadding
为 [EdgeInsets.zero]。If
isOutline
property of [border] is false and if [filled] is true thencontentPadding
isEdgeInsets.fromLTRB(12, 8, 12, 8)
when [isDense] is true andEdgeInsets.fromLTRB(12, 12, 12, 12)
when [isDense] is false.如果 [border] 的
isOutline
属性为 false 且 [filled] 为 true 则contentPadding
为EdgeInsets.fromLTRB(12, 8, 12, 8)
当 [isDense] 为 true 且EdgeInsets.fromLTRB(12, 12, 12, 12)
当 [isDense] 为假时。If
isOutline
property of [border] is false and if [filled] is false thencontentPadding
isEdgeInsets.fromLTRB(0, 8, 0, 8)
when [isDense] is true andEdgeInsets.fromLTRB(0, 12, 0, 12)
when [isDense] is false.如果 [border] 的
isOutline
属性为 false 且 [filled] 为 false 则contentPadding
为EdgeInsets.fromLTRB(0, 8, 0, 8)
当 [isDense] 为 true 且EdgeInsets.fromLTRB(0, 12, 0, 12)
当 [isDense] 为假时。If
isOutline
property of [border] is true thencontentPadding
isEdgeInsets.fromLTRB(12, 20, 12, 12)
when [isDense] is true andEdgeInsets.fromLTRB(12, 24, 12, 16)
when [isDense] is false.如果 [border] 的
isOutline
属性为 true,那么当 [isDense] 为 true 时contentPadding
为EdgeInsets.fromLTRB(12, 20, 12, 12)
,当 [isDense] 为 false 时为EdgeInsets.fromLTRB(12, 24, 12, 16)
。
NOTE: The value of isOutline
property is true
for OutlineInputBorder()
and is false
for UnderlineInputBorder()
注意:
isOutline
属性的值对于OutlineInputBorder()
为true
,对于UnderlineInputBorder()
为false
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.