localregex 1.0.1
localregex: ^1.0.1 copied to clipboard
Regular expressions package for popular patterns in Zimbabwe i.e. Passport Number, Mobile Numbers, Number Plates, etc
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 (tested on Linux and Windows).
Developed by Ngonidzashe Mangudya
Usage #
Add dependency #
localregex: ^1.0.0
Import package #
import 'package:localregex/localregex.dart';
Declare and initialise #
final localregex = LocalRegex();
Use in code e.g. form field validation #
Padding(
padding: const EdgeInsets.all(8.0),
child: TextFormField(
decoration: InputDecoration(
labelText: "Mobile Number",
),
// ignore: missing_return
validator: (value) {
if (!localregex.isZwMobile(value)) {
return "Not a valid Zimbabwean mobile number";
}
},
),
),