James Franco
James Franco

Reputation: 4706

The getter title isnt defined for the type "TextTheme"

I just upgraded to flutter v2. I am getting the following error

title: Text("Foo", style: Theme
                            .of(context)
                            .textTheme
                            .title
                            .copyWith(fontWeight: FontWeight.bold, color: Colors.red),)),

Any suggestions on what the equivalent will be ?

Upvotes: 2

Views: 1292

Answers (1)

JediBurrell
JediBurrell

Reputation: 1109

In 2018 many text styles were renamed. The “title” style is now called “headline6”.

You can read more about migrating here: https://api.flutter.dev/flutter/material/TextTheme-class.html

Upvotes: 3

Related Questions