0

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 error:

As example:

I receive "error_3" message from backend and I would like to show "error connection" as message. So, my .arb file would have the "error_3":"error connection" message, how can I reach that?

I would like to have something like call: AppLocalizations.of(context).error(error_3);

"error": {show error_x},
"placeholder":{
"error_number"},

"error_3":"error connection",
"error_4":"wrong connection",

....

One of the options I found is this:

"error": "{error, select, error_3{error connection} other{no error found}}",

But if I have multiple error control, the command line would be illegible and hard to work with

Is there any other way to reference the "error_3" String inside the "error" String?

Regards,

0 Answers0