phonenumber_input 0.0.3 copy "phonenumber_input: ^0.0.3" to clipboard
phonenumber_input: ^0.0.3 copied to clipboard

Phone Number Input with country code flutter package, quick and easy way to accept phone number from users.

PhoneNumberInput Flutter Widget 📱 #

Welcome to the initial release of PhoneNumberInput, a Flutter widget that allows users to input phone numbers with country code selection. Stay tuned for more exciting features in future releases!🚀

Example 🌈 #

PhoneNumberInput(
  labelText: 'Phone Number',
  isDarkMode: false,
  onCountryCodeChanged: (code) {
    print('Country code changed: $code');
  },
  onPhoneNumberChanged: (phoneNumber) {
    print('Phone number changed: $phoneNumber');
  },
)
PhoneNumberInput(
  labelText: 'Phone Number',
  isDarkMode: true,
  onCountryCodeChanged: (code) {
    print('Country code changed: $code');
  },
  onPhoneNumberChanged: (phoneNumber) {
    print('Phone number changed: $phoneNumber');
  },
)

Features 🌟 #

Phone number input with country code selection Customizable label, styles, and dark mode support Callbacks for country code and phone number changes.

Installation 🛠️ #

To use this widget in your Flutter project, add the following to your pubspec.yaml file:

dependencies:
  phonenumber_input: ^1.0.0

Then, run:

flutter pub get

Usage 🚨 #

import 'package:flutter/material.dart';
import 'package:phonenumber_input/phonenumber_input.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('PhoneNumberInput Demo'),
        ),
        body: Center(
          child: PhoneNumberInput(
            labelText: 'Phone Number',
            isDarkMode: false,
            onCountryCodeChanged: (code) {
              print('Country code changed: $code');
            },
            onPhoneNumberChanged: (phoneNumber) {
              print('Phone number changed: $phoneNumber');
            },
          ),
        ),
      ),
    );
  }
}

Widget Properties 🎨 #

  • labelText (String): The label text for the phone number input.
  • padding (EdgeInsetsGeometry): Padding for the widget.
  • labelStyle (TextStyle): Style for the label text.
  • countryCodeStyle (TextStyle): Style for the country code text.
  • isDarkMode (bool): Set to true for dark mode, false for light mode.
  • onCountryCodeChanged (Function(String)?): Callback for country code changes.
  • onPhoneNumberChanged (Function(String)?): Callback for phone number changes.

Thank you for using PhoneNumberInput! Feel free to contribute, report issues, or suggest new features. Enjoy coding with Flutter! 🎉

2
likes
160
points
62
downloads

Publisher

verified publisherabhishekdana.in

Weekly Downloads

Phone Number Input with country code flutter package, quick and easy way to accept phone number from users.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on phonenumber_input