queen_validators library
Classes
- Contains
- checks if the input does contain the provided value;
- ContainsAny
- check if the value contain at lest one of String form the provided list
- EndsWith
- IsArabicNum
-
checks if the input is a valid
integer
- IsBool
- IsDate
- IsDateAfter
- IsDateMillis
-
checks if the input is a valid
date
to parse byDateTime.fromMillisecondsSinceEpoch
factory - IsEgyptianPhone
- IsEmail
-
checks if the input is a valid
email
address - IsEmpty
- IsFacebookUrl
- IsHexColor
- checks if the input is valid hex color
- IsHindiNum
-
checks if the input is a valid
integer
- IsIn
-
checks if the input
is in
provided List; - IsInstagramUrl
- ISKsaPhone
- IsLtrLanguage
- IsNotIn
-
checks if the input
is NOT in
provided List; - IsNumber
-
checks if the input is a valid
integer
- IsOptional
- allows you to skip the errors if the input is null
- IsPort
-
checks if the input is a valid
port
- IsRequired
- IsRTLLanguage
- IsUrl
- IsYoutubeUrl
- Match
- checks if the input is match other string
- MaxLength
- checks if the input characters length is smaller than the min field
- MaxValue
- MinLength
- checks if the input characters length is bigger than the min field
- MinValue
- NotContains
- checks if input does not contain the provided value;
- NotContainsAny
- check if the value does not contain any item from the provided list
- QRule
- RegExpRule
- allow using a regular expression as validation rule
- StartsWith
- TextValidationRule
-
interface for the queen validation rules
extend it and implement :
isValid
to override the validation logictranslatedError
return translated message from nationsnationsKey
return key to use with nations
Functions
-
containsAny(
String v, List< String> list, {bool caseSensitive = false, bool trim = true}) → bool -
isArabicNum(
String input) → bool -
isBool(
Object? input) → bool -
isDate(
String? v) → bool -
checks if the input is a valid
date
to parse by DartDateTime
class -
isDateAfter(
Object? input, DateTime date) → bool -
isDateMills(
String v, {bool isUtc = false}) → bool -
checks if the input is a valid
date
to parse byDateTime.fromMillisecondsSinceEpoch
factory -
isEgyptianNumber(
String str) → bool -
isEmail(
String? email) → bool - checks if the value can be well formatted email address
-
isEmpty(
String? input) → bool -
trim
the string then checks ifisEmpty
if string is empty it will returns true -
isFacebookUrlValid(
String url) → bool -
isHexColor(
String? input) → bool -
can starts with or without
#
must contains -
isHindiNum(
String input) → bool -
isIn(
Object v, List< Object> list) → bool -
check if
string
is inList<String>
-
isInstgramUrlValid(
String url) → bool -
isKsaPhone(
String input) → bool -
isLtrLanguage(
String languageCode) → bool -
isNotEmpty(
String? string) → bool -
trim
the string then checks ifisNotEmpty
-
isNotIn(
Object v, List< Object> list) → bool -
check if
value
isNOT
inList
-
isNumber(
String? input) → bool -
isPort(
Object? input) → bool -
isRtlLanguage(
String languageCode) → bool -
isUrlValid(
String url) → bool -
isYoutubeUrLValid(
String url) → bool -
match(
Object? input, Object? other) → bool -
checks if two
Strings
are the same -
maxValue(
Object? value, num max) → bool -
minLength(
String? input, int min) → bool -
minValue(
Object? value, num min) → bool -
notContainsAny(
String v, List< String> list) → bool -
qValidator(
List< TextValidationRule> rules, {OnFailureCallBack? onFail, bool useNations = true}) → String? Function(String?) -
? build and return
String Function(String value)
? which triggers the provided validation rules
Typedefs
-
OnFailureCallBack
= void Function(String? input, List<
TextValidationRule> rules, TextValidationRule failedRule)