googleTranslation static method

Future<GoogleTranslationModel> googleTranslation({
  1. required String text,
  2. required String target,
  3. required String roomId,
})

Google Translation

Implementation

static Future<GoogleTranslationModel> googleTranslation({
  required String text, //요청 텍스트
  required String target, //반환 언어
  required String roomId, //채널 키
}) async {
  var url = ApiPath.googleTranslate
      .addGetParam({"text": text, "target": target, "roomId": roomId});

  var response = await get(url);
  return GoogleTranslationModel.fromJson(json.decode(response.body));
}