Logo Lanfrica

nicowalter256/uganda-phone-Util

Domain:

digital infrastructure

Record type:

softwaretools
Creator:
nic
Host:
# Uganda Phone Utils A comprehensive Dart library for validating and working with Uganda mobile phone numbers. Supports MTN, Airtel, and Lyca Mobile number formats with robust validation and formatting capabilities. ## Features - ✅ **Phone Number Validation**: Validate Uganda mobile numbers for MTN, Airtel, and Lyca - 🏢 **Operator Identification**: Identify the mobile network operator from a phone number - 📞 **Number Formatting**: Convert between local (07...) and international (+256...) formats - 🔢 **Subscriber Number Extraction**: Extract the subscriber number from a phone number - 🔄 **Flexible Input**: Accept numbers in various formats (with spaces, dashes, parentheses) - 🛡️ **Error Handling**: Robust error handling for invalid numbers ## Supported Operators | Operator | Prefixes | Example | | ---------------------- | -------------------------------------- | ---------- | | **MTN Uganda** | 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 | 0701234567 | | **Airtel Uganda** | 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 | 0301234567 | | **Lyca Mobile Uganda** | 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 | 0801234567 | ## Getting Started Add this to your package's `pubspec.yaml` file: ```yaml dependencies: uganda_phone_utils: ^1.0.0 ``` ## Usage ### Basic Validation ```dart import 'package:uganda_phone_utils/uganda_phone_utils.dart'; void main() { // Validate a phone number bool isValid = UgandaPhoneUtils.isValidUgandaMobileNumber('0701234567'); print(isValid); // true // Check if it's an MTN number bool isMtn = UgandaPhoneUtils.isMtnNumber('0701234567'); print(isMtn); // true // Check if it's an Airtel number bool isAirtel = UgandaPhoneUtils.isAirtelNumber('0301234567'); print(isAirtel); // true // Check if it's a Lyca number bool isLyca = UgandaPhoneUtils.isLycaNumber('0801234567'); print(isLyca); // true } ``` ### Operator Identification ```dart // Get the mobile operator UgandaMobileOperator operator = Uga …