Flutter language pickers2 - Language pickers package for Dart and Flutter

Overview

language_pickers2

Notes:

Original repository from github.com/gomgom, unfortunately the package has gone stale and isn't null safe anymore. This package address null-safety issues & maintenance.


It's package for Dart and Flutter.

It makes language select pickers for you in Flutter. You can use it freely in lots of ways.

And specially thanks to Figen Güngör(@figengungor), who is opened the source code of 'country_pickers'. Lots of source codes are from country_pickers GitHub Repository, so works are very easy. Thanks again.

Getting Started

LanguagePickerDropdown example

import 'package:language_pickers2/language.dart';
import 'package:language_pickers2/language_pickers.dart';

Language _selectedDropdownLanguage =
      LanguagePickerUtils.getLanguageByIsoCode('ko');

// It's sample code of Dropdown Item.
Widget _buildDropdownItem(Language language) {
  return Row(
    children: <Widget>[
      SizedBox(
        width: 8.0,
      ),
      Text("${language.name} (${language.isoCode})"),
    ],
  );
}


// Builder
LanguagePickerDropdown(
                    initialValue: 'ko',
                    itemBuilder: _buildDropdownItem,
                    onValuePicked: (Language language) {
                      _selectedDropdownLanguage = language;
                      print(_selectedDropdownLanguage.name);
                      print(_selectedDropdownLanguage.isoCode);
                    },
                  ),

LanguagePickerDialog example

import 'package:language_pickers2/language.dart';
import 'package:language_pickers2/language_pickers.dart';

Language _selectedDialogLanguage =
      LanguagePickerUtils.getLanguageByIsoCode('ko');

// It's sample code of Dialog Item.
Widget _buildDialogItem(Language language) => Row(
    children: <Widget>[
      Text(language.name),
      SizedBox(width: 8.0),
      Flexible(child: Text("(${language.isoCode})"))
    ],
  );

void _openLanguagePickerDialog() => showDialog(
    context: context,
    builder: (context) => Theme(
        data: Theme.of(context).copyWith(primaryColor: Colors.pink),
        child: LanguagePickerDialog(
            titlePadding: EdgeInsets.all(8.0),
            searchCursorColor: Colors.pinkAccent,
            searchInputDecoration: InputDecoration(hintText: 'Search...'),
            isSearchable: true,
            title: Text('Select your language'),
            onValuePicked: (Language language) => setState(() {
                  _selectedDialogLanguage = language;
                  print(_selectedDialogLanguage.name);
                  print(_selectedDialogLanguage.isoCode);
                }),
            itemBuilder: _buildDialogItem)),
  );

LanguagePickerCupertino example

import 'package:language_pickers2/language.dart';
import 'package:language_pickers2/language_pickers.dart';

Language _selectedCupertinoLanguage =
  LanguagePickerUtils.getLanguageByIsoCode('ko');

// It's sample code of Cupertino Item.
void _openCupertinoLanguagePicker() => showCupertinoModalPopup<void>(
  context: context,
  builder: (BuildContext context) {
    return LanguagePickerCupertino(
      pickerSheetHeight: 200.0,
      onValuePicked: (Language language) => setState(() {
            _selectedCupertinoLanguage = language;
            print(_selectedCupertinoLanguage.name);
            print(_selectedCupertinoLanguage.isoCode);
          }),
    );
  });

Widget _buildCupertinoItem(Language language) => Row(
    children: <Widget>[
      Text("+${language.name}"),
      SizedBox(width: 8.0),
      Flexible(child: Text(language.name))
    ],
  );

Information

If you want to change your language name to your native language, not English, please make some issues on Github.

Credits

Developed by gomgom(Github @gomgom).

You might also like...

A cross-platform classic and minimalist logger written in the Dart language.

A cross-platform classic and minimalist logger written in the Dart language.

A cross-platform classic and minimalist logger written in the Dart language.

Dec 3, 2022

