translateText method

  1. @override
Future<V2TimValueCallback<Map<String, String>>> translateText({
  1. required List<String> texts,
  2. required String targetLanguage,
  3. String? sourceLanguage,
})
override

Implementation

@override
Future<V2TimValueCallback<Map<String, String>>> translateText({
  required List<String> texts,
  required String targetLanguage,
  String? sourceLanguage,
}) async {
  return V2TimValueCallback<Map<String, String>>.fromJson(
    formatJson(
      await _channel.invokeMethod(
        "translateText",
        buildMessageMangerParam(
          {
            "texts": texts,
            "targetLanguage": targetLanguage,
            "sourceLanguage": sourceLanguage ?? "auto",
          },
        ),
      ),
    ),
  );
}