[英]what is replacement for textTheme in flutter. I'm getting following error
我是 flutter 的新手,收到此错误。 有人可以帮忙吗? 尝试发短信给 styles。
import 'package:flutter/material.dart';
import 'screens/location_detail/location_detail.dart';
import 'style.dart';
class App extends StatelessWidget{
@override
Widget build(BuildContext context) {
return MaterialApp(
home:LocationDetail(),
theme:ThemeData(
appBarTheme: AppBarTheme(
textTheme: TextTheme(title: AppBarTextStyle)
)
)
);
}
}
您可以使用toolBarTextStyle
和titleTextStyle
代替textTheme
。 有关更多详细信息,请参阅下面的链接textTheme
您可以像这样使用titleTextStyle
:
appBarTheme: AppBarTheme(
titleTextStyle: TextStyle(color: Colors.blue)
)
appBar: AppBar(
title: Text(
' ',
style: Theme.of(context).appBarTheme.titleTextStyle,
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.