Language Translation In Flutter

Vishwakarma Raj
3 min readJul 25, 2019

--

Flutter is Google’s portable UI toolkit for building beautiful, natively-compiled applications for mobile, web, and desktop from a single codebase.

After Searching whole web got an tremendous results And happy to say that…

Now you can Create an App that can Translate Your Preferred Language in to language whichever you want almost…..

Happy for Hard work !!!

So, time for start working on it…. to get the build…

Before Starting we need to import a Small package named as:

translator 0.1.2

Just get to the pubspec.yaml and add under the dependencies…like this…

Like this and wallah Done !!!!

After that lets begin coding in the main.dart…..Well i hope now you have became a pro Flutterer… so instead of explaining whole Code Lets go to the main part of the Code directly……

And yeah Will use Google Translator !!! Not the API !!!

Lets build the design for the App !!!

In Scaffold Body !!!

Creating a Textfield that will take the input keyword from me and a Raised Button onpress which will convert the language to the defined google language code and a Text widget which will show us the translated text…

Main CODE !!!

Time to build the Main Code from where the translation would happen…

Creating a String that will give the output …. and using translator.translate from input to the output in “hi” Hindi…

Well time to run the Code and press Run or put Flutter run in console…

And yeah it looks like this !!!

Now it’s time for the #SourceCode:

Walla !!! Hope this works for you… Give a Clap to my work and Kudos to my repo on Github ….

Enjoy Fluttering Guyzzzzz….

--

--