bd_phone_validator 1.0.3
bd_phone_validator: ^1.0.3 copied to clipboard
A Dart package for validating Bangladeshi phone numbers.
📱BD Phone Validator
A Dart package for validating Bangladeshi phone numbers.
🚀 Features
- Supports +88, 88, or no prefix (e.g.,
+8801712345678,8801912345678,01712345678). - Ensures proper Bangladeshi mobile number format
01[3-9]XXXXXXXX(11 digits). - Simple and lightweight.
📌 Installation
Add this package to your pubspec.yaml:
dependencies:
bd_phone_validator: ^1.0.3
Then, run:
dart pub get
🎯 Usage
Import the package and validate numbers:
import 'package:bd_phone_validator/bd_phone_validator.dart';
void main() {
print(BdPhoneValidator.validate("+8801712345678")); // true
print(BdPhoneValidator.validate("01712345678")); // true
print(BdPhoneValidator.validate("8801912345678")); // true
print(BdPhoneValidator.validate("0123456789")); // false
}
🛠️ Running Tests
To run tests, execute:
dart test
🔗 Repository
Find this package on GitHub: Repository Link
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
Happy coding! 🚀