[英]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.