0

I have a problem with my mobile application. I developed my application with flutter and implemented Flutter Internationalization. After creating files with .arb extension I wanted to be able to choose the file by platform ( IOS or Android ) as well as language . Is it possible to use an If statement in the files with .arb extension? Are there any solutions for this problem of mine?

Sbocco
  • 1
  • 1

2 Answers2

1

You can put that condition in dart file also.

For ex., Platform.isAndroid ? "Localization string 1" : "Localization string 2"

Renik Shiroya
  • 324
  • 4
  • 15
0

Just do that in your dart file, like this:

child: Platform.isAndroid 
  ? Text(AppLocalizations.of(context)!.stringForAndroid) 
  : Text(AppLocalizations.of(context)!.otherString)
Alaindeseine
  • 3,260
  • 1
  • 11
  • 21