translate method
Implementation
Future<String?> translate(
BuildContext context,
String source,
String? inputLanCode,
String outputLanCode,
String type,
String apiKey,
String token) async {
final body = jsonEncode({
"q": source,
"source": inputLanCode,
"target": outputLanCode,
"format": type,
"key": apiKey,
});
var res = await NetworkCalls().call(
body,
context,
"https://translation.googleapis.com/language/translate/v2?key=" +
apiKey,
token);
var response = TranslateResponse.fromJson(res);
return response.data!.translations![0].translatedText;
}