Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please solve my Doubt #15

Open
prabaljainn opened this issue Mar 20, 2021 · 4 comments
Open

Please solve my Doubt #15

prabaljainn opened this issue Mar 20, 2021 · 4 comments

Comments

@prabaljainn
Copy link

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

@TakshPanchal
Copy link

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

@HafijurRahmanEjaro
Copy link

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
),
));

@MuhammadAliNadeem
Copy link

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

@malik-vishu
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants