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
Possible to access translation labels without context? #16
Comments
I actually no longer use AppLocalizations.of(context); in the current version. I replaced the old translation component with doing it the getX way and I also created a new script to build the localization file. You can take a look at the readme for how to use the new translation system. |
Great - thank you! For some reason my compiler (Dart 2.12.3) complains about the
Once I remove the |
Ok are you using null safety in your project? Maybe that is why as the required keyword is only used if you update your pubspec.yaml to use: |
Ah, thank you for pointing that out! I have indeed not upgraded my project to null safety yet. Will be doing this in the future :-) |
Great tutorial on Medium!! Thanks a lot!
Is there a way to eliminate the necessity of passing
BuildContext
infinal labels = AppLocalizations.of(context);
using GetX? I sometimes have to reference the translation labels also in some of my controller/services classes where I usually try to avoid using
BuildContext
as much as possible (trying to separate UI and Business Logic).The text was updated successfully, but these errors were encountered: