Flutter 如何在flatter中覆盖主题样式
嗨,我需要文本样式,例如bodyText3,如下所示Flutter 如何在flatter中覆盖主题样式,flutter,Flutter,嗨,我需要文本样式,例如bodyText3,如下所示 bodyText3: TextStyle( fontSize: 16, height: 1.5, fontWeight: FontWeight.w600, color: MyColors.black) 但在《颤栗》中,我们只有这种风格 headline1, headline2, headline3, headline4, headline5,
bodyText3: TextStyle(
fontSize: 16,
height: 1.5,
fontWeight: FontWeight.w600,
color: MyColors.black)
但在《颤栗》中,我们只有这种风格
headline1,
headline2,
headline3,
headline4,
headline5,
headline6,
subtitle1,
subtitle2,
bodyText1,
bodyText2,
caption,
如何添加新样式?创建一个常量来定义样式
const TextStyle bodyText3 = TextStyle(
fontSize: 14,
color: darkGrey,
fontWeight: FontWeight.w700,
);
在文本的样式属性中使用此常量
Text(
'No',
style: bodyText3,
),