flutter_phone_field_plus 1.0.4 copy "flutter_phone_field_plus: ^1.0.4" to clipboard
flutter_phone_field_plus: ^1.0.4 copied to clipboard

Flutter phone input field with country picker, international dialing codes, validation, and customizable UI. Lightweight, flexible, and easy to integrate.

Preview #

Country Picker Success Validation Failed Validation
[] [] []

flutter_phone_field_plus #

A highly customizable international phone number input field for Flutter applications.

flutter_phone_field_plus provides an elegant phone number input widget with:

  • 🌍 Country picker
  • 📞 International dialing codes
  • ✅ Phone number validation
  • 🎨 Customizable UI
  • 🚀 Easy integration
  • 📱 Production-ready experience

Features #

  • International phone number input
  • Country code selector
  • Automatic dial code handling
  • Built-in validation support
  • Custom input decoration
  • Country change callback
  • Phone number change callback
  • Works on Android, iOS, Web, Windows, macOS, and Linux

Installation #

Add the package to your pubspec.yaml:

dependencies:
  flutter_phone_field_plus: latest

Install dependencies:

flutter pub get

Import:

import 'package:flutter_phone_field_plus/flutter_phone_field_plus.dart';

Basic Usage #

FlutterPhoneFieldPlus(
  onChanged: (phone) {
    print(phone.completeNumber);
  },
)

Complete Example #

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

class PhoneFieldScreen extends StatelessWidget {
  const PhoneFieldScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Phone Field Example'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16),
        child: FlutterPhoneFieldPlus(
          decoration: const InputDecoration(
            labelText: 'Phone Number',
            border: OutlineInputBorder(),
          ),
          onChanged: (phone) {
            debugPrint(phone.completeNumber);
          },
        ),
      ),
    );
  }
}

Validation #

FlutterPhoneFieldPlus(
  validator: (phone) {
    if (phone == null || phone.number.isEmpty) {
      return 'Please enter a phone number';
    }

    return null;
  },
)

Country Change Callback #

FlutterPhoneFieldPlus(
  onCountryChanged: (country) {
    debugPrint(country.name);
  },
)

Phone Number Change Callback #

FlutterPhoneFieldPlus(
  onChanged: (phone) {
    debugPrint(phone.completeNumber);
  },
)

Custom Decoration #

FlutterPhoneFieldPlus(
  decoration: InputDecoration(
    labelText: 'Mobile Number',
    hintText: 'Enter phone number',
    border: OutlineInputBorder(
      borderRadius: BorderRadius.circular(12),
    ),
  ),
)

Example Output #

Country: India
Dial Code: +91
Number: 9876543210
Complete Number: +919876543210

Supported Platforms #

Platform Supported
Android
iOS
Web
Windows
macOS
Linux

Why flutter_phone_field_plus? #

Many Flutter projects require international phone number input. Setting up country pickers, dial codes, validation, and formatting repeatedly can become time-consuming.

flutter_phone_field_plus simplifies this process by providing a clean, customizable, and production-ready solution.


Contributing #

Contributions, issues, and feature requests are welcome.

If you have suggestions or improvements, feel free to open an issue or submit a pull request.


License #

MIT License


Author #

Developed with ❤️ using Flutter.

GitHub: https://github.com/bvkbbflutter/flutter_phone_field_plus

Pub.dev: https://pub.dev/packages/flutter_phone_field_plus

4
likes
0
points
193
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter phone input field with country picker, international dialing codes, validation, and customizable UI. Lightweight, flexible, and easy to integrate.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http, plugin_platform_interface, shared_preferences

More

Packages that depend on flutter_phone_field_plus

Packages that implement flutter_phone_field_plus