I want to get the app's current localization and find out the app's directionality (RTL or LTR) in the flutter class.
How can I get that?
CodePudding user response:
You can get the used Directionality
from the context where you want it with:
Directionality.of(context)
The same thing for Localizations
, you can retrieve it from the context like this:
Localizations.of(context, MaterialLocalizations);