I am using ThemeData to implement dart/light theme
I have to write Theme.of(context).textTheme in each place under the build method to get access to the textTheme.
Is there a way which can solve this problem where I don't need to write this every time in each widget.
I just want to have a global variable say final theme =Theme.of(context).textTheme;
Is there a way to achieve this with the help of get_it and injectable?
I tried registering TextTheme using get_it and injectable since I do not have access to BuildContext outside the widget tree I am have trouble getting this done.