🇮🇪 A generic programming language interpreter, linter, formatter, and all that jazz, written in Dart.

Irishman 🇮🇪 A generic programming language interpreter, linter, formatter, and all that jazz, written in Dart. Installation To install this package

Oct 8, 2022

Flutter component concept created with Flutter using Dart programming language, inspired by Gooey Rab Bar.

Flutter component concept created with Flutter using Dart programming language, inspired by Gooey Rab Bar.

Gooey Tab Bar Flutter Flutter component concept created with Flutter using Dart programming language, inspired by Gooey Tab Bar. About This component

Dec 14, 2022

App concept created with Flutter using Dart programming language, inspired by Groceries Shopping App Interaction.

App concept created with Flutter using Dart programming language, inspired by Groceries Shopping App Interaction.

Grocery Shop Flutter App concept created with Flutter using Dart programming language, inspired by Groceries Shopping App Interaction. About The app w

Dec 9, 2022

The component created with Flutter using Dart programming language, inspired in Fluid Slider by Ramotion.

The component created with Flutter using Dart programming language, inspired in Fluid Slider by Ramotion.

Fluid Slider Flutter The component created with Flutter using Dart programming language, inspired in Fluid Slider by Ramotion. About The component was

Sep 30, 2022

Todo is an Simple Task Management App coded using Dart which is a peogramming language for Flutter SDK(2.5) supports Null Safety 📑🚩

Todo 📑 🚩 📌 Introduction Todo is an Simple Task Management App coded using Dart which is a peogramming language for Flutter SDK(2.5) supports Null S

Nov 5, 2022

BMI calculator app - BMI calculator app written with dart language using flutter

BMI calculator app - BMI calculator app written with dart language using flutter

BMI_calculator_app This app is written with dart language using flutter framewor

Feb 5, 2022

This is a command-line app written on dart language for flutter applications that will help you to generate some boilerplate code

dart-generator Manual installation: 1- generate a platform executable from code dart compile exe main.dart -o generator this will generate a new gene

Oct 26, 2022
Owner
Charles Dyason
Charles Dyason
FIDL(Flutter Interface Definition Language) is a language for transfer objects cross platforms.

Flutter Interface Definition Language (FIDL) README in English(TODO) FIDL 即 Flutter 接口定义语言,类似于AIDL(Android Interface Definition Language)。您可以利用它定义不同平台

null 47 Dec 7, 2022
null 1 Jan 8, 2022
Docker images for the Dart programming language (https://dart.dev)

dart-docker This is the Git repo of the Docker "Official Images" for the Dart programming language. See the Docker Hub page for a full description on

Dart 49 Dec 14, 2022
A simple Quran package for flutter with arabic text, english translation, bangla language and pronunciation

A simple Quran package for flutter with arabic text, english translation, bangla language and pronunciation. Also available audio link, revelation type and other information.

Khalid Hassan 2 Oct 10, 2022
This application was created using the Dart language and it is an application that contains a set of different questions and at the end shows you the number of correct answers you have answered , made by flutter

exams_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

null 0 Dec 28, 2021
Intel Corporation 238 Dec 24, 2022
A simple yet elegant tip calculator created using flutter framework and dart language.

CAL- TIP, A TIP CALCULATOR APPLICATION A simple yet elegant tip calculator created using flutter framework and dart language. As the name suggests, th

Nitin Verma 0 Dec 26, 2021
Position calculation and beacons scanning, using Dart language with Flutter Framework.

BeaconLocation A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

Dimitris Motsios 0 Dec 29, 2021
This repository was created to provide the basics of the Dart programming language and Its use cases.

dart-exercises A collection of source code of the Dart Programming language. How does this repository works? Clone / Fork this repository to make your

Technosoft Labs 2 Oct 28, 2021
Implementation of data structures and algorithms in Dart programming language.

Algorithms in Dart Implementation of several algorithms with Dart programming language. Use dartdoc to generate documentation. Lists List data structu

Mafinar Khan 197 Dec 24, 2022