localregex
This plugin allows flutter developers to check if an input matches common regex patterns in Zimbabwe This plugin works for all Flutter supported platforms i.e. Android, iOS, Web and Desktop (Linux, Windows & MacOS).
Developed by Ngonidzashe Mangudya
Usage
Add dependency
localregex: ^2.0.3+1
Import package
import 'package:localregex/localregex.dart';
Declare and initialise
final localregex = LocalRegex();
Check if a mobile number matches patterns for Econet, Netone or Telecel numbers
localregex.isNetone('mobile_number');
localregex.isEconet('mobile_number');
localregex.isTelecel('mobile_number');
Check if a mobile number matches any of the patterns for Econet, Netone or Telecel
localregex.isZwMobile('mobile_number');
Check if a supplied email matches proper email patterns
localregex.isEmail('email_address');
Check if a supplied national id matches the pattern for Zimbabwean national id
localregex.isZimbabwean('national_id');
Check passport number
localregex.isZwPassword('passport_number');
Check number plate
localregex.isZwNumberPlate('number_plate');
Check driver's license
localregex.isZwDriversLicence('drivers_license');
Check mobile number and return mobile number in required format
String? number = localregex.formatIfIsZimbabwe(
value: '+263777213388',
type: FormatTypes.regular,
);
Format Types
Regular
This is the general format of mobile numbers e.g. 0777213388
FormatTypes.regular
Common
This is the mobile number format with country code but no + sign e.g. 263777213388
FormatTypes.common
Common Plus
This is the mobile number format with country code and + sign e.g. +263777213388
FormatTypes.commonPlus