Skip to content

jihanurrahman33/bd_phone_validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📱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! 🚀

About

A Dart package for validating Bangladeshi phone numbers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages