phonefield 1.0.2 copy "phonefield: ^1.0.2" to clipboard
phonefield: ^1.0.2 copied to clipboard

The PhoneField package offers easy phone number input with validation, formatting, and internationalization support, ensuring accurate phone number handling.

Phonefield

Features #

Custom phone field with picker

Getting started #

To use this package, add phonefield to your pubspec.yaml file:

dependencies:
  phonefield: ^1.0.0

Usage #

Check out the example directory for detailed examples:

PhoneField(
    initialPhoneNumber: "+977",
    onChanged: (p0) {
        phoneNumber = p0;
        setState(() {});
        },
    )

Country Picker

CountryPicker(
  labelText: "Country",
  hintText: "Select a country",
  selectedCountry: selectedCountry,
  onChanged: (p0) {
    selectedState.value = null;
  },
  validator: (p0) {
    if (p0 == null) {
      return "Please select country ";
    }
    return null;
  },
),

State Picker

StatePicker(
    enabled: selectedCountry.value != null,
    hintText: "Select a state",
    countryCode: selectedCountry.value?.code,
    selectedState: selectedState,
    validator: (p0) {
      if (p0 == null || p0.isEmpty) {
        return selectedCountry.value != null
            ? "Please select state"
            : "Please select country first and select state";
      }
      return null;
    },
  ),
5
likes
150
points
60
downloads
screenshot

Publisher

verified publisherneupanenitesh.com.np

Weekly Downloads

The PhoneField package offers easy phone number input with validation, formatting, and internationalization support, ensuring accurate phone number handling.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

dio, dropdown_search, flutter

More

Packages that depend on phonefield