What is an alternative to textTheme in flutter. I am getting the following error
I am new to Flutter and getting this error.Can anyone help? Try and text style.
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)
)
)
);
}
}
uj5u.com enthusiastic netizens replied:
You can usetoolBarTextStyle
andtitleTextStyle
instead of textTheme
.For more details, see the link below
textTheme
uj5u.com enthusiastic netizens replied:
You cantitleTextStyle
Use like this:
appBarTheme: AppBarTheme(
titleTextStyle: TextStyle(color: Colors.blue)
)
appBar: AppBar(
title: Text(
' ',
style: Theme.of(context).appBarTheme.titleTextStyle,
),
0 Comments