getVariant abstract method

String? getVariant()

Returns the variant of this locale, or null if not specified.

The variant provides additional specificity beyond language and country, useful for regional dialects or specialized locale requirements.

Example:

final locale1 = Locale('en', 'US', 'POSIX');
print(locale1.getVariant()); // Output: "POSIX"

final locale2 = Locale('en', 'US');
print(locale2.getVariant()); // Output: null

Implementation

String? getVariant();