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

A lightweight Flutter TextInputFormatter for Uzbekistan phone numbers.

📱 UzbekPhoneFormatter

A lightweight Flutter TextInputFormatter for Uzbekistan phone numbers. Formats input into the common mask:

+998 ## ###-##-##

Includes built-in validation and E.164 conversion helpers.

✨ Features

Automatic formatting while typing or pasting

Mask style: +998 90 123-45-67

Validation with operator code checks

Conversion to E.164 format: +998901234567

No external dependencies, single class

🚀 Installation

Add to your pubspec.yaml:

dependencies: uzbek_phone_formatter: ^0.1.0

Then import it:

import 'package:uzbek_phone_formatter/uzbek_phone_formatter.dart';

📖 Usage TextFormField( keyboardType: TextInputType.phone, decoration: const InputDecoration( labelText: 'Telefon', hintText: '+998 90 123-45-67', ), inputFormatters: [ FilteringTextInputFormatter.digitsOnly, UzbekPhoneFormatter(), ], validator: UzbekPhoneFormatter.validate, onSaved: (v) { final e164 = UzbekPhoneFormatter.toE164(v ?? ''); print(e164); // -> +998901234567 }, );

✅ Validation final result = UzbekPhoneFormatter.validate('+998 90 123-45-67'); if (result == null) { print('Valid number'); } else { print(result); // error message }

🔄 Convert to E.164 final e164 = UzbekPhoneFormatter.toE164('+998 90 123-45-67'); // -> "+998901234567"

🛠 Roadmap

Support for multiple country masks

Configurable operator code validation

Unit tests for edge cases

📜 License

MIT License.

5
likes
130
points
2
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A lightweight Flutter TextInputFormatter for Uzbekistan phone numbers.

License

MIT (license)

Dependencies

flutter, mask_text_input_formatter

More

Packages that depend on uzbek_phone_input