language_pickers 0.1.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new72

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);
                    },
                  ),

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)),
  );

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))
    ],
  );

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 @gomgomize).

[0.1.2] - 11th February, 2019

  • Fix README.md.

[0.1.1] - 19th January, 2019

  • Fix error 'Error: unable to find directory entry in pubspec.yaml'.

[0.1.0] - 17th January, 2019

  • First release of package(language_pickers).

example/README.md

language_pickers_example #

It's demo application of language_pickers Flutter package.

Getting Started #

Read README.md of the package.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  language_pickers: ^0.1.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:language_pickers/language_pickers.dart';
  
Version Uploaded Documentation Archive
0.1.2 Feb 11, 2019 Go to the documentation of language_pickers 0.1.2 Download language_pickers 0.1.2 archive
0.1.1 Jan 19, 2019 Go to the documentation of language_pickers 0.1.1 Download language_pickers 0.1.1 archive
0.1.0 Jan 17, 2019 Go to the documentation of language_pickers 0.1.0 Download language_pickers 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
44
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
72
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13
  • Flutter: 1.2.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/language_picker_cupertino.dart. (-0.50 points)

Analysis of lib/language_picker_cupertino.dart reported 1 hint:

line 4 col 8: Unused import: 'package:language_pickers/utils/utils.dart'.

Fix lib/language_picker_dropdown.dart. (-0.50 points)

Analysis of lib/language_picker_dropdown.dart reported 1 hint:

line 5 col 8: Unused import: 'utils/utils.dart'.

Fix lib/utils/utils.dart. (-0.50 points)

Analysis of lib/utils/utils.dart reported 1 hint:

line 3 col 8: Unused import: 'package:flutter/widgets.dart'.

Format lib/language_picker_dialog.dart.

Run flutter format to format lib/language_picker_dialog.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test