what is replacement for textTheme in flutter. I'm getting following error
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)
)
)
);
}
}
Solution 1:
You can use toolBarTextStyle
and titleTextStyle
instead of textTheme
.
For more details please refer below link
textTheme
Solution 2:
You can use titleTextStyle
like this:
appBarTheme: AppBarTheme(
titleTextStyle: TextStyle(color: Colors.blue)
)
appBar: AppBar(
title: Text(
' ',
style: Theme.of(context).appBarTheme.titleTextStyle,
),