hasLength static method
Asserts that the given text
is not null and not empty.
Throws an InvalidArgumentException
with the given message
if the text is null or empty.
Example:
Assert.hasLength(password, 'Password cannot be empty');
Implementation
static void hasLength(String? text, String message) {
if (text == null || text.isEmpty) {
throw InvalidArgumentException(message);
}
}