【发布时间】:2021-06-10 19:14:08
【问题描述】:
如果主题在 main.dart 中设置为
return MaterialApp(
title: 'MY APP',
theme: ThemeData(
primarySwatch: Colors.blue,
fontFamily: 'Cabin',
textTheme: TextTheme(
headline1: TextStyle(
fontFamily: 'Raleway',
color: Colors.black,
fontWeight: FontWeight.w600,
fontSize: 18,
),
subtitle1: TextStyle(
fontFamily: 'Raleway',
color: Colors.black54,
fontWeight: FontWeight.w600,
fontSize: 16,
),
),
),
我正在使用主题
Text('MY STRING',
style: Theme.of(context).textTheme.subtitle1),
如何使“MY STRING”成为不同于 subtitle1 主题颜色的颜色,同时保留主题数据的其他属性,例如字体粗细和字体大小等?
【问题讨论】:
标签: flutter material-design flutter-web flutter-theme