Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storing array as value in arb files

Is there any way to store arrays as values in any arb file while using app localization in flutter? Here is an example of what I aim to do -

"inviteTitle": ["Span 1 ", "Span 2", "Span 3"],

Is there any way to achieve this?

like image 803
Sagnik Biswas Avatar asked Oct 12 '25 07:10

Sagnik Biswas


1 Answers

  1. Transform you list, for example "inviteTitle": "Span 1:Span 2:Span 3".
  2. String _inviteTitle= AppLocalizations.of(context)!.inviteTitle;
  3. List spans= _inviteTitle.split(':');
like image 95
alexkolykhalov Avatar answered Oct 14 '25 19:10

alexkolykhalov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!