Questions tagged [applocalizations]

7 questions
6
votes
3 answers

passing dynamic strings to AppLocalizations.of(context)! in Flutter

right now Im working in App using Flutter and I have 4 different languages, I use json (arb files) for localization (translation) I need to pass different string values which app fetch them using API's as shown in example…
3
votes
3 answers

Flutter: Undefined name 'AppLocalizations'. Try correcting the name to one that is defined, or defining the name

Flutter Default Localizations isn't work when I use GetX Statemanagement. It show me a error like Undefined name 'AppLocalizations'. Try correcting the name to one that is defined, or defining the name. How Can I fixed this ?
0
votes
3 answers

My AppLocalizations in Flutter return null value

I am using flutter localization for my app. This is the code where I implemented it: class Dashboard extends StatefulWidget { const Dashboard({Key? key}) : super(key: key); @override _DashboardState createState() =>…
0
votes
0 answers

Reference string inside a string in Applocalizations with Flutter

I'm using AppLocalization in my flutter app, with .arb files. I'm looking forward to receive a String from DB and then show a specific message depending on that String. So, i would like to receive an "error" and print the message for that specific…
0
votes
0 answers

how to define getter so, that based on error code I can show error message instead of having multiple `if` statement

We are calling API and handling the exception. class Failure with _$Failure implements Exception { factory Failure({ required FetchError fetchError, required ServerError? errorCodeFromServer, }) = _Failure; } And, based on the…
0
votes
1 answer

How to get around the issue with Applocalizations.of(context) not being initated in route when I need to set titles and such in my flutter app?

My flutter app has translations to several languages but that was working fine until I introduced routes to my app for navigation between screens. Now I always get the issue that the texts I'm trying to set are null and it seems to me that the…
Kurodani
  • 115
  • 10
0
votes
1 answer

How to localize BottomNavigationBarItem?

Could you please help me to undrestand how to properly localize the BottomNavigationBar? Here it is: class MainPage extends StatefulWidget { const MainPage({Key? key}) : super(key: key); @override State
llaabbss
  • 9
  • 3