A text field that displays text on different languages based on your selection.

Overview

translatable_text_field

A text field that displays text on different languages based on your selection.

Its basic idea is that you place this fields inside a stateful Widget and combine them with some kind of language picker to change the value on the fields. This does not offer translating features. Its simply a Text widget to place the same String on other languages to easily change between them in the UI.

Getting Started

Widget that gets displayed.

TranslatableText(
    displayLanguage: Languages.german, //Chosen language to be displayed
    options: [
		   TranslateOption(
              language: Languages.english,
              text: 'Hello',
            ),
            TranslateOption(
              language: Languages.spanish,//Language of the text
              text: 'Hola',//The actual text
            ),
            TranslateOption(
              language: Languages.german,
              text: 'Hallo',
            ), 
    ], //List of possible language options and its related text
)/*The actual widget that gets placed in your flutter app. Its the exact same Text widget with the added feature 
of having the displayLanguage and options properties. It supports all of the other Text field properties*/

Note: You can also use your own custom language instead of using the languages enum(actually its a class that returns a Language class that returns a String :).

Example:

TranslatableText(
    displayLanguage: Language('wookie'), //Chosen language to be displayed
    options: [
        TranslateOption(
              language: Language('wookie'),
              text: 'Grrrr....!',
            ), 
    ]
 )

Full example

import 'package:flutter/material.dart';
import 'package:translatable_text_field/translatable_text.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      body: SafeArea(
        child: TranslatableText(
          displayLanguage: Languages.german,
          options: [
            TranslateOption(
              language: Languages.english,
              text: 'Hello',
            ),
            TranslateOption(
              language: Languages.spanish,
              text: 'Hola',
            ),
            TranslateOption(
              language: Languages.german,
              text: 'Hallo',
            ),
          ],
          style: TextStyle(
            color: Colors.blue,
            fontSize: 40,
          ),
        ),
      ),
    ),
  ));
}

Hecho en 🇵🇷 por Radamés J. Valentín Reyes

You might also like...

A Flutter widget that checks and displays the version status of application and you can easily guide user to update your app

A Flutter widget that checks and displays the version status of application and you can easily guide user to update your app

A most easily usable Flutter widget about application version check! 1. About 1.

Dec 16, 2021

SoundVolumeView that displays general information and the current volume level for all active sound components in your system, and allows you to instantly mute and unmute them

SoundVolumeView that displays general information and the current volume level for all active sound components in your system, and allows you to instantly mute and unmute them

SoundVolumeView that displays general information and the current volume level for all active sound components in your system, and allows you to instantly mute and unmute them

Mar 4, 2022

This is my way to build a Tagged Search Field that display a list with suggestions while the user type.

This is my way to build a Tagged Search Field that display a list with suggestions while the user type.

tagged_search_field This is my way to build a Tagged Search Field that display a list with suggestions while the user type. A regular search field at

Nov 5, 2021

An address search field which helps to autocomplete an address by a reference

An address search field which helps to autocomplete an address by a reference

Address Search Field Widget builders to create 'address search widgets' which helps to autocomplete an address using a reference. They can be used to

Aug 14, 2022

A Flutter select form field widget. It shows a list of options in a dropdown menu.

A Flutter select form field widget. It shows a list of options in a dropdown menu.

select_form_field A Flutter select field widget. It shows a list of options in a dropdown menu. This widget extend TextField and has a similar behavio

Sep 14, 2022

Flutter package for Android and iOS allow you to show a wide range of hyperlinks either in the input field or in an article view

Flutter package for Android and iOS allow you to show a wide range of hyperlinks either in the input field or in an article view

Tagtly package help you to detect a lot of hyperlink text such as.. email, url, social media tags, hashtag and more either when user type in text field or when appear a text read only.

Jul 25, 2022

Text analyzer that extracts tokens from text for use in full-text search queries and indexes.

Text analyzer that extracts tokens from text for use in full-text search queries and indexes.

Tokenize text, compute document readbility and compare terms in Natural Language Processing. THIS PACKAGE IS PRE-RELEASE, and SUBJECT TO DAILY BREAKIN

Dec 12, 2022

This plugin allows Flutter desktop apps to Retrieve information about screen size, displays, cursor position, etc.

screen_retriever This plugin allows Flutter desktop apps to Retrieve information about screen size, displays, cursor position, etc. screen_retriever P

Dec 6, 2022

A Simple Flutter Android App, which displays Sensor Data.

A Simple Flutter Android App, which displays Sensor Data.

sensorz A Simple Flutter Android App, which displays Android Sensor Data. Introduction :: For implementation of UI, this app uses Flutter Framework. C

Dec 25, 2022
Owner
null
A Flutter package that provides a dropdown form field using a dropdown button inside a form field.

Dropdown form field A dropdown form field using a dropdown button inside a form field. Demo Features Can be used as regular form field. Simple to impl

Carlos Eugenio Torres 72 Jan 1, 2023
Detectable text field - Flutter Text widgets with detection features

detectable_text_field Text widgets with detection features. You can detect hasht

null 0 Feb 2, 2022
Vineet Kalghatgi 32 May 13, 2022
This is a tool for adding define macro definition to programming languages.

This is a tool for adding define macro definition to programming languages. It is used to distinguish different versions and platforms. The implementation principle is to annotate unnecessary code by using define macros. This tool is theoretically applicable to any programming language.

fengdeyingzi 4 Dec 7, 2022
Z time ago - A simple Flutter z time ago package used to change date to time ago for english, arabic and kurdish languages

This package is used to get time duration from now and given time for kurdish, a

Zakarya Muhammad 2 May 19, 2022
A Flutter app that displays superheroes and villains from different universes

?? FlutterSuperHeroes A Flutter app that displays superheroes and villains from different universes ?? ScreenShots 1 2 3 4 5 6 ✨ Requirements Any Oper

Festus Olusegun 100 Dec 27, 2022
🔥🚀 Flutter package to create Pin code input text field with every pixel customization possibility 🎨 with beautiful animations

Flutter PinPut From Tornike ?? ?? Flutter package to create Pin code input (OTP) text field with every pixel customization possibility ?? and beautifu

Tornike 451 Jan 2, 2023
A CustomPaint example where we can draw with different colors and different stroke sizes

CustomPaint A CustomPaint example where we can draw with different colors and different stroke sizes. A Flutter application which runs on iOS, Android

Behruz Hurramov 0 Dec 27, 2021
This is flutter package for creating a gender selection widget which allows users to choose a gender with cool animations

gender_selection A Flutter package for gender selection. It is an aweome gender selection widget with cool gradients and animation effects Demo Instal

Rohan Malik 10 Apr 8, 2022
Material color picker, you can customize colors. Selection in two step, first main color and after shades.

Flutter Material Color Picker Material Color picker is a Flutter widget, that can be customizable. By default, it's Material Colors, but you can defin

Jean-Charles Moussé 70 Nov 25, 2022