Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Null for the translated output #17

Open
carlfost opened this issue Jul 13, 2020 · 5 comments
Open

Getting Null for the translated output #17

carlfost opened this issue Jul 13, 2020 · 5 comments

Comments

@carlfost
Copy link

I am getting null for any input words. Here is the code segment:

GoogleTranslator translator = GoogleTranslator(); //using google translator

String out;
final lang = TextEditingController(); //getting text

void trans() {
translator.translate(lang.text, to: 'fr')
.then((output) {
setState(() {
out = output; //placing the translated text to the String to be used
});
print(out);
});
}

@gabrielpacheco23
Copy link
Owner

gabrielpacheco23 commented Jul 16, 2020

Have you tried using async/await? Also, verify internet connection.

@carlfost
Copy link
Author

Yes. But it looks like Google is giving the null. Maybe because they are charging $20/M Char.

@gabrielpacheco23
Copy link
Owner

gabrielpacheco23 commented Jul 29, 2020

Yes. But it looks like Google is giving the null. Maybe because they are charging $20/M Char.

Thats weird. I tested your code and it worked for me.

@DangKhoi1997
Copy link

setState(() {
out = output; //placing the translated text to the String to be used
});
You can't pass the value from output(Translation) to out (String), the whole code can't run . The example code return error code 429

@ag12216
Copy link

ag12216 commented Dec 23, 2020

The issue is due to the unusual traffic on your network you can test on different network I have observed it but we can't depend on this package as at any point of time we may break. If possible bro please take look on this it will be helpful for many of the developers to use your package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants