language_pickers

Last updated:

0 purchases

language_pickers Image
language_pickers Images
Add to Cart

Description:

language pickers

language_pickers #



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_pickers/language.dart';
import 'package:language_pickers/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);
},
),
copied to clipboard
LanguagePickerDialog example
import 'package:language_pickers/language.dart';
import 'package:language_pickers/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)),
);
copied to clipboard
LanguagePickerCupertino example
import 'package:language_pickers/language.dart';
import 'package:language_pickers/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))
],
);
copied to clipboard
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).

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.