translateText method

Future<String> translateText(
  1. String text
)

Translates the given text from the source language into the target language.

Implementation

Future<String> translateText(String text) async {
  final result = await _channel
      .invokeMethod('nlp#startLanguageTranslator', <String, dynamic>{
    'id': id,
    'text': text,
    'source': sourceLanguage.bcpCode,
    'target': targetLanguage.bcpCode
  });

  return result.toString();
}