I'm new to flutter getting this error. can anyone please help with this? trying to and text 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)
)
)
);
}
}
You can use toolBarTextStyle
and titleTextStyle
instead of textTheme
. For more details please refer below link textTheme
You can use titleTextStyle
like this:
appBarTheme: AppBarTheme(
titleTextStyle: TextStyle(color: Colors.blue)
)
appBar: AppBar(
title: Text(
' ',
style: Theme.of(context).appBarTheme.titleTextStyle,
),
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.