inList static method
Checks if checkValue
is in the provided list
If checkValue
is not in the provided list than errorMessage
will be
returned if provided, else the default message is returned. Othersie null
is returned
Implementation
static String? inList(String? checkValue, List<String> list,
{String? errorMessage}) {
return list.contains(checkValue)
? null
: (errorMessage ?? "Unexpected value");
}