30DaysOfFlutter icon indicating copy to clipboard operation
30DaysOfFlutter copied to clipboard

Please solve my Doubt

Open prabaljainn opened this issue 3 years ago • 4 comments

I am having problem in this file.

textTheme: Theme.of(context).textTheme,

can't understand this line

https://github.com/iampawan/30DaysOfFlutter/blob/02f7ca0a43705d89ef9836eebec74ece6e331d93/lib/widgets/themes.dart

prabaljainn avatar Mar 20 '21 05:03 prabaljainn

@prabaljainn basically from this method Theme.of(context) you can get the theme if you have defined earlier on MaterialApp.

TakshPanchal avatar Jun 03 '21 14:06 TakshPanchal

getting this issue please help: The getter 'textTheme' isn't defined for the type 'BuildContext'. Try importing the library that defines 'textTheme', correcting the name to the name of an existing getter, or defining a getter or field named 'textTheme'.

textTheme: Theme.of(context).textTheme.copyWith( headline6: context.textTheme.headline6.copyWith(color: Colors.white), // on this line textTheme ), ));

HafijurRahmanEjaro avatar Jul 02 '22 09:07 HafijurRahmanEjaro

Exception has occurred. LateError (LateInitializationError: Field '_catalog@26243600' has not been initialized.) any suggestions?

MuhammadAliNadeem avatar Sep 27 '22 20:09 MuhammadAliNadeem

getting this issue please help: The getter 'textTheme' isn't defined for the type 'BuildContext'. Try importing the library that defines 'textTheme', correcting the name to the name of an existing getter, or defining a getter or field named 'textTheme'.

textTheme: Theme.of(context).textTheme.copyWith( headline6: context.textTheme.headline6.copyWith(color: Colors.white), // on this line textTheme ), ));

I think it is because the textTheme property is removed from the AppBarTheme constructor in later versions of flutter

malik-vishu avatar Jul 14 '23 17:07 malik-vishu