primaryLanguage property

Language? get primaryLanguage

Returns the primary language (first in the list) or null if none exist.

This is useful when you need a single language to represent the country, typically the most widely spoken or official language.

Implementation

Language? get primaryLanguage =>
    languages.isNotEmpty ? languages.first : null;