This provides utility methods for working with bidirectional text. All
of the methods are static, and are organized into a class primarily to
group them together for documentation and discoverability.
Bidi stands for Bi-directional text. According to
Wikipedia:
Bi-directional text is text containing text in both text directionalities,
both right-to-left (RTL) and left-to-right (LTR). It generally involves text
containing different types of alphabets, but may also refer to
boustrophedon, which is changing text directionality in each row.
The Intl class provides a common entry point for internationalization
related tasks. An Intl instance can be created for a particular locale
and used to create a date format via anIntl.date(). Static methods
on this class are also used in message formatting.
// MAP VALIDATOR
// It is used to validate the data of a Map<String, dynamic>
// All input is required
Mv input = await Mv.validate(map, 'required.all');
// All input is required except phone and address
Mv input = await Mv.validate(map, 'required.all|phone,address');
// Set rule to specific input
Mv input = await Mv.validate(map, {
'name': 'required',
'email': 'required|email',
'phone': 'required|numeric|min:10|max:15',
});
// check result
bool ok = input.ok;
String? error = input.error;
Map<String, dynamic> result = input.result; // details