A Dart package that provides a customizable country phone code picker for your Flutter application

Overview

A Flutter package that provides an easy and customizable country phone code picker widget!

Features

This package comes with a lot of customization allowing you to build the widget as per your preferences with ease!

Parameters for CountryPhoneCodePicker Widget

All you can set parameters What they mean Default
defaultCountryCode Allows you to set a default/initially selected country Afghanistan
height Height of the picker widget 45
width Width of the picker widget 80
flagHeight Height of the flag inside picker widget 35
flagWidth Width of the flag inside picker widget 50
backgroundColor Background color of picker widget Colors.transparent
borderRadius Control the radius of the curve around the corners of border of the picker widget 15
flagBorderRadius Control the radius of the curve around the corners of flag image 5
borderColor Color of the border of picker widget Colors.transparent
borderWidth Width of the border of picker widget 0
contentPadding Padding inside the picker widget EdgeInsets.symmetric(horizontal:5, vertical:5)
countryNameTextStyle Style the font of country name inside picker widget TextStyle(fontSize: 14, color: Colors.black)
countryPhoneCodeTextStyle Style the font of phone code inside the picker widget TextStyle(color: Colors.black, fontSize: 14)
showFlag Flag is shown in the picker widget if value is true true
showName Name is shown in the picker widget if value is true false
showPhoneCode Phone Code is shown in the picker widget if value is true false
actionIcon Picker Widget Icon Icon(Icons.arrow_drop_down_rounded)
searchSheetBackground Background color of search bar sheet Color(0xfffafafa)
searchBarLeadingIcon Back Button icon Icon(Icons.arrow_back_outlined, color: Colors.black)
searchBarHintText Hint text of text field null
searchBarHintStyle Style the hint text TextStyle()
searchBarLabelText Label text of text field null
searchBarLabelStyle Style the label text TextStyle()
searchBarHelperText Helper text of text field null
searchBarHelperStyle Style the helper text TextStyle()
searchBarPrefixText Prefix text of text field null
searchBarPrefixStyle Style the prefix text TextStyle()
searchBarPrefixIcon Prefix icon of text field Icon(Icons.search, color: Colors.black)
searchBarContentPadding Padding of the text field content EdgeInsets.symmetric(horizontal: 10, vertical: 5)
border Border of text field OutlineInputBorder(borderSide: BorderSide.none)
errorBorder Error border of text field OutlineInputBorder(borderSide: BorderSide.none)
focusedBorder Focused border of text field OutlineInputBorder(borderSide: BorderSide.none)
disabledBorder Disabled border of text field OutlineInputBorder(borderSide: BorderSide.none)
focusedErrorBorder Focused error border of text field OutlineInputBorder(borderSide: BorderSide.none)
enabledBorder Enabled border of text field OutlineInputBorder(borderSide: BorderSide.none)
searchBarCursorColor Color of cursor in text field Colors.black
searchBarCursorHeight Height of cursor in text field 20
searchBarCursorWidth Width of cursor in text field 2
style Style the input inside text field TextStyle()
searchBarInitialValue Initial query of text field Empty string
keyboardType Type of input in text field TextInputType.text
showCursor Cursor is visible if value is true true

Parameters for specific detail widget

All you can set parameters What they mean Default
height Allows you to set height to the widget 0
width Allows you to set width to the widget 0
padding Padding inside the widget EdgeInsets.zero
borderRadius Curve around the corners of the border of widget 0
color Color of the widget Colors.transparent
borderColor Color of the border Colors.black
borderStyle Style of the border BorderStyle.solid
borderWidth Width of the border 0
textStyle Style the text inside widget TextStyle(fontSize: 18)

Getting started

Just include this in your pubspec.yaml

  country_phone_code_picker: <VERSION>

or run this in your terminal

  flutter pub add country_phone_code_picker

Usage

To simply get a Country Picker widget, try:

CountryPhoneCodePicker.withDefaultSelectedCountry(
  defaultCountryCode:
  Country(name: 'India', countryCode: 'IN', phoneCode: '+91'),
  borderRadius: 5,
  borderWidth: 1,
  borderColor: Colors.grey,
  style: const TextStyle(fontSize: 16),
  searchBarHintText: 'Search by name',
),

To display a specific property about the country for example - country code, phone code, name, flag

CountryPhoneCodeWidget(
  height: 30,
  width: 50,
  textStyle: const TextStyle(fontSize: 15),
  borderWidth: 1,
  borderRadius: 5,
  borderColor: Colors.black,
),

To fetch details about the selected country, try:

CountryController countryController = CountryController(); //Initialize the controller
print(countryController.selectedCountry);
print(countryController.selectedCountryCode)

Additional information

Hop on to :- samitkapoor/country_phone_code_picker to find more information, contribute, file issues regarding the package!

You might also like...

Color picker for Flutter, based on the Google Docs color picker.

Color picker for Flutter, based on the Google Docs color picker.

Material ColorPicker Color picker for Flutter, based on the Google Docs color picker. Getting Started You can embed into your material app or use it o

Oct 30, 2022

Form builder image picker - Form builder image picker for flutter

