FlutterLanguageSelect is a customizable widget for Flutter projects that allows users to easily select a language from a list. It displays available languages as cards and returns the selected language code and name through a callback.
-
📜 Built-in language list (
Utils.languagesData). -
🎨 Fully customizable:
- Card background colors (
tileColor,selectedTileColor) - Border colors (
borderColor,selectedBorderColor) - Title colors (
titleColor,selectedTitleColor) - Custom trailing icon (
trailing)
- Card background colors (
-
📌 Support for initial selected language (
initialLanguageCode). -
🔄 Callback function
onSelectreturns language code and name. -
🚀 Automatically scrolls to the initially selected language.
-
🌍 141 Supported Languages See supported languages
Add to your pubspec.yaml:
dependencies:
flutter_language_select: ^0.0.2or
flutter pub add flutter_language_selectThen import it:
import 'package:flutter_language_select/flutter_language_select.dart';FlutterLanguageSelect(
onSelect: (code, name) {
print("Selected language: $name ($code)");
},
initialLanguageCode: "en", // Pre-selected language
tileColor: Colors.white,
selectedTileColor: Colors.blue.shade50,
borderColor: Colors.grey.shade300,
selectedBorderColor: Colors.blue,
titleColor: Colors.black,
selectedTitleColor: Colors.blue,
trailing: const Icon(Icons.check, color: Colors.blue, size: 24),
),| Parameter | Type | Default | Description |
|---|---|---|---|
onSelect |
Function | required | Returns the selected language code and name. |
tileColor |
Color | Colors.white |
Background color of unselected cards. |
selectedTileColor |
Color | Colors.white |
Background color of the selected card. |
borderColor |
Color | Colors.transparent |
Border color of unselected cards. |
selectedBorderColor |
Color | Colors.blue |
Border color of the selected card. |
titleColor |
Color | Colors.black |
Title color of unselected cards. |
selectedTitleColor |
Color | Colors.blue |
Title color of the selected card. |
trailing |
Icon | Icon(Icons.check, ...) |
Icon displayed on the selected card. |
initialLanguageCode |
String | '' |
Language code to be pre-selected. |
| Language | Code | Language | Code |
|---|---|---|---|
| Akan | ak | Lao | lo |
| Amharic | am | Lithuanian | lt |
| Arabic | ar | Luba-Katanga | lu |
| Assamese | l_as | Latvian | lv |
| Aymara | ay | Malagasy | mg |
| Azerbaijani | az | Marshallese | mh |
| Belarusian | be | Maori | mi |
| Bulgarian | bg | Macedonian | mk |
| Bhojpuri | bho | Malayalam | ml |
| Bislama | bi | Mongolian | mn |
| Bambara | bm | Marathi | mr |
| Bengali | bn | Western Mari | mrj |
| Bosnian | bs | Malay | ms |
| Catalan | ca | Maltese | mt |
| Cebuano | ceb | Burmese | my |
| Chamorro | ch | Nauru | na |
| Mari | chm | Norwegian Bokmål | nb |
| Corsican | co | North Ndebele | nd |
| Czech | cs | Nepali | ne |
| Welsh | cy | Dutch | nl |
| Danish | da | Norwegian Nynorsk | nn |
| German | de | Norwegian | no |
| Divehi | dv | South Ndebele | nr |
| Dzongkha | dz | Chichewa | ny |
| Greek | el | Punjabi | pa |
| English | en | Papiamento | pap |
| Spanish | es | Polish | pl |
| Estonian | et | Pashto | ps |
| Basque | eu | Portuguese | pt |
| Persian | fa | Rundi | rn |
| Finnish | fi | Romanian | ro |
| Filipino | fil | Russian | ru |
| Fijian | fj | Kinyarwanda | rw |
| Faroese | fo | Sindhi | sd |
| French | fr | Sango | sg |
| Irish | ga | Sinhala | si |
| Galician | gl | Slovak | sk |
| Guarani | gn | Slovenian | sl |
| Gujarati | gu | Samoan | sm |
| Manx | gv | Shona | sn |
| Hausa | ha | Somali | so |
| Hawaiian | haw | Albanian | sq |
| Hebrew | he | Serbian | sr |
| Hindi | hi | Swati | ss |
| Hiri Motu | ho | Southern Sotho | st |
| Croatian | hr | Sundanese | su |
| Haitian | ht | Swedish | sv |
| Hungarian | hu | Swahili | sw |
| Armenian | hy | Tamil | ta |
| Indonesian | id | Telugu | te |
| Igbo | ig | Tajik | tg |
| Iloko | ilo | Thai | th |
| Icelandic | l_is | Turkmen | tk |
| Italian | it | Tagalog | tl |
| Japanese | ja | Tswana | tn |
| Javanese | jv | Tonga | to |
| Georgian | ka | Turkish | tr |
| Kazakh | kk | Tahitian | ty |
| Kalaallisut | kl | Ukrainian | uk |
| Central Khmer | km | Urdu | ur |
| Kannada | kn | Uzbek | uz |
| Korean | ko | Vietnamese | vi |
| Krio | kri | Xhosa | xh |
| Kurdish | ku | Yiddish | yi |
| Kirghiz | ky | Yoruba | yo |
| Latin | la | Yucateco | yua |
| Luxembourgish | lb | Chinese - Traditional | zh_TW |
| Ganda | lg | Chinese | zh |
| Lingala | ln | Zulu | zu |
Contributions, issues, and feature requests are welcome! 🚀

