A Dart package for validating Bangladeshi phone numbers.
- 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.
Add this package to your pubspec.yaml
:
dependencies:
bd_phone_validator: ^1.0.3
Then, run:
dart pub get
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
}
To run tests, execute:
dart test
Find this package on GitHub: Repository Link
This project is licensed under the MIT License - see the LICENSE file for details.
Happy coding! 🚀