LanguageConditions constructor

LanguageConditions({
  1. required String param,
  2. required Map<String, dynamic> conditions,
})

Conditions of the language that you want to translate into.

You have to specify the param that matches the parameter in the text (which is specified by the @ or @{}).

conditions is a Map of key and value that you want to apply for each condition. There is a default key to let you set the default return if there is no matched condition.

Eg.

LanguageData data = {
  LanguageCodes.en : {
    'This is @number dollar' : LanguageConditions(
      param: 'number',
      conditions: {
        '0' : 'This is zero dollar',
        '1' : 'This is one dollar',
        'default' : 'This is @number dollars',
      }
    ),
  }
};

Implementation

LanguageConditions({
  required this.param,
  required this.conditions,
});