installPackage static method

Future<void> installPackage(
  1. String fromCode,
  2. String toCode
)

Installs a language package for translation between two languages.

fromCode - The source language code (e.g., 'en' for English). toCode - The target language code (e.g., 'ar' for Arabic).

Throws an exception if the package installation fails.

Implementation

static Future<void> installPackage(String fromCode, String toCode) async {
  final result = await _bindings.installPackage(fromCode, toCode);
  if (result != 0) {
    throw Exception(
        'Failed to install language package from $fromCode to $toCode');
  }
}