Iri*_*ngo 19 button text-size flutter
如何更改材质按钮的字体大小...有更好的方法吗?
new MaterialButton(
height: 140.0,
minWidth: double.infinity,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
child: new Text("material button"),
onPressed: () => {},
splashColor: Colors.redAccent,
),
Run Code Online (Sandbox Code Playgroud)
bof*_*mer 32
Flutter中的小部件体系结构使这非常简单:它的子节点MaterialButton是一个Text小部件,可以使用其style属性进行样式化:
new MaterialButton(
height: 140.0,
minWidth: double.infinity,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
child: new Text(
"material button",
style: new TextStyle(
fontSize: 20.0,
color: Colors.yellow,
),
),
onPressed: () => {},
splashColor: Colors.redAccent,
);
Run Code Online (Sandbox Code Playgroud)
您可以使用窗口小部件的style属性Text。
MaterialButton(
...
child: Text(
'material button',
style: TextStyle(
fontSize: 20.0, // insert your font size here
),
),
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19664 次 |
| 最近记录: |