phone_number_mask_parser
3.1.0, released 2 years ago by an unverified publisher
Dart package for parsing phone numbers and applying various masking options.
What it does
Provides a simple mechanism to parse phone numbers, determine countries and phone codes using an O(1) hash table, and apply custom or automatic masks.
AI-written summary of version 3.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to format raw, unformatted phone numbers received from server APIs for display.
- You need automatic country detection and parsing based on phone codes.
- You want to apply custom phone number masks using '#' symbols.
Skip it when
- You need a complex form input field formatter widget that interacts directly with TextField state (though it can be used for self phone field formatters).
- You require comprehensive global phone validation that relies on external libphonenumber data.
Strengths
- Efficient O(1) phone code recognition using a hash table.
- Supports custom target masks as well as automatic country-based masks.
- No external dependencies.
Weaknesses
- The built-in list of countries and phone codes may not contain all combinations of alternative codes.
- Limited to string parsing and masking operations rather than an out-of-the-box TextField widget formatter.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
const PhoneNumberMaskParser phoneNumberMaskParser = PhoneNumberMaskParser(
targetMask: "+## #### ######",
defaultMask: "+### (###) ### ####",
isPlus: false,
isEndless: true,
);
final PhoneNumberMaskParserResult result = phoneNumberMaskParser.apply(
phoneNumber: "4492330323912034",
);Alternatives
Packages that do the same job and could replace phone_number_mask_parser.
- flutter_intl_phone_field
International phone number input with country picker, formatting, and validation for 250+ countries.
76Compare - flutter_multi_formatter
Input formatters for international phone numbers, credit/debit cards, currencies, and custom masks.
75Compare - intl_mobile_field
Customized Flutter TextFormField to input international mobile numbers with country codes.
73Compare - form_builder_phone_field
International phone number input field for the flutter_form_builder package.
70Compare