Flutter 如何将TextStyle和textTheme同时应用于Flatter中的文本小部件?

Flutter 如何将TextStyle和textTheme同时应用于Flatter中的文本小部件?,flutter,dart,flutter-text,Flutter,Dart,Flutter Text,对于以下文本: 文本( “你好,世界”, 样式:Theme.of(context).textTheme.display1, ) 有没有办法将textTheme与TextStyle合并?比如说,要修改文本的颜色..我们可以执行以下操作 Theme.of(上下文) .textTheme.display1 .merge(文本样式(颜色:Colors.red) 并将其应用于样式

对于以下文本:

文本(
“你好,世界”,
样式:Theme.of(context).textTheme.display1,
)
有没有办法将textTheme与TextStyle合并?比如说,要修改文本的颜色..

我们可以执行以下操作

Theme.of(上下文)
.textTheme.display1
.merge(文本样式(颜色:Colors.red)
并将其应用于样式