fl_country_code_picker 0.0.1 copy "fl_country_code_picker: ^0.0.1" to clipboard
fl_country_code_picker: ^0.0.1 copied to clipboard

outdated

A Flutter package for showing a modal that contains country dial code. The user can also search for the available codes and select right from the modal.

fl_country_code_picker #

style: very good analysisLicense: MIT

A Flutter package for showing a modal that contains country dial code. The user can also search for the available codes and select right from the modal.

Flutter Country Code Picker #

Disclaimer, this idea originally came from: [country_code_picker]: https://pub.dev/packages/country_code_picker package. With this package you can show a country code selector and manipulate the selected CountryCode model.

🔨 Installation #

dependencies:
  fl_country_code_picker: ^0.0.1

⚙ Import #

import 'package:fl_country_code_picker/fl_country_code_picker.dart';

🕹ī¸ Usage #

Just put the component in your application through any functions where you can show the picker.

  GestureDetector(
    onTap: () async {
      final code = await FlCountryCodePicker(
        context: context,
        pickerMaxHeight: 500.0,
      ).showPicker();
      if (code != null) {
       print(code);
      }
    },
    child: Container(
      padding: const EdgeInsets.symmetric(
          horizontal: 8.0, vertical: 4.0),
      margin: const EdgeInsets.symmetric(horizontal: 8.0),
      decoration: const BoxDecoration(
          color: Colors.blue,
          borderRadius: BorderRadius.all(Radius.circular(5.0))),
      child: Text('Show Picker',
          style: const TextStyle(color: Colors.white)),
    ),
  ),

CountryCode object can be used to manipulate the selected country code by the user.

Type Description
name String The name of the country
code String The 2 character ISO code of the country
dialCode String The country dial code. By convention, international telephone numbers are represented by prefixing the country code with a plus sign (+). e.g. +1 for US
flagImage Widget Widget that can be used on retrieving the selected country flag's image.

Examples #

Mobile and Web preview

🐞 Bugs/Requests #

If you encounter any problems feel open an issue. If you feel the library is missing a feature, please raise a ticket on Github and we'll look into it. Pull request are also welcome.

📃 License #

MIT License

102
likes
0
pub points
97%
popularity

Publisher

unverified uploader

A Flutter package for showing a modal that contains country dial code. The user can also search for the available codes and select right from the modal.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on fl_country_code_picker