Open lcsvcn opened 2 years ago
use context.theme not Get.theme
use context.theme not Get.theme
can you explain better?
Theme.of(context).textTheme.displaySmall
Why do I need to use:
Theme.of(context).textTheme.displaySmall
instead of Get.textTheme.displaySmall
?
Get.textTheme.displaySmall
should retrieve the textTheme without using context.
This seems like a bug if I need to use Theme.of(context).textTheme.displaySmall
, since the whole purpose of using GetX is to be able to retrieve everything using the package GetX.
Issue reproducible at:
get: ^4.6.5
This is not an issue nor a bug. Documentation lacks explanations. Replace all instances of Get.theme
with context.theme
, do the same for textTheme
ATTENTION: DO NOT USE THIS FIELD TO ASK SUPPORT QUESTIONS. USE THE PLATFORM CHANNELS FOR THIS. THIS SPACE IS DEDICATED ONLY FOR BUGS DESCRIPTION. Fill in the template. Issues that do not respect the model will be closed.
Describe the bug A clear and concise description of what the bug is.
Reproduction code NOTE: THIS IS MANDATORY, IF YOUR ISSUE DOES NOT CONTAIN IT, IT WILL BE CLOSED PRELIMINARY)
example:
To Reproduce Steps to reproduce the behavior:
Expected behavior Text color should change dynamically when changing system theming it using GetMaterialApp.
Screenshots https://we.tl/t-0e69YkEuBR
Here is a screen record. I have reloaded app in the middle of test (to show same behaviour of closing and reopening makes theme apply or even navigation with GetX).
Flutter Version: Enter the version of the Flutter you are using 3.3.8
Getx Version: 4.6.5
Describe on which device you found the bug: ex: Moto z2 - Android. iOS and Android
Minimal reproduce code Same as example and put: