Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 如何在flatter中覆盖主题样式_Flutter - Fatal编程技术网

Flutter 如何在flatter中覆盖主题样式

Flutter 如何在flatter中覆盖主题样式,flutter,Flutter,嗨,我需要文本样式,例如bodyText3,如下所示 bodyText3: TextStyle( fontSize: 16, height: 1.5, fontWeight: FontWeight.w600, color: MyColors.black) 但在《颤栗》中,我们只有这种风格 headline1, headline2, headline3, headline4, headline5,

嗨,我需要文本样式,例如bodyText3,如下所示

 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,
),