form_builder_image_picker Field for picking image(s) from Gallery or Camera for

Jan 28, 2022

Nepali date picker - Material Style Date Picker with Bikram Sambat(Nepali) Calendar Support

Nepali date picker - Material Style Date Picker with Bikram Sambat(Nepali) Calendar Support

Nepali Date Picker + Calendar Material and Cupertino Styled Date Picker, Date Range Picker and Calendar with Bikram Sambat(Nepali) Support. Nepali Dat

Jan 3, 2023

It is a Flutter mobile and web application that allows you to search for universities worldwide by name and country.

It is a Flutter mobile and web application that allows you to search for universities worldwide by name and country.

Search Universities App It is a Flutter mobile and web application that allows you to search for universities worldwide by name and country. Data sour

Feb 4, 2022

A package that provides a highly customizable sheet widget that snaps to different vertical & horizontal positions

A package that provides a highly customizable sheet widget that snaps to different vertical & horizontal positions

Snapping Sheet A package that provides a highly customizable sheet widget that snaps to different vertical & horizontal positions Can adapt to scrolla

Dec 6, 2022

A Customizable Progressive Time Picker for Flutter.

A Customizable Progressive Time Picker for Flutter.

progressive_time_picker A Customizable Progressive Time Picker for Flutter. This plugin allow us to customize time picker based on our requirements fo

Nov 21, 2022

A highly customizable Flutter color picker.

A highly customizable Flutter color picker.

FlexColorPicker FlexColorPicker is a customizable color picker for Flutter. The ColorPicker can show six different types of color pickers, three of wh

Dec 14, 2022

A highly customizable Flutter color picker.

A highly customizable Flutter color picker.

FlexColorPicker FlexColorPicker is a customizable color picker for Flutter. The ColorPicker can show six different types of color pickers, three of wh

Dec 14, 2022

Flutter_dialpad - A Phone Dialpad for your Flutter Application

Flutter_dialpad - A Phone Dialpad for your Flutter Application

flutter_dialpad A phone dialer widget that can be added to any Flutter Application to enable ability to dial a number. This could be combined with a v

Nov 17, 2022
Comments
  • How to link the CountryController with CountryPhoneCodePicker widget

    How to link the CountryController with CountryPhoneCodePicker widget

    I have created CountryController in the class but whenever I try to access selectedCountry I get an uninitialized exception and there is no clear way on how to link CountryController with CountryPhoneCodePicker.

    opened by vipafattal 0
  • setState() or markNeedsBuild() called during build.

    setState() or markNeedsBuild() called during build.

    My Flutter package seems to show this error message whenever I try to hot reload the application.

    Before Hot Reload

    After Hot Reload

    Please explain your contribution when making the pull request and do attach a screenshot or gif. Thank you!šŸ˜„

    bug help wanted hacktoberfest 
    opened by samitkapoor 0
Owner
Samit Kapoor
20 years old. computer science undergrad.
Samit Kapoor
Eder Zambrano 0 Feb 13, 2022
Presentation-Remote-PC - Manage your presentation from your smart phone - Phone Client

Presentation-Remote-PC Manage your presentation from your smart phone - Phone Cl

Hasan Ragab Eltantawy 1 Jan 25, 2022
A flutter package for showing a country code selector.

country_code_picker A flutter package for showing a country code selector. It supports i18n for 70 languages. Check the example on web! https://imtoor

Salvatore Giordano 221 Jan 5, 2023
Flutter package to show and pick country code

country list pick Flutter plugin to pick country with output name, code, dialcode and flag of country Usage To use this plugin, add country_list_pick

fiaz 69 Nov 13, 2022
A flutter plugin about qr code or bar code scan , it can scan from file态url态memory and camera qr code or bar code .Welcome to feedback your issue.

r_scan A flutter plugin about qr code or bar code scan , it can scan from file态url态memory and camera qr code or bar code .Welcome to feedback your iss

PengHui Li 112 Nov 11, 2022
A simple and customizable flutter package for inputting phone number in intl / international format uses Google's libphonenumber

Intl Phone Number Input A simple and customizable flutter package for inputting phone number in intl / international format uses Google's libphonenumb

Ogunye Nathaniel Oluwatobiloba 138 Dec 11, 2022
null 1 Jan 29, 2022
Package provides light widgets [for Linkify, Clean] and extensions for strings that contain bad words/URLs/links/emails/phone numbers

Package provides light widgets [for Linkify, Clean] and extensions for strings that contain bad words/URLs/links/emails/phone numbers

BetterX.io 4 Oct 2, 2022
Flutter package for listening SMS code on Android, suggesting phone number, email, saving a credential.

Flutter Smart Auth From Tornike & Great Contributors Flutter package for listening SMS code on Android, suggesting phone number, email, saving a crede

Tornike 16 Jan 1, 2023
A flutter date time picker inspired by flutter-cupertino-date-picker

Flutter Datetime Picker (Pub) flutter_datetime_picker A flutter date time picker inspired by flutter-cupertino-date-picker you can choose date / time

null 0 Nov 30, 2021