Validators class
Used throughout the app to validate data.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
isUnitInterval(
num num) → bool -
Returns
true
if the givennum
is between 0 and 1 (inclusive). -
isValidGradient(
List< LightColorXy> ? points) → bool - Used when finalizing a gradient to send with PUT or POST.
-
isValidGradientDraft(
List< LightColorXy> ? points) → bool - Used to verify that the gradient is valid to be used as a draft.
-
isValidId(
String id) → bool -
Returns
true
if the givenid
conforms to the proper regex pattern. -
isValidIdV1(
String idV1) → bool -
Returns
true
if the givenidV1
conforms to the proper regex pattern or if it is empty. -
isValidIpAddress(
String ipAddress) → bool -
Returns
true
if the givenipAddress
conforms to the proper regex pattern. -
isValidLatitude(
double latitude) → bool -
Returns
true
if the givenlatitude
is between -90 and 90 (inclusive). -
isValidLongitude(
double longitude) → bool -
Returns
true
if the givenlongitude
is between -180 and 180 (inclusive). -
isValidMacAddress(
String macAddress) → bool -
Returns
true
if the givenmacAddress
conforms to the proper regex pattern. -
isValidMired(
int mired) → bool -
Returns
true
if the givenmired
is between 153 and 500 (inclusive). -
isValidMirek(
int mirek) → bool -
Returns
true
if the givenmirek
is between 153 and 500 (inclusive). -
isValidName(
String name) → bool -
Returns
true
if the length ofname
is between 1 and 32 characters (inclusive). -
isValidPercentage(
num percentage) → bool -
Returns
true
if the givenpercentage
is between 0 and 100 (inclusive). -
isValidScriptId(
String scriptId) → bool -
Returns
true
if the givenscriptId
conforms to the proper regex pattern. -
isValidScriptVersion(
String scriptVersion) → bool -
Returns
true
if the givenscriptVersion
conforms to the proper regex pattern. -
isValidSoftwareVersion(
String softwareVersion) → bool -
Returns
true
if the givensoftwareVersion
conforms to the proper regex pattern. -
isValidValue<
T> (T value, List< T> validValues) → bool -
Returns
true
if the the givenvalue
is found withinvalidValues
or if thevalidValues
list is empty andvalue
is empty as